perf: 支持选择运行策略设置

This commit is contained in:
xiaojunnuo
2025-06-30 23:48:00 +08:00
parent c67a9215e3
commit 60f055f293
11 changed files with 108 additions and 30 deletions
@@ -264,6 +264,18 @@ export default {
bulkImport: "Bulk Import",
basicLimitError: "Basic version allows only one monitoring site. Please upgrade to the Pro version.",
limitExceeded: "Sorry, you can only create up to {max} monitoring records. Please purchase or upgrade your plan.",
setting: {
siteMonitorSettings: "Site Monitor Settings",
notificationChannel: "Notification Channel",
setNotificationChannel: "Set the notification channel",
retryTimes: "Retry Times",
monitorRetryTimes: "Number of retry attempts for monitoring requests",
monitorCronSetting: "Monitoring Schedule",
cronTrigger: "Scheduled trigger for monitoring",
dnsServer: "DNS Server",
// dnsServerHelper: "使用自定义的域名解析服务器,如:1.1.1.1,8.8.8.8",
dnsServerHelper: "Use a custom domain name resolution server, such as: 1.1.1.1,8.8.8.8",
},
},
checkStatus: {
success: "Success",
@@ -302,13 +314,6 @@ export default {
nickName: "Nickname",
max50Chars: "Maximum 50 characters",
myInfo: "My Information",
siteMonitorSettings: "Site Monitor Settings",
notificationChannel: "Notification Channel",
setNotificationChannel: "Set the notification channel",
retryTimes: "Retry Times",
monitorRetryTimes: "Number of retry attempts for monitoring requests",
monitorCronSetting: "Monitoring Schedule",
cronTrigger: "Scheduled trigger for monitoring",
save: "Save",
editSchedule: "Edit Schedule",
timerTrigger: "Timer Trigger",
@@ -692,10 +697,16 @@ export default {
useTemplate: "Use This Template",
batchCreate: "Batch Create Pipeline",
singleCreate: "Create Single Pipeline",
importCreate: "Batch Import Create",
templateName: "Template Name",
enterTemplateName: "Please enter template name",
copyPipelineConfig: "Copy this pipeline configuration as template source",
pipeline: "Pipeline",
},
sys: {
setting: {
showRunStrategy: "Show RunStrategy",
showRunStrategyHelper: "Allow modify the run strategy of the task",
},
},
};
@@ -269,6 +269,17 @@ export default {
bulkImport: "批量导入",
basicLimitError: "基础版只能添加一个监控站点,请赞助升级专业版",
limitExceeded: "对不起,您最多只能创建条{max}监控记录,请购买或升级套餐",
setting: {
siteMonitorSettings: "站点监控设置",
notificationChannel: "通知渠道",
setNotificationChannel: "设置通知渠道",
retryTimes: "重试次数",
monitorRetryTimes: "监控请求重试次数",
monitorCronSetting: "监控定时设置",
cronTrigger: "定时触发监控",
dnsServer: "DNS服务器",
dnsServerHelper: "使用自定义的域名解析服务器,如:1.1.1.1,8.8.8.8",
},
},
checkStatus: {
success: "成功",
@@ -307,13 +318,7 @@ export default {
nickName: "昵称",
max50Chars: "最大50个字符",
myInfo: "我的信息",
siteMonitorSettings: "站点监控设置",
notificationChannel: "通知渠道",
setNotificationChannel: "设置通知渠道",
retryTimes: "重试次数",
monitorRetryTimes: "监控请求重试次数",
monitorCronSetting: "监控定时设置",
cronTrigger: "定时触发监控",
save: "保存",
editSchedule: "修改定时",
timerTrigger: "定时触发",
@@ -695,10 +700,15 @@ export default {
useTemplate: "使用此模板",
batchCreate: "批量创建流水线",
singleCreate: "创建单个流水线",
importCreate: "批量导入创建",
templateName: "模板名称",
enterTemplateName: "请输入模板名称",
copyPipelineConfig: "复制该流水线配置作为模板来源",
pipeline: "流水线",
},
sys: {
setting: {
showRunStrategy: "显示运行策略选择",
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
},
},
};
@@ -43,6 +43,8 @@ export type SysPublicSetting = {
mpsNo?: string;
robots?: boolean;
aiChatEnabled?: boolean;
showRunStrategy?: boolean;
};
export type SuiteSetting = {
enabled?: boolean;
@@ -5,6 +5,7 @@ export type UserSiteMonitorSetting = {
notificationId?: number;
retryTimes?: number;
cron?: string;
dnsServer?: string[];
};
export async function SiteMonitorSettingsGet() {
@@ -1,28 +1,34 @@
<template>
<fs-page class="page-user-settings page-site-monitor-setting">
<template #header>
<div class="title">{{ t("certd.siteMonitorSettings") }}</div>
<div class="title">{{ t("certd.monitor.setting.siteMonitorSettings") }}</div>
</template>
<div class="user-settings-form settings-form">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<a-form-item :label="t('certd.notificationChannel')" :name="['notificationId']">
<a-form-item :label="t('certd.monitor.setting.notificationChannel')" :name="['notificationId']">
<div class="flex">
<NotificationSelector v-model="formState.notificationId" />
</div>
<div class="helper">{{ t("certd.setNotificationChannel") }}</div>
<div class="helper">{{ t("certd.monitor.setting.setNotificationChannel") }}</div>
</a-form-item>
<a-form-item :label="t('certd.retryTimes')" :name="['retryTimes']">
<a-form-item :label="t('certd.monitor.setting.retryTimes')" :name="['retryTimes']">
<div class="flex">
<a-input-number v-model:value="formState.retryTimes" />
</div>
<div class="helper">{{ t("certd.monitorRetryTimes") }}</div>
<div class="helper">{{ t("certd.monitor.setting.monitorRetryTimes") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitorCronSetting')" :name="['cron']">
<a-form-item :label="t('certd.monitor.setting.dnsServer')" :name="['dnsServer']">
<div class="flex">
<a-select v-model:value="formState.dnsServer" mode="tags" :open="false" />
</div>
<div class="helper">{{ t("certd.monitor.setting.dnsServerHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.monitorCronSetting')" :name="['cron']">
<div class="flex flex-baseline">
<cron-editor v-model="formState.cron" :disabled="!settingsStore.isPlus" :allow-every-min="userStore.isAdmin" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">{{ t("certd.cronTrigger") }}</div>
<div class="helper">{{ t("certd.monitor.setting.cronTrigger") }}</div>
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<loading-button type="primary" html-type="button" :click="doSave">{{ t("certd.save") }}</loading-button>
@@ -100,7 +100,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-if="currentPlugin.showRunStrategy" v-model="currentStep.strategy.runStrategy" :item="runStrategyProps" :get-context-fn="getScopeFunc" />
<fs-form-item v-if="settingStore.sysPublic.showRunStrategy || currentPlugin.showRunStrategy" v-model="currentStep.strategy.runStrategy" :item="runStrategyProps" :get-context-fn="getScopeFunc" />
</a-form>
</div>
<template #footer>
@@ -143,6 +143,8 @@ function transformDesc(desc: string = "") {
return utils.transformLink(desc);
}
const settingStore = useSettingStore();
/**
* step drawer
* @returns
@@ -37,6 +37,11 @@
<div class="helper">{{ t("certd.dualStackNetworkHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.showRunStrategy')" :name="['public', 'showRunStrategy']">
<a-switch v-model:checked="formState.public.showRunStrategy" />
<div class="helper">{{ t("certd.sys.setting.showRunStrategyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.enableCommonCnameService')" :name="['private', 'commonCnameEnabled']">
<a-switch v-model:checked="formState.private.commonCnameEnabled" />
<div class="helper" v-html="t('certd.commonCnameHelper')"></div>