Merge branch 'v2-dev' into v2_admin_mode

This commit is contained in:
xiaojunnuo
2026-02-19 00:15:15 +08:00
43 changed files with 351 additions and 281 deletions
@@ -230,9 +230,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
name: "fs-dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.cert.expired"), value: "expired" },
{ label: t("certd.monitor.cert.expiring"), value: "expiring" },
{ label: t("certd.monitor.cert.noExpired"), value: "noExpired" },
{ label: t("monitor.cert.expired"), value: "expired" },
{ label: t("monitor.cert.expiring"), value: "expiring" },
{ label: t("monitor.cert.noExpired"), value: "noExpired" },
],
}),
},
@@ -86,13 +86,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
function checkAll() {
Modal.confirm({
title: t("certd.monitor.confirmTitle"), // "确认"
content: t("certd.monitor.confirmContent"), // "确认触发检查全部站点证书吗?"
title: t("monitor.confirmTitle"), // "确认"
content: t("monitor.confirmContent"), // "确认触发检查全部站点证书吗?"
onOk: async () => {
await siteInfoApi.CheckAll();
notification.success({
message: t("certd.monitor.checkSubmitted"), // "检查任务已提交"
description: t("certd.monitor.pleaseRefresh"), // "请稍后刷新页面查看结果"
message: t("monitor.checkSubmitted"), // "检查任务已提交"
description: t("monitor.pleaseRefresh"), // "请稍后刷新页面查看结果"
});
},
});
@@ -203,7 +203,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
// 非plus
if (crudBinding.value.data.length >= 1) {
notification.error({
message: t("certd.monitor.basicLimitError"),
message: t("monitor.basicLimitError"),
});
mitter.emit("openVipModal");
return;
@@ -217,7 +217,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const max = suiteDetail.monitorCount.max;
if (max != -1 && max <= suiteDetail.monitorCount.used) {
notification.error({
message: t("certd.monitor.limitExceeded", { max }),
message: t("monitor.limitExceeded", { max }),
});
return;
}
@@ -232,7 +232,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
//导入按钮
import: {
show: true,
text: t("certd.monitor.bulkImport"),
text: t("monitor.bulkImport"),
type: "primary",
async click() {
const defaultGroupId = getDefaultGroupId();
@@ -246,7 +246,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
checkAll: {
show: true,
text: t("certd.monitor.checkAll"),
text: t("monitor.checkAll"),
type: "primary",
click() {
checkAll();
@@ -270,7 +270,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
await api.DoCheck(row.id);
await crudExpose.doRefresh();
notification.success({
message: t("certd.monitor.checkSubmittedRefresh"),
message: t("monitor.checkSubmittedRefresh"),
});
},
},
@@ -280,7 +280,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
text: null,
show: compute(({ row }) => row.ipCheck === true),
tooltip: {
title: t("certd.monitor.ipManagement"),
title: t("monitor.ipManagement"),
},
icon: "entypo:address",
click: async ({ row }) => {
@@ -315,29 +315,29 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
name: {
title: t("certd.monitor.siteName"),
title: t("monitor.siteName"),
search: {
show: true,
},
type: "text",
form: {
rules: [{ required: true, message: t("certd.monitor.enterSiteName") }],
rules: [{ required: true, message: t("monitor.enterSiteName") }],
},
column: {
width: 160,
},
},
domain: {
title: t("certd.monitor.domain"),
title: t("monitor.domain"),
search: {
show: true,
},
type: "text",
form: {
rules: [
{ required: true, message: t("certd.monitor.enterDomain") },
{ required: true, message: t("monitor.enterDomain") },
// @ts-ignore
{ type: "domains", message: t("certd.monitor.enterValidDomain") },
{ type: "domains", message: t("monitor.enterValidDomain") },
],
},
column: {
@@ -358,14 +358,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
httpsPort: {
title: t("certd.monitor.httpsPort"),
title: t("monitor.httpsPort"),
search: {
show: false,
},
type: "number",
form: {
value: 443,
rules: [{ required: true, message: t("certd.monitor.enterPort") }],
rules: [{ required: true, message: t("monitor.enterPort") }],
},
column: {
width: 100,
@@ -373,7 +373,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certInfo: {
title: t("certd.monitor.certInfo"),
title: t("monitor.certInfo"),
type: "text",
form: { show: false },
column: {
@@ -387,10 +387,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
return (
<div>
<div>
{t("certd.monitor.issuer")}: {row.certProvider}
{t("monitor.issuer")}: {row.certProvider}
</div>
<div>
{t("certd.monitor.certDomains")}: {row.certDomains}
{t("monitor.certDomains")}: {row.certDomains}
</div>
</div>
);
@@ -405,7 +405,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certDomains: {
title: t("certd.monitor.certDomains"),
title: t("monitor.certDomains"),
search: {
show: true,
},
@@ -427,7 +427,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certProvider: {
title: t("certd.monitor.certProvider"),
title: t("monitor.certProvider"),
search: {
show: false,
},
@@ -445,15 +445,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certStatus: {
title: t("certd.monitor.certStatus"),
title: t("monitor.certStatus"),
search: {
show: true,
},
type: "dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.status.ok"), value: "ok", color: "green" },
{ label: t("certd.monitor.status.expired"), value: "expired", color: "red" },
{ label: t("monitor.status.ok"), value: "ok", color: "green" },
{ label: t("monitor.status.expired"), value: "expired", color: "red" },
],
}),
form: {
@@ -467,7 +467,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
checkStatus: {
title: t("certd.monitor.checkStatus"),
title: t("monitor.checkStatus"),
search: {
show: false,
},
@@ -490,7 +490,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certEffectiveTime: {
title: t("certd.monitor.certEffectiveTime"),
title: t("monitor.certEffectiveTime"),
search: {
show: false,
},
@@ -505,7 +505,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certExpiresTime: {
title: t("certd.monitor.certExpiresTime"),
title: t("monitor.certExpiresTime"),
search: {
show: false,
},
@@ -519,7 +519,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
remainingValidity: {
title: t("certd.monitor.remainingValidity"),
title: t("monitor.remainingValidity"),
search: {
show: false,
},
@@ -552,7 +552,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const color = leftDays < certValidDays ? "red" : "#389e0d";
const percent = (leftDays / effectiveDays) * 100;
// console.log('cellRender', 'effectiveDays', effectiveDays, 'expiresTime', expiresTime, 'applyTime', applyTime, 'percent', percent, row)
return <a-progress title={expireDate + t("certd.monitor.expired")} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}${t("certd.monitor.days")}`} />;
return <a-progress title={expireDate + t("monitor.expired")} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}${t("monitor.days")}`} />;
},
},
},
@@ -597,7 +597,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
remark: {
title: t("certd.monitor.remark"),
title: t("monitor.remark"),
search: {
show: false,
},
@@ -612,7 +612,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
lastCheckTime: {
title: t("certd.monitor.lastCheckTime"),
title: t("monitor.lastCheckTime"),
search: {
show: false,
},
@@ -626,7 +626,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
disabled: {
title: t("certd.monitor.disabled"),
title: t("monitor.disabled"),
search: {
show: false,
},
@@ -675,7 +675,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
// }
// },
ipCheck: {
title: t("certd.monitor.ipCheck"),
title: t("monitor.ipCheck"),
type: "dict-switch",
dict: dict({
data: [
@@ -684,9 +684,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
],
}),
form: {
helper: t("certd.monitor.ipCheckHelper"),
helper: t("monitor.ipCheckHelper"),
value: false,
rules: [{ required: true, message: t("certd.monitor.selectRequired") }],
rules: [{ required: true, message: t("monitor.selectRequired") }],
},
column: {
align: "center",
@@ -699,7 +699,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
change({ row, $event }) {
Modal.confirm({
title: t("common.confirm"),
content: t("certd.monitor.ipCheckConfirm", { status: $event ? t("common.enabled") : t("common.disabled") }),
content: t("monitor.ipCheckConfirm", { status: $event ? t("common.enabled") : t("common.disabled") }),
onOk: async () => {
await api.IpCheckChange(row.id, $event);
await crudExpose.doRefresh();
@@ -717,7 +717,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
} as ColumnCompositionProps,
ipSyncAuto: {
title: t("certd.monitor.ipSyncAuto"),
title: t("monitor.ipSyncAuto"),
type: "dict-switch",
dict: dict({
data: [
@@ -738,13 +738,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
ipSyncMode: {
title: t("certd.monitor.ipSyncMode"),
title: t("monitor.ipSyncMode"),
type: "dict-select",
dict: dict({
data: [
{ label: t("certd.monitor.ipSyncModeAll"), value: "all" },
{ label: t("certd.monitor.ipSyncModeIPV4Only"), value: "ipv4" },
{ label: t("certd.monitor.ipSyncModeIPV6Only"), value: "ipv6" },
{ label: t("monitor.ipSyncModeAll"), value: "all" },
{ label: t("monitor.ipSyncModeIPV4Only"), value: "ipv4" },
{ label: t("monitor.ipSyncModeIPV6Only"), value: "ipv6" },
],
}),
form: {
@@ -752,7 +752,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: compute(({ form }) => {
return form.ipSyncAuto;
}),
helper: t("certd.monitor.ipSyncModeHelper"),
helper: t("monitor.ipSyncModeHelper"),
},
column: {
width: 100,
@@ -761,7 +761,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
ipIgnoreCoherence: {
title: t("certd.monitor.ipIgnoreCoherence"),
title: t("monitor.ipIgnoreCoherence"),
type: "dict-switch",
dict: dict({
data: [
@@ -774,7 +774,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: compute(({ form }) => {
return form.ipCheck;
}),
helper: t("certd.monitor.ipIgnoreCoherenceHelper"),
helper: t("monitor.ipIgnoreCoherenceHelper"),
},
column: {
width: 100,
@@ -783,7 +783,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
pipelineId: {
title: t("certd.monitor.pipelineId"),
title: t("monitor.pipelineId"),
search: {
show: false,
},
@@ -796,7 +796,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certInfoId: {
title: t("certd.monitor.certInfoId"),
title: t("monitor.certInfoId"),
search: {
show: false,
},
@@ -809,7 +809,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
error: {
title: t("certd.monitor.error"),
title: t("monitor.error"),
search: {
show: false,
},
@@ -2,14 +2,14 @@
<fs-page>
<template #header>
<div class="title flex items-center">
{{ t("certd.monitor.title") }}
{{ t("monitor.title") }}
<div class="sub flex-1">
<div>
{{ t("certd.monitor.description") }}
<router-link to="/certd/monitor/setting">{{ t("certd.monitor.settingLink") }}</router-link>
{{ t("monitor.description") }}
<router-link to="/certd/monitor/setting">{{ t("monitor.settingLink") }}</router-link>
</div>
<div class="flex items-center">
{{ t("certd.monitor.limitInfo") }}
{{ t("monitor.limitInfo") }}
<vip-button class="ml-5" mode="nav"></vip-button>
</div>
</div>
@@ -1,40 +1,40 @@
<template>
<fs-page class="page-user-settings page-site-monitor-setting">
<template #header>
<div class="title">{{ t("certd.monitor.setting.siteMonitorSettings") }}</div>
<div class="title">{{ t("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.monitor.setting.notificationChannel')" :name="['notificationId']">
<a-form-item :label="t('monitor.setting.notificationChannel')" :name="['notificationId']">
<div class="flex">
<NotificationSelector v-model="formState.notificationId" />
</div>
<div class="helper">{{ t("certd.monitor.setting.setNotificationChannel") }}</div>
<div class="helper">{{ t("monitor.setting.setNotificationChannel") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.retryTimes')" :name="['retryTimes']">
<a-form-item :label="t('monitor.setting.retryTimes')" :name="['retryTimes']">
<div class="flex">
<a-input-number v-model:value="formState.retryTimes" />
</div>
<div class="helper">{{ t("certd.monitor.setting.monitorRetryTimes") }}</div>
<div class="helper">{{ t("monitor.setting.monitorRetryTimes") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.certValidDays')" :name="['certValidDays']">
<a-form-item :label="t('monitor.setting.certValidDays')" :name="['certValidDays']">
<div class="flex">
<a-input-number v-model:value="formState.certValidDays" />
</div>
<div class="helper">{{ t("certd.monitor.setting.certValidDaysHelper") }}</div>
<div class="helper">{{ t("monitor.setting.certValidDaysHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.dnsServer')" :name="['dnsServer']">
<a-form-item :label="t('monitor.setting.dnsServer')" :name="['dnsServer']">
<div class="flex">
<a-select v-model:value="formState.dnsServer" :token-separators="[' ', ',', '', '', '|']" mode="tags" :open="false" />
</div>
<div class="helper">{{ t("certd.monitor.setting.dnsServerHelper") }}</div>
<div class="helper">{{ t("monitor.setting.dnsServerHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.monitor.setting.monitorCronSetting')" :name="['cron']">
<a-form-item :label="t('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.monitor.setting.cronTrigger") }}</div>
<div class="helper">{{ t("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>
@@ -19,6 +19,7 @@
<a-form-item :label="t('certd.smtpPort')" name="port" :rules="[{ required: true, message: t('certd.pleaseEnterSmtpPort') }]">
<a-input v-model:value="formState.port" />
<div class="helper">{{ t("certd.pleaseEnterSmtpPort") }}</div>
</a-form-item>
<a-form-item :label="t('certd.username')" :name="['auth', 'user']" :rules="[{ required: true, message: t('certd.pleaseEnterUsername') }]">
@@ -128,9 +129,9 @@ import * as api from "../api";
import * as emailApi from "./api.email";
import { notification } from "ant-design-vue";
import { useSettingStore } from "/src/store/settings";
import * as _ from "lodash-es";
import { useI18n } from "/src/locales";
import AddonSelector from "../../../certd/addon/addon-selector/index.vue";
import { merge } from "lodash-es";
const { t } = useI18n();
defineOptions({
name: "EmailSetting",
@@ -189,7 +190,7 @@ function fillEmailTemplates(form: any) {
async function load() {
const data: any = await api.EmailSettingsGet();
_.merge(formState, data);
merge(formState, data);
}
onMounted(async () => {