支持开启流水线有效期设置

This commit is contained in:
xiaojunnuo
2025-10-23 00:05:36 +08:00
parent b3814920bd
commit 3b690cc31f
8 changed files with 127 additions and 12 deletions

View File

@@ -37,6 +37,15 @@ export class SysPublicSettings extends BaseSettings {
//验证码类型
captchaType?: string;
captchaAddonId?:number;
//流水线是否启用有效期
pipelineValidTimeEnabled?: boolean = false;
//证书域名添加到监控
certDomainAddToMonitorEnabled?: boolean = false;
}
export class SysPrivateSettings extends BaseSettings {
@@ -51,6 +60,8 @@ export class SysPrivateSettings extends BaseSettings {
dnsResultOrder? = '';
commonCnameEnabled?: boolean = true;
httpRequestTimeout?: number = 30;
sms?: {
type?: string;
config?: any;
@@ -214,3 +225,4 @@ export class SysSafeSetting extends BaseSettings {
};
}

View File

@@ -137,6 +137,7 @@ export default {
triggerType: "Trigger Type",
pipelineId: "Pipeline Id",
},
pi: {
validTime: "Piepline Valid Time",
validTimeHelper: "Not filled in means permanent validity",
@@ -728,6 +729,13 @@ export default {
addonTypeSelect: "Select type",
sys: {
setting: {
baseSetting: "Base Settings",
registerSetting: "Register Settings",
safeSetting: "Safe Settings",
paymentSetting: "Payment Settings",
captchaSetting: "Captcha Setting",
certSetting: "Certificate Settings",
showRunStrategy: "Show RunStrategy",
showRunStrategyHelper: "Allow modify the run strategy of the task",
@@ -737,11 +745,11 @@ export default {
captchaTest: "Captcha Test",
// 保存后再点击测试,请务必测试通过了,再开启登录验证码
captchaTestHelper: "Save and click test, please make sure the test is passed before enabling login captcha",
baseSetting: "Base Settings",
registerSetting: "Register Settings",
safeSetting: "Safe Settings",
paymentSetting: "Payment Settings",
captchaSetting: "Captcha Setting",
pipelineValidTimeEnabled: "Enable Pipeline Valid Time",
pipelineValidTimeEnabledHelper: "Whether to enable the valid time of the pipeline",
certDomainAddToMonitorEnabled: "Add Domain to Certificate Monitor",
certDomainAddToMonitorEnabledHelper: "Whether to add the domain to the certificate monitor",
},
},
modal: {

View File

@@ -730,6 +730,13 @@ export default {
},
sys: {
setting: {
baseSetting: "基本设置",
registerSetting: "注册设置",
safeSetting: "安全设置",
paymentSetting: "支付设置",
captchaSetting: "验证码设置",
certSetting: "证书设置",
showRunStrategy: "显示运行策略选择",
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
@@ -738,11 +745,11 @@ export default {
captchaType: "验证码配置",
captchaTest: "测试验证码",
captchaTestHelper: "保存后再点击测试,请务必测试通过了,再开启登录验证码",
baseSetting: "基本设置",
registerSetting: "注册设置",
safeSetting: "安全设置",
paymentSetting: "支付设置",
captchaSetting: "验证码设置",
pipelineValidTimeEnabled: "流水线有效期",
pipelineValidTimeEnabledHelper: "是否启用流水线有效期",
certDomainAddToMonitorEnabled: "证书域名添加到证书监控",
certDomainAddToMonitorEnabledHelper: "创建证书流水线时是否可以选择将域名添加到证书监控",
},
},
modal: {

View File

@@ -50,6 +50,12 @@ export type SysPublicSetting = {
captchaEnabled?: boolean;
captchaType?: number;
captchaAddonId?: number;
//流水线是否启用有效期
pipelineValidTimeEnabled?: boolean;
//证书域名添加到监控
certDomainAddToMonitorEnabled?: boolean;
};
export type SuiteSetting = {
enabled?: boolean;
@@ -63,6 +69,9 @@ export type SysPrivateSetting = {
type?: string;
config?: any;
};
//http请求超时时间
httpRequestTimeout?: number;
};
export type SysInstallInfo = {
siteId: string;

View File

@@ -559,7 +559,9 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
title: t("certd.pi.validTime"),
type: "date",
form: {
show: true,
show: computed(() => {
return settingStore.isPlus && settingStore.sysPublic.pipelineValidTimeEnabled;
}),
helper: t("certd.pi.validTimeHelper"),
valueResolve({ form, key, value }) {
if (value) {
@@ -573,6 +575,9 @@ export default function ({ crudExpose, context: { groupDictRef, selectedRowKeys
},
},
column: {
show: computed(() => {
return settingStore.isPlus && settingStore.sysPublic.pipelineValidTimeEnabled;
}),
sorter: true,
width: 155,
align: "center",

View File

@@ -20,6 +20,9 @@
<a-tab-pane key="captcha" :tab="t('certd.sys.setting.captchaSetting')">
<SettingCaptcha v-if="activeKey === 'captcha'" />
</a-tab-pane>
<a-tab-pane key="cert" :tab="t('certd.sys.setting.certSetting')">
<SettingCert v-if="activeKey === 'cert'" />
</a-tab-pane>
</a-tabs>
</div>
</fs-page>

View File

@@ -1,6 +1,6 @@
<template>
<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-input v-model:value="formState.public.icpNo" :placeholder="t('certd.icpPlaceholder')" />
</a-form-item>

View File

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