mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
fix: 修复某些情况下编辑流水线,没有立即展示变更效果的bug
This commit is contained in:
@@ -56,7 +56,7 @@ const pipelineOptions: PipelineOptions = {
|
||||
},
|
||||
|
||||
async doSave(pipelineConfig: any) {
|
||||
await api.Save({
|
||||
return await api.Save({
|
||||
id: pipelineConfig.id,
|
||||
content: JSON.stringify(pipelineConfig),
|
||||
});
|
||||
|
||||
@@ -739,6 +739,10 @@ export default defineComponent({
|
||||
async onOk() {
|
||||
//@ts-ignore
|
||||
await changeCurrentHistory(null);
|
||||
if (histories.value.length > 0) {
|
||||
pipeline.value = histories.value[0].pipeline;
|
||||
}
|
||||
|
||||
await props.options.doTrigger({ pipelineId: pipeline.value.id, stepId: stepId });
|
||||
notification.success({ message: "管道已经开始运行" });
|
||||
},
|
||||
@@ -837,7 +841,11 @@ export default defineComponent({
|
||||
return item.tasks.length === 0;
|
||||
});
|
||||
|
||||
await props.options.doSave(pipeline.value);
|
||||
const { version } = await props.options.doSave(pipeline.value);
|
||||
if (version) {
|
||||
pipeline.value.version = version;
|
||||
currentPipeline.value.version = version;
|
||||
}
|
||||
}
|
||||
if (offEdit) {
|
||||
toggleEditMode(false);
|
||||
|
||||
@@ -91,7 +91,7 @@ export class PipelineController extends CrudController<PipelineService> {
|
||||
delete bean.validTime
|
||||
}
|
||||
|
||||
await this.service.save(bean);
|
||||
const {version} = await this.service.save(bean);
|
||||
//是否增加证书监控
|
||||
if (bean.addToMonitorEnabled && bean.addToMonitorDomains) {
|
||||
const sysPublicSettings = await this.sysSettingsService.getPublicSettings();
|
||||
@@ -103,7 +103,7 @@ export class PipelineController extends CrudController<PipelineService> {
|
||||
});
|
||||
}
|
||||
}
|
||||
return this.ok(bean.id);
|
||||
return this.ok({id:bean.id,version:version});
|
||||
}
|
||||
|
||||
@Post('/delete', { summary: Constants.per.authOnly })
|
||||
|
||||
@@ -241,7 +241,10 @@ export class PipelineService extends BaseService<PipelineEntity> {
|
||||
fromType = "auto";
|
||||
}
|
||||
await this.certInfoService.updateDomains(pipeline.id, pipeline.userId || bean.userId, domains, fromType);
|
||||
return bean;
|
||||
return {
|
||||
...bean,
|
||||
version: pipeline.version,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user