mirror of https://github.com/certd/certd
perf: 隐藏运行策略选项
parent
57309ae3d5
commit
2951df0cd9
|
@ -64,6 +64,7 @@ export type PluginDefine = Registrable & {
|
|||
};
|
||||
};
|
||||
needPlus?: boolean;
|
||||
showRunStrategy?: boolean;
|
||||
};
|
||||
|
||||
export type ITaskPlugin = {
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<fs-form-item v-if="item.show !== false" v-model="currentStep.input[key]" :item="item" :get-context-fn="getScopeFunc" />
|
||||
</template>
|
||||
|
||||
<fs-form-item v-model="currentStep.strategy.runStrategy" :item="runStrategyProps" :get-context-fn="getScopeFunc" />
|
||||
<fs-form-item v-if="currentPlugin.showRunStrategy" v-model="currentStep.strategy.runStrategy" :item="runStrategyProps" :get-context-fn="getScopeFunc" />
|
||||
</a-form>
|
||||
</div>
|
||||
<template #footer>
|
||||
|
@ -396,9 +396,9 @@ export default {
|
|||
render: () => {
|
||||
return (
|
||||
<div>
|
||||
<div class="color-green">一般保持默认即可</div>
|
||||
<div>正常运行:每次都运行,证书任务需要每次都运行</div>
|
||||
<div>成功后跳过:该任务成功一次之后跳过,不重复执行(证书变化之后才会再次运行)</div>
|
||||
<div class="green">保持默认即可</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
|
|
|
@ -15,6 +15,7 @@ const defaultFilePrefix = 'db-backup';
|
|||
icon: 'lucide:database-backup',
|
||||
desc: '仅支持备份SQLite数据库',
|
||||
group: pluginGroups.other.key,
|
||||
showRunStrategy: true,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.AlwaysRun,
|
||||
|
|
|
@ -12,6 +12,7 @@ export type CustomScriptContext = {
|
|||
icon: 'ri:javascript-line',
|
||||
desc: '【仅管理员】运行自定义js脚本执行',
|
||||
group: pluginGroups.other.key,
|
||||
showRunStrategy:true,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||
|
|
|
@ -6,6 +6,7 @@ import { AbstractTaskPlugin, IsTaskPlugin, pluginGroups, RunStrategy, TaskInput
|
|||
icon: 'ri:rest-time-line',
|
||||
desc: '等待一段时间',
|
||||
group: pluginGroups.other.key,
|
||||
showRunStrategy:true,
|
||||
default: {
|
||||
strategy: {
|
||||
runStrategy: RunStrategy.SkipWhenSucceed,
|
||||
|
|
Loading…
Reference in New Issue