mirror of
https://github.com/certd/certd.git
synced 2026-04-23 19:57:27 +08:00
perf: 证书直接查看
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user