mirror of
https://github.com/certd/certd.git
synced 2026-04-26 05:37:25 +08:00
支持开启流水线有效期设置
This commit is contained in:
@@ -37,6 +37,15 @@ export class SysPublicSettings extends BaseSettings {
|
|||||||
//验证码类型
|
//验证码类型
|
||||||
captchaType?: string;
|
captchaType?: string;
|
||||||
captchaAddonId?:number;
|
captchaAddonId?:number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//流水线是否启用有效期
|
||||||
|
pipelineValidTimeEnabled?: boolean = false;
|
||||||
|
|
||||||
|
//证书域名添加到监控
|
||||||
|
certDomainAddToMonitorEnabled?: boolean = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SysPrivateSettings extends BaseSettings {
|
export class SysPrivateSettings extends BaseSettings {
|
||||||
@@ -51,6 +60,8 @@ export class SysPrivateSettings extends BaseSettings {
|
|||||||
dnsResultOrder? = '';
|
dnsResultOrder? = '';
|
||||||
commonCnameEnabled?: boolean = true;
|
commonCnameEnabled?: boolean = true;
|
||||||
|
|
||||||
|
httpRequestTimeout?: number = 30;
|
||||||
|
|
||||||
sms?: {
|
sms?: {
|
||||||
type?: string;
|
type?: string;
|
||||||
config?: any;
|
config?: any;
|
||||||
@@ -214,3 +225,4 @@ export class SysSafeSetting extends BaseSettings {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ export default {
|
|||||||
triggerType: "Trigger Type",
|
triggerType: "Trigger Type",
|
||||||
pipelineId: "Pipeline Id",
|
pipelineId: "Pipeline Id",
|
||||||
},
|
},
|
||||||
|
|
||||||
pi: {
|
pi: {
|
||||||
validTime: "Piepline Valid Time",
|
validTime: "Piepline Valid Time",
|
||||||
validTimeHelper: "Not filled in means permanent validity",
|
validTimeHelper: "Not filled in means permanent validity",
|
||||||
@@ -728,6 +729,13 @@ export default {
|
|||||||
addonTypeSelect: "Select type",
|
addonTypeSelect: "Select type",
|
||||||
sys: {
|
sys: {
|
||||||
setting: {
|
setting: {
|
||||||
|
baseSetting: "Base Settings",
|
||||||
|
registerSetting: "Register Settings",
|
||||||
|
safeSetting: "Safe Settings",
|
||||||
|
paymentSetting: "Payment Settings",
|
||||||
|
captchaSetting: "Captcha Setting",
|
||||||
|
certSetting: "Certificate Settings",
|
||||||
|
|
||||||
showRunStrategy: "Show RunStrategy",
|
showRunStrategy: "Show RunStrategy",
|
||||||
showRunStrategyHelper: "Allow modify the run strategy of the task",
|
showRunStrategyHelper: "Allow modify the run strategy of the task",
|
||||||
|
|
||||||
@@ -737,11 +745,11 @@ export default {
|
|||||||
captchaTest: "Captcha Test",
|
captchaTest: "Captcha Test",
|
||||||
// 保存后再点击测试,请务必测试通过了,再开启登录验证码
|
// 保存后再点击测试,请务必测试通过了,再开启登录验证码
|
||||||
captchaTestHelper: "Save and click test, please make sure the test is passed before enabling login captcha",
|
captchaTestHelper: "Save and click test, please make sure the test is passed before enabling login captcha",
|
||||||
baseSetting: "Base Settings",
|
|
||||||
registerSetting: "Register Settings",
|
pipelineValidTimeEnabled: "Enable Pipeline Valid Time",
|
||||||
safeSetting: "Safe Settings",
|
pipelineValidTimeEnabledHelper: "Whether to enable the valid time of the pipeline",
|
||||||
paymentSetting: "Payment Settings",
|
certDomainAddToMonitorEnabled: "Add Domain to Certificate Monitor",
|
||||||
captchaSetting: "Captcha Setting",
|
certDomainAddToMonitorEnabledHelper: "Whether to add the domain to the certificate monitor",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modal: {
|
modal: {
|
||||||
|
|||||||
@@ -730,6 +730,13 @@ export default {
|
|||||||
},
|
},
|
||||||
sys: {
|
sys: {
|
||||||
setting: {
|
setting: {
|
||||||
|
baseSetting: "基本设置",
|
||||||
|
registerSetting: "注册设置",
|
||||||
|
safeSetting: "安全设置",
|
||||||
|
paymentSetting: "支付设置",
|
||||||
|
captchaSetting: "验证码设置",
|
||||||
|
certSetting: "证书设置",
|
||||||
|
|
||||||
showRunStrategy: "显示运行策略选择",
|
showRunStrategy: "显示运行策略选择",
|
||||||
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
|
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
|
||||||
|
|
||||||
@@ -738,11 +745,11 @@ export default {
|
|||||||
captchaType: "验证码配置",
|
captchaType: "验证码配置",
|
||||||
captchaTest: "测试验证码",
|
captchaTest: "测试验证码",
|
||||||
captchaTestHelper: "保存后再点击测试,请务必测试通过了,再开启登录验证码",
|
captchaTestHelper: "保存后再点击测试,请务必测试通过了,再开启登录验证码",
|
||||||
baseSetting: "基本设置",
|
|
||||||
registerSetting: "注册设置",
|
pipelineValidTimeEnabled: "流水线有效期",
|
||||||
safeSetting: "安全设置",
|
pipelineValidTimeEnabledHelper: "是否启用流水线有效期",
|
||||||
paymentSetting: "支付设置",
|
certDomainAddToMonitorEnabled: "证书域名添加到证书监控",
|
||||||
captchaSetting: "验证码设置",
|
certDomainAddToMonitorEnabledHelper: "创建证书流水线时是否可以选择将域名添加到证书监控",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modal: {
|
modal: {
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ export type SysPublicSetting = {
|
|||||||
captchaEnabled?: boolean;
|
captchaEnabled?: boolean;
|
||||||
captchaType?: number;
|
captchaType?: number;
|
||||||
captchaAddonId?: number;
|
captchaAddonId?: number;
|
||||||
|
|
||||||
|
//流水线是否启用有效期
|
||||||
|
pipelineValidTimeEnabled?: boolean;
|
||||||
|
|
||||||
|
//证书域名添加到监控
|
||||||
|
certDomainAddToMonitorEnabled?: boolean;
|
||||||
};
|
};
|
||||||
export type SuiteSetting = {
|
export type SuiteSetting = {
|
||||||
enabled?: boolean;
|
enabled?: boolean;
|
||||||
@@ -63,6 +69,9 @@ export type SysPrivateSetting = {
|
|||||||
type?: string;
|
type?: string;
|
||||||
config?: any;
|
config?: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//http请求超时时间
|
||||||
|
httpRequestTimeout?: number;
|
||||||
};
|
};
|
||||||
export type SysInstallInfo = {
|
export type SysInstallInfo = {
|
||||||
siteId: string;
|
siteId: string;
|
||||||
|
|||||||
@@ -559,7 +559,9 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
|||||||
title: t("certd.pi.validTime"),
|
title: t("certd.pi.validTime"),
|
||||||
type: "date",
|
type: "date",
|
||||||
form: {
|
form: {
|
||||||
show: true,
|
show: computed(() => {
|
||||||
|
return settingStore.isPlus && settingStore.sysPublic.pipelineValidTimeEnabled;
|
||||||
|
}),
|
||||||
helper: t("certd.pi.validTimeHelper"),
|
helper: t("certd.pi.validTimeHelper"),
|
||||||
valueResolve({ form, key, value }) {
|
valueResolve({ form, key, value }) {
|
||||||
if (value) {
|
if (value) {
|
||||||
@@ -573,6 +575,9 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
|
show: computed(() => {
|
||||||
|
return settingStore.isPlus && settingStore.sysPublic.pipelineValidTimeEnabled;
|
||||||
|
}),
|
||||||
sorter: true,
|
sorter: true,
|
||||||
width: 155,
|
width: 155,
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|||||||
@@ -20,6 +20,9 @@
|
|||||||
<a-tab-pane key="captcha" :tab="t('certd.sys.setting.captchaSetting')">
|
<a-tab-pane key="captcha" :tab="t('certd.sys.setting.captchaSetting')">
|
||||||
<SettingCaptcha v-if="activeKey === 'captcha'" />
|
<SettingCaptcha v-if="activeKey === 'captcha'" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
|
<a-tab-pane key="cert" :tab="t('certd.sys.setting.certSetting')">
|
||||||
|
<SettingCert v-if="activeKey === 'cert'" />
|
||||||
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</div>
|
</div>
|
||||||
</fs-page>
|
</fs-page>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="sys-settings-form sys-settings-base">
|
<div class="sys-settings-form sys-settings-base">
|
||||||
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish" @finish-failed="onFinishFailed">
|
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
|
||||||
<a-form-item :label="t('certd.icpRegistrationNumber')" :name="['public', 'icpNo']">
|
<a-form-item :label="t('certd.icpRegistrationNumber')" :name="['public', 'icpNo']">
|
||||||
<a-input v-model:value="formState.public.icpNo" :placeholder="t('certd.icpPlaceholder')" />
|
<a-input v-model:value="formState.public.icpNo" :placeholder="t('certd.icpPlaceholder')" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<template>
|
||||||
|
<div class="sys-settings-form sys-settings-cert">
|
||||||
|
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
|
||||||
|
<a-form-item :label="t('certd.sys.setting.pipelineValidTimeEnabled')" :name="['public', 'pipelineValidTimeEnabled']">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<a-switch v-model:checked="formState.public.pipelineValidTimeEnabled" :disabled="!settingsStore.isPlus" />
|
||||||
|
<vip-button class="ml-5" mode="button"></vip-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="helper">{{ t("certd.pipelineValidTimeEnabledHelper") }}</div>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item :label="t('certd.sys.setting.certDomainAddToMonitorEnabled')" :name="['public', 'certDomainAddToMonitorEnabled']">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<a-switch v-model:checked="formState.public.certDomainAddToMonitorEnabled" :disabled="!settingsStore.isPlus" />
|
||||||
|
<vip-button class="ml-5" mode="button"></vip-button>
|
||||||
|
</div>
|
||||||
|
<div class="helper">{{ t("certd.sys.setting.certDomainAddToMonitorEnabledHelper") }}</div>
|
||||||
|
</a-form-item>
|
||||||
|
|
||||||
|
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
|
||||||
|
<a-button :loading="saveLoading" type="primary" html-type="submit">{{ t("certd.saveButton") }}</a-button>
|
||||||
|
</a-form-item>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="tsx">
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { SysSettings } from "/@/views/sys/settings/api";
|
||||||
|
import * as api from "/@/views/sys/settings/api";
|
||||||
|
import { merge } from "lodash-es";
|
||||||
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
import { notification } from "ant-design-vue";
|
||||||
|
import { useI18n } from "/src/locales";
|
||||||
|
const { t } = useI18n();
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: "SettingCert",
|
||||||
|
});
|
||||||
|
|
||||||
|
const formState = reactive<Partial<SysSettings>>({
|
||||||
|
public: {},
|
||||||
|
private: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function loadSysSettings() {
|
||||||
|
const data: any = await api.SysSettingsGet();
|
||||||
|
merge(formState, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
const saveLoading = ref(false);
|
||||||
|
loadSysSettings();
|
||||||
|
const settingsStore = useSettingStore();
|
||||||
|
const onFinish = async (form: any) => {
|
||||||
|
try {
|
||||||
|
saveLoading.value = true;
|
||||||
|
|
||||||
|
await api.SysSettingsSave(form);
|
||||||
|
await settingsStore.loadSysSettings();
|
||||||
|
notification.success({
|
||||||
|
message: t("certd.saveSuccess"),
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
saveLoading.value = false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="less">
|
||||||
|
.sys-settings-cert {
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user