v2-dev-order
xiaojunnuo 2025-07-22 12:22:54 +08:00
parent 13dfca1749
commit b0f91f1eea
5 changed files with 46 additions and 43 deletions

View File

@ -352,6 +352,7 @@ export class Executor {
pipeline: this.pipeline, pipeline: this.pipeline,
runtime: this.runtime, runtime: this.runtime,
step, step,
define: cloneDeep(define),
lastStatus, lastStatus,
http, http,
download, download,

View File

@ -86,6 +86,7 @@ export type TaskInstanceContext = {
runtime: RunHistory; runtime: RunHistory;
//步骤定义 //步骤定义
step: Step; step: Step;
define: PluginDefine;
//日志 //日志
logger: ILogger; logger: ILogger;
//当前步骤输入参数跟上一次执行比较是否有变化 //当前步骤输入参数跟上一次执行比较是否有变化
@ -164,9 +165,7 @@ export abstract class AbstractTaskPlugin implements ITaskPlugin {
this.registerSecret(cert.one); this.registerSecret(cert.one);
} }
debugger if (this.ctx.define.onlyAdmin) {
// @ts-ignore
if (this.ctx.step.onlyAdmin) {
if (!this.isAdmin()) { if (!this.isAdmin()) {
throw new Error("只有管理员才能运行此任务"); throw new Error("只有管理员才能运行此任务");
} }

View File

@ -26,7 +26,8 @@
</template> </template>
<div class="flex-col h-100 w-100 overflow-hidden"> <div class="flex-col h-100 w-100 overflow-hidden">
<a-tabs v-model:active-key="pluginGroupActive" tab-position="left" class="flex-1 overflow-hidden"> <a-tabs v-model:active-key="pluginGroupActive" tab-position="left" class="flex-1 overflow-hidden">
<a-tab-pane v-for="group of computedPluginGroups" :key="group.key" class="scroll-y"> <template v-for="group of computedPluginGroups" :key="group.key">
<a-tab-pane v-if="(group.key === 'admin' && userStore.isAdmin) || group.key !== 'admin'" :key="group.key" class="scroll-y">
<template #tab> <template #tab>
<div class="cd-step-form-tab-label"> <div class="cd-step-form-tab-label">
<fs-icon :icon="group.icon" class="mr-2" /> <fs-icon :icon="group.icon" class="mr-2" />
@ -63,6 +64,7 @@
</a-col> </a-col>
</a-row> </a-row>
</a-tab-pane> </a-tab-pane>
</template>
</a-tabs> </a-tabs>
</div> </div>
<template #footer> <template #footer>
@ -124,6 +126,7 @@ import { useReference } from "/@/use/use-refrence";
import { useSettingStore } from "/@/store/settings"; import { useSettingStore } from "/@/store/settings";
import { mitter } from "/@/utils/util.mitt"; import { mitter } from "/@/utils/util.mitt";
import { utils } from "/@/utils"; import { utils } from "/@/utils";
import { useUserStore } from "/@/store/user";
defineOptions({ defineOptions({
name: "PiStepForm", name: "PiStepForm",
@ -138,7 +141,7 @@ const props = defineProps({
const emit = defineEmits(["update"]); const emit = defineEmits(["update"]);
const pluginStore = usePluginStore(); const pluginStore = usePluginStore();
const userStore = useUserStore();
function transformDesc(desc: string = "") { function transformDesc(desc: string = "") {
return utils.transformLink(desc); return utils.transformLink(desc);
} }

View File

@ -6,7 +6,7 @@ import { httpsServer } from '../../modules/auto/https/server.js';
title: '重启 Certd', title: '重启 Certd',
icon: 'mdi:restart', icon: 'mdi:restart',
desc: '【仅管理员可用】 重启 certd的https服务用于更新 Certd 的 ssl 证书', desc: '【仅管理员可用】 重启 certd的https服务用于更新 Certd 的 ssl 证书',
group: pluginGroups.other.key, group: pluginGroups.admin.key,
onlyAdmin:true, onlyAdmin:true,
default: { default: {
strategy: { strategy: {

View File

@ -11,7 +11,7 @@ export type CustomScriptContext = {
title: '自定义js脚本', title: '自定义js脚本',
icon: 'ri:javascript-line', icon: 'ri:javascript-line',
desc: '【仅管理员】运行自定义js脚本执行', desc: '【仅管理员】运行自定义js脚本执行',
group: pluginGroups.other.key, group: pluginGroups.admin.key,
showRunStrategy: true, showRunStrategy: true,
onlyAdmin: true, onlyAdmin: true,
default: { default: {