perf: 证书直接查看

This commit is contained in:
xiaojunnuo
2024-10-15 17:12:42 +08:00
parent 64c4933645
commit 5dde5bd3f7
13 changed files with 189 additions and 98 deletions
@@ -15,7 +15,7 @@ export class CertController extends BaseController {
async getCert(@Query('id') id: number) {
const userId = this.getUserId();
await this.pipelineService.checkUserId(id, userId);
const privateVars = this.storeService.getPipelinePrivateVars(id);
return this.ok(privateVars);
const privateVars = await this.storeService.getPipelinePrivateVars(id);
return this.ok(privateVars.cert);
}
}
@@ -60,12 +60,17 @@ export class StorageService extends BaseService<StorageEntity> {
if (pipelineId == null) {
throw new Error('pipelineId 不能为空');
}
return await this.repository.find({
const res = await this.repository.findOne({
where: {
scope: 'pipeline',
namespace: pipelineId + '',
key: 'privateVars',
},
});
if (!res) {
return {};
}
const value = JSON.parse(res.value);
return value.value;
}
}
@@ -31,6 +31,7 @@ export class HostShellExecutePlugin extends AbstractTaskPlugin {
name: 'a-textarea',
vModel: 'value',
rows: 6,
placeholder: 'systemctl restart nginx',
},
helper: '注意:如果目标主机是windows,且终端是cmd,系统会自动将多行命令通过“&&”连接成一行',
required: true,