fix: 修复某些情况下编辑流水线,没有立即展示变更效果的bug

This commit is contained in:
xiaojunnuo
2025-11-07 01:15:05 +08:00
parent 0203aa2b6e
commit 65e53092e8
4 changed files with 16 additions and 5 deletions
@@ -56,7 +56,7 @@ const pipelineOptions: PipelineOptions = {
}, },
async doSave(pipelineConfig: any) { async doSave(pipelineConfig: any) {
await api.Save({ return await api.Save({
id: pipelineConfig.id, id: pipelineConfig.id,
content: JSON.stringify(pipelineConfig), content: JSON.stringify(pipelineConfig),
}); });
@@ -739,6 +739,10 @@ export default defineComponent({
async onOk() { async onOk() {
//@ts-ignore //@ts-ignore
await changeCurrentHistory(null); await changeCurrentHistory(null);
if (histories.value.length > 0) {
pipeline.value = histories.value[0].pipeline;
}
await props.options.doTrigger({ pipelineId: pipeline.value.id, stepId: stepId }); await props.options.doTrigger({ pipelineId: pipeline.value.id, stepId: stepId });
notification.success({ message: "管道已经开始运行" }); notification.success({ message: "管道已经开始运行" });
}, },
@@ -837,7 +841,11 @@ export default defineComponent({
return item.tasks.length === 0; 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) { if (offEdit) {
toggleEditMode(false); toggleEditMode(false);
@@ -91,7 +91,7 @@ export class PipelineController extends CrudController<PipelineService> {
delete bean.validTime delete bean.validTime
} }
await this.service.save(bean); const {version} = await this.service.save(bean);
//是否增加证书监控 //是否增加证书监控
if (bean.addToMonitorEnabled && bean.addToMonitorDomains) { if (bean.addToMonitorEnabled && bean.addToMonitorDomains) {
const sysPublicSettings = await this.sysSettingsService.getPublicSettings(); 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 }) @Post('/delete', { summary: Constants.per.authOnly })
@@ -241,7 +241,10 @@ export class PipelineService extends BaseService<PipelineEntity> {
fromType = "auto"; fromType = "auto";
} }
await this.certInfoService.updateDomains(pipeline.id, pipeline.userId || bean.userId, domains, fromType); await this.certInfoService.updateDomains(pipeline.id, pipeline.userId || bean.userId, domains, fromType);
return bean; return {
...bean,
version: pipeline.version,
};
} }
/** /**