chore: 支持手动上传证书并部署

This commit is contained in:
xiaojunnuo
2025-03-19 00:28:50 +08:00
parent 873f2b618b
commit d1b61b6bf9
17 changed files with 491 additions and 172 deletions
@@ -26,6 +26,10 @@ export type UpdateCertReq = {
export type CreateUploadPipelineReq = {
cert: CertInfo;
userId: number;
pipeline?:{
input?:any;
notifications?:any[]
}
};
@Provide("CertUploadService")
@@ -86,13 +90,16 @@ export class CertUploadService extends BaseService<CertInfoEntity> {
});
const pipelineTitle = certReader.getAllDomains()[0] +"上传证书自动部署";
const notifications = [];
notifications.push({
type: "custom",
when: ["error", "turnToSuccess", "success"],
notificationId: 0,
title: "默认通知",
});
const notifications = body.pipeline?.notifications ||[];
if(notifications.length === 0){
notifications.push({
type: "custom",
when: ["error", "turnToSuccess", "success"],
notificationId: 0,
title: "默认通知",
});
}
let pipeline = {
title: pipelineTitle,
runnableType: "pipeline",
@@ -115,6 +122,7 @@ export class CertUploadService extends BaseService<CertInfoEntity> {
input: {
certInfoId: newCertInfo.id,
domains: newCertInfo.domains.split(','),
...body.pipeline?.input
},
strategy: {
runStrategy: 0, // 正常执行
@@ -144,7 +152,10 @@ export class CertUploadService extends BaseService<CertInfoEntity> {
pipelineId: newPipeline.id
});
return newCertInfo.id
return {
id:newCertInfo.id,
pipelineId: newPipeline.id
}
})