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
@@ -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>