Merge branch 'v2-dev' into v2_admin_mode

This commit is contained in:
xiaojunnuo
2026-02-09 18:21:01 +08:00
83 changed files with 776 additions and 398 deletions
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.38.8](https://github.com/certd/certd/compare/v1.38.7...v1.38.8) (2026-02-06)
### Performance Improvements
* 双重验证显示secret ([febd6d3](https://github.com/certd/certd/commit/febd6d32cfe6d89ccecf26bf15141df7c456e5c6))
* 支持设置默认的证书申请地址的反向代理 ([0cfb94b](https://github.com/certd/certd/commit/0cfb94b0ba6a6dc3bb0d0a81a1912068a4e6b6b6))
* 子域名托管域名支持配置通配符 ([3f7ac93](https://github.com/certd/certd/commit/3f7ac939326b0c7ec013a7534b6c0e58fb3e8cb4))
## [1.38.7](https://github.com/certd/certd/compare/v1.38.6...v1.38.7) (2026-02-05)
### Bug Fixes
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@certd/ui-client",
"version": "1.38.7",
"version": "1.38.8",
"private": true,
"scripts": {
"dev": "vite --open",
@@ -106,8 +106,8 @@
"zod-defaults": "^0.1.3"
},
"devDependencies": {
"@certd/lib-iframe": "^1.38.7",
"@certd/pipeline": "^1.38.7",
"@certd/lib-iframe": "^1.38.8",
"@certd/pipeline": "^1.38.8",
"@rollup/plugin-commonjs": "^25.0.7",
"@rollup/plugin-node-resolve": "^15.2.3",
"@types/chai": "^4.3.12",
@@ -161,27 +161,30 @@ function openStarModal(vipType: string) {
return;
}
Modal.destroyAll();
const goGithub = () => {
window.open("https://github.com/certd/certd/");
};
modal.confirm({
title: t("vip.get_7_day_pro_trial"),
okText: t("vip.star_now"),
onOk() {
goGithub();
openTrialModal(vipType);
},
width: 600,
content: () => {
return (
<div class="flex mt-10 mb-10">
<div>{t("vip.please_help_star")}</div>
<img class="ml-5" src="https://img.shields.io/github/stars/certd/certd?logo=github" />
</div>
);
},
});
openTrialModal(vipType);
// const goGithub = () => {
// window.open("https://github.com/certd/certd/");
// };
// modal.confirm({
// title: t("vip.get_7_day_pro_trial"),
// okText: t("vip.star_now"),
// onOk() {
// goGithub();
// openTrialModal(vipType);
// },
// width: 600,
// content: () => {
// return (
// <div class="flex mt-10 mb-10">
// <div>{t("vip.please_help_star")}</div>
// <img class="ml-5" src="https://img.shields.io/github/stars/certd/certd?logo=github" />
// </div>
// );
// },
// });
}
function openUpgrade() {
@@ -515,6 +515,7 @@ export default {
selectRecordFirst: "Please select records first",
subdomainHosted: "Hosted Subdomain",
subdomainHelpText: "If you don't understand what subdomain hosting is,Do not set it randomly, as it may result in the inability to apply for the certificate. please refer to the documentation ",
subdomainHelpSupportStart: "Supports * wildcard, indicating that all subdomains of the domain are hosted (free subdomains)",
subdomainManagement: "Subdomain Management",
isDisabled: "Is Disabled",
enabled: "Enabled",
@@ -788,6 +789,7 @@ export default {
captchaSetting: "Captcha Setting",
pipelineSetting: "Pipeline Settings",
oauthSetting: "OAuth2 Settings",
networkSetting: "Network Settings",
showRunStrategy: "Show RunStrategy",
showRunStrategyHelper: "Allow modify the run strategy of the task",
@@ -839,6 +841,11 @@ export default {
notice: "System Notice",
noticeHelper: "System notice, will be displayed on the login page",
noticePlaceholder: "System notice",
reverseProxy: "Reverse Proxy List",
reverseProxyHelper: "Reverse proxy for ACME address, used when applying for certificate",
reverseProxyPlaceholder: "http://le.px.handfree.work",
reverseProxyEmpty: "No reverse proxy list configured",
},
},
modal: {
@@ -524,6 +524,7 @@ export default {
selectRecordFirst: "请先勾选记录",
subdomainHosted: "托管的子域名",
subdomainHelpText: "如果您不理解什么是子域托管,请不要随意设置(可能导致证书无法申请,以前设置过的cname记录也需要重新配置),可以参考文档",
subdomainHelpSupportStart: "支持*号通配符,表示该域名下的子域名都是托管的(免费子域名)",
subdomainManagement: "子域管理",
isDisabled: "是否禁用",
enabled: "启用",
@@ -794,6 +795,7 @@ export default {
captchaSetting: "验证码设置",
pipelineSetting: "流水线设置",
oauthSetting: "第三方登录",
networkSetting: "网络设置",
showRunStrategy: "显示运行策略选择",
showRunStrategyHelper: "任务设置中是否允许选择运行策略",
@@ -853,6 +855,11 @@ export default {
notice: "系统公告",
noticeHelper: "系统公告,将在首页显示",
noticePlaceholder: "系统公告",
reverseProxy: "反向代理列表",
reverseProxyHelper: "证书颁发机构ACME地址的反向代理,在申请证书时自动使用",
reverseProxyPlaceholder: "http://le.px.handfree.work",
reverseProxyEmpty: "未配置反向代理",
},
},
modal: {
@@ -96,6 +96,7 @@ export type SuiteSetting = {
export type SysPrivateSetting = {
httpProxy?: string;
httpsProxy?: string;
reverseProxies?: any;
dnsResultOrder?: string;
commonCnameEnabled?: boolean;
// 同一个用户同时最大运行流水线数量
@@ -372,6 +372,13 @@ h6 {
border-spacing: 0;
overflow: auto;
&.cd-table-none-border {
border: 0 !important;
td, th {
border: 0 !important;
}
}
.fs-loading {
position: absolute;
left: 0;
@@ -10,6 +10,9 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
provide("get:plugin:type", () => {
return "access";
});
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
const AccessTypeDictRef = dict({
url: "/pi/access/accessTypeDict",
});
@@ -1,12 +1,11 @@
import { ColumnCompositionProps, compute, dict } from "@fast-crud/fast-crud";
import { Modal } from "ant-design-vue";
import { forEach, get, merge, set } from "lodash-es";
import { computed, provide, ref, toRef } from "vue";
import { useReference } from "/@/use/use-refrence";
import { forEach, get, merge, set } from "lodash-es";
import { Modal } from "ant-design-vue";
import { mitter } from "/@/utils/util.mitt";
import { useI18n } from "/src/locales";
import * as pipelineApi from "/@/views/certd/pipeline/api";
import { getAddonTypeDefine } from "/@/views/certd/addon/api";
import { useI18n } from "/src/locales";
export function addonProvide(api: any) {
provide("addonApi", api);
@@ -30,6 +29,10 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
},
};
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
function buildDefineFields(define: any, form: any, mode: string) {
const formWrapperRef = crudExpose.getFormWrapperRef();
const columnsRef = toRef(formWrapperRef.formOptions, "columns");
@@ -28,7 +28,7 @@ export async function TwoFactorAuthenticatorGet() {
url: apiPrefix + "/twoFactor/authenticator/qrcode",
method: "post",
});
return res as string; //base64
return res as { qrcode: string; link: string; secret: string }; //base64
}
export async function TwoFactorAuthenticatorSave(req: AuthenticatorSaveReq) {
@@ -57,6 +57,17 @@
<div class="ml-20">
<img class="full-w" :src="authenticatorForm.qrcodeSrc" />
</div>
<div class="ml-20 mt-5">
<div>您也可以手动添加</div>
<div class="flex mt-5">
<a-tag type="primary" color="green" class="mr-2">Secret</a-tag>
<fs-copyable :model-value="authenticatorForm.secret" />
</div>
<div class="flex mt-5">
<a-tag type="primary" color="green" class="mr-2">Link</a-tag>
<fs-copyable :model-value="authenticatorForm.link" />
</div>
</div>
</div>
<h3 class="font-bold m-10">{{ t("certd.step3") }}</h3>
<div class="ml-20">
@@ -97,6 +108,8 @@ const formState = reactive<Partial<UserTwoFactorSetting>>({
const authenticatorForm = reactive({
qrcodeSrc: "",
verifyCode: "",
link: "",
secret: "",
open: false,
});
@@ -110,9 +123,14 @@ watch(
async open => {
if (open) {
//base64 转图片
authenticatorForm.qrcodeSrc = await api.TwoFactorAuthenticatorGet();
const { qrcode, link, secret } = await api.TwoFactorAuthenticatorGet();
authenticatorForm.qrcodeSrc = qrcode;
authenticatorForm.link = link;
authenticatorForm.secret = secret;
} else {
authenticatorForm.qrcodeSrc = "";
authenticatorForm.link = "";
authenticatorForm.secret = "";
authenticatorForm.verifyCode = "";
}
}
@@ -26,6 +26,10 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any) {
},
};
provide("getCurrentPluginDefine", () => {
return currentDefine;
});
function buildDefineFields(define: any, form: any, mode: string) {
const formWrapperRef = crudExpose.getFormWrapperRef();
const columnsRef = toRef(formWrapperRef.formOptions, "columns");
@@ -1065,7 +1065,7 @@ export default defineComponent({
}
.layout-right {
width: 364px;
width: 368px;
height: 100%;
max-width: 90vw;
}
@@ -1292,7 +1292,7 @@ export default defineComponent({
.layout-right {
position: relative;
&.collapsed {
margin-right: max(-364px, -90vw);
margin-right: max(-368px, -90vw);
}
.collapse-toggle {
@@ -80,10 +80,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
render() {
return (
<div>
{t("certd.subdomainHelpText")}
<a href={"https://help.aliyun.com/zh/dns/subdomain-management"} target={"_blank"}>
{t("certd.subdomainManagement")}
</a>
<div>
1. {t("certd.subdomainHelpText")}
<a href={"https://help.aliyun.com/zh/dns/subdomain-management"} target={"_blank"}>
{t("certd.subdomainManagement")}
</a>
</div>
<div>2. {t("certd.subdomainHelpSupportStart")}</div>
</div>
);
},
@@ -26,6 +26,9 @@
<a-tab-pane key="pipeline" :tab="t('certd.sys.setting.pipelineSetting')">
<SettingPipeline v-if="activeKey === 'pipeline'" />
</a-tab-pane>
<a-tab-pane key="network" :tab="t('certd.sys.setting.networkSetting')">
<SettingNetwork v-if="activeKey === 'network'" />
</a-tab-pane>
<a-tab-pane key="mode" :tab="t('certd.adminMode')">
<SettingMode v-if="activeKey === 'mode'" />
</a-tab-pane>
@@ -43,7 +46,7 @@ import SettingCaptcha from "/@/views/sys/settings/tabs/captcha.vue";
import SettingPipeline from "/@/views/sys/settings/tabs/pipeline.vue";
import SettingOauth from "/@/views/sys/settings/tabs/oauth.vue";
import SettingMode from "/@/views/sys/settings/tabs/mode.vue";
import SettingNetwork from "/@/views/sys/settings/tabs/network.vue";
import { useRoute, useRouter } from "vue-router";
import { ref } from "vue";
import { useSettingStore } from "/@/store/settings";
@@ -15,35 +15,6 @@
<a-switch v-model:checked="formState.public.robots" />
</a-form-item>
<a-form-item :label="t('certd.httpProxy')" :name="['private', 'httpProxy']" :rules="urlRules">
<a-input v-model:value="formState.private.httpProxy" :placeholder="t('certd.httpProxyPlaceholder')" />
<div class="helper">{{ t("certd.httpProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.httpsProxy')" :name="['private', 'httpsProxy']" :rules="urlRules">
<div class="flex">
<a-input v-model:value="formState.private.httpsProxy" :placeholder="t('certd.httpsProxyPlaceholder')" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading" :title="t('certd.saveThenTestTitle')" @click="testProxy">{{ t("certd.testButton") }}</a-button>
</div>
<div class="helper">{{ t("certd.httpsProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.dualStackNetwork')" :name="['private', 'dnsResultOrder']">
<a-select v-model:value="formState.private.dnsResultOrder">
<a-select-option value="verbatim">{{ t("certd.default") }}</a-select-option>
<a-select-option value="ipv4first">{{ t("certd.ipv4Priority") }}</a-select-option>
<a-select-option value="ipv6first">{{ t("certd.ipv6Priority") }}</a-select-option>
</a-select>
<div class="helper">
{{ t("certd.dualStackNetworkHelper") }}, <a href="https://certd.docmirror.cn/guide/use/setting/ipv6.html" target="_blank">{{ t("certd.helpDocLink") }}</a>
</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>
@@ -62,13 +33,13 @@
</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 { util } from "/@/utils";
import { merge } from "lodash-es";
import { reactive, ref } from "vue";
import { useSettingStore } from "/@/store/settings";
import * as api from "/@/views/sys/settings/api";
import { SysSettings } from "/@/views/sys/settings/api";
import { useI18n } from "/src/locales";
const { t } = useI18n();
@@ -84,11 +55,6 @@ const formState = reactive<Partial<SysSettings>>({
private: {},
});
const urlRules = ref({
type: "url",
message: "请输入正确的URL",
});
async function loadSysSettings() {
const data: any = await api.SysSettingsGet();
merge(formState, data);
@@ -110,43 +76,6 @@ const onFinish = async (form: any) => {
saveLoading.value = false;
}
};
const testProxyLoading = ref(false);
async function testProxy() {
testProxyLoading.value = true;
try {
const res = await api.TestProxy();
let success = true;
if (res.google !== true || res.baidu !== true) {
success = false;
}
const content = () => {
return (
<div>
<div>
{t("certd.google")}: {res.google === true ? t("certd.success") : util.maxLength(res.google)}
</div>
<div>
{t("certd.baidu")}: {res.baidu === true ? t("certd.success") : util.maxLength(res.baidu)}
</div>
</div>
);
};
if (!success) {
notification.error({
message: t("certd.testFailed"),
description: content,
});
return;
}
notification.success({
message: t("certd.testCompleted"),
description: content,
});
} finally {
testProxyLoading.value = false;
}
}
</script>
<style lang="less">
.sys-settings-base {
@@ -0,0 +1,127 @@
<template>
<div class="sys-settings-form sys-settings-network">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item :label="t('certd.httpProxy')" :name="['private', 'httpProxy']" :rules="urlRules">
<a-input v-model:value="formState.private.httpProxy" :placeholder="t('certd.httpProxyPlaceholder')" />
<div class="helper">{{ t("certd.httpProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.httpsProxy')" :name="['private', 'httpsProxy']" :rules="urlRules">
<div class="flex">
<a-input v-model:value="formState.private.httpsProxy" :placeholder="t('certd.httpsProxyPlaceholder')" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading" :title="t('certd.saveThenTestTitle')" @click="testProxy">{{ t("certd.testButton") }}</a-button>
</div>
<div class="helper">{{ t("certd.httpsProxyHelper") }}</div>
</a-form-item>
<a-form-item :label="t('certd.dualStackNetwork')" :name="['private', 'dnsResultOrder']">
<a-select v-model:value="formState.private.dnsResultOrder">
<a-select-option value="verbatim">{{ t("certd.default") }}</a-select-option>
<a-select-option value="ipv4first">{{ t("certd.ipv4Priority") }}</a-select-option>
<a-select-option value="ipv6first">{{ t("certd.ipv6Priority") }}</a-select-option>
</a-select>
<div class="helper">
{{ t("certd.dualStackNetworkHelper") }}, <a href="https://certd.docmirror.cn/guide/use/setting/ipv6.html" target="_blank">{{ t("certd.helpDocLink") }}</a>
</div>
</a-form-item>
<a-form-item :label="t('certd.sys.setting.reverseProxy')" :name="['private', 'reverseProxy']">
<div class="mt-5">
<div v-for="(value, key) in formState.private.reverseProxies" :key="key" class="flex items-center p-2 border-b border-gray-300">
<span class="flex-1">{{ key }}</span>
<span class="flex-1 ml-5"><a-input v-model:value="formState.private.reverseProxies[key]" placeholder="proxy.xxxx.com" allow-clear /></span>
</div>
</div>
<div class="helper">{{ t("certd.sys.setting.reverseProxyHelper") }}</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 { proxyRefs, 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 { message, notification } from "ant-design-vue";
import { useI18n } from "/src/locales";
const { t } = useI18n();
import { util } from "/@/utils";
defineOptions({
name: "SettingNetwork",
});
const formState = reactive<Partial<SysSettings>>({
public: {},
private: {},
});
const urlRules = ref({
type: "url",
message: "请输入正确的URL",
});
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;
form.private.reverseProxies = formState.private.reverseProxies;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: t("certd.saveSuccess"),
});
} finally {
saveLoading.value = false;
}
};
const testProxyLoading = ref(false);
async function testProxy() {
testProxyLoading.value = true;
try {
const res = await api.TestProxy();
let success = true;
if (res.google !== true || res.baidu !== true) {
success = false;
}
const content = () => {
return (
<div>
<div>
{t("certd.google")}: {res.google === true ? t("certd.success") : util.maxLength(res.google)}
</div>
<div>
{t("certd.baidu")}: {res.baidu === true ? t("certd.success") : util.maxLength(res.baidu)}
</div>
</div>
);
};
if (!success) {
notification.error({
message: t("certd.testFailed"),
description: content,
});
return;
}
notification.success({
message: t("certd.testCompleted"),
description: content,
});
} finally {
testProxyLoading.value = false;
}
}
</script>
<style lang="less"></style>
@@ -8,6 +8,10 @@
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">{{ t("certd.limitUserPipelineCountHelper") }}</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.sys.setting.pipelineValidTimeEnabled')" :name="['public', 'pipelineValidTimeEnabled']">
<div class="flex items-center">
<a-switch v-model:checked="formState.public.pipelineValidTimeEnabled" :disabled="!settingsStore.isPlus" />