From 2951df0cd94c23e2efee84ff1b843055aac56cae Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Thu, 10 Apr 2025 09:35:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?perf:=20=E9=9A=90=E8=97=8F=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E7=AD=96=E7=95=A5=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/pipeline/src/plugin/api.ts | 1 + packages/core/pipeline/src/plugin/decorator.ts | 12 +++++++++++- .../pipeline/pipeline/component/step-form/index.vue | 4 ++-- .../plugins/plugin-other/plugins/plugin-db-backup.ts | 1 + .../plugins/plugin-other/plugins/plugin-script.ts | 1 + .../src/plugins/plugin-other/plugins/plugin-wait.ts | 1 + 6 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/core/pipeline/src/plugin/api.ts b/packages/core/pipeline/src/plugin/api.ts index 30f28c67..93d085ef 100644 --- a/packages/core/pipeline/src/plugin/api.ts +++ b/packages/core/pipeline/src/plugin/api.ts @@ -64,6 +64,7 @@ export type PluginDefine = Registrable & { }; }; needPlus?: boolean; + showRunStrategy?: boolean; }; export type ITaskPlugin = { diff --git a/packages/core/pipeline/src/plugin/decorator.ts b/packages/core/pipeline/src/plugin/decorator.ts index 442dbc2c..48024a19 100644 --- a/packages/core/pipeline/src/plugin/decorator.ts +++ b/packages/core/pipeline/src/plugin/decorator.ts @@ -48,11 +48,21 @@ export function IsTaskPlugin(define: PluginDefine): ClassDecorator { inputMap[item[0]] = item[1]; }); - merge(define, { input: inputMap, autowire: autowires, output: outputs }); + const defaultConfig = { + showRunStrategy: false, + default: { + strategy: { + runStrategy: 1, // 0:正常执行,1:成功后跳过 + }, + }, + }; + + define = merge(defaultConfig, define, { input: inputMap, autowire: autowires, output: outputs }); Reflect.defineMetadata(PLUGIN_CLASS_KEY, define, target); target.define = define; + pluginRegistry.register(define.name, { define, target, diff --git a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue index 88120b9d..247b5b73 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/pipeline/component/step-form/index.vue @@ -98,7 +98,7 @@ - +