mirror of https://github.com/certd/certd
chore: 设置tab页签标题中英文优化
parent
7bdde68ece
commit
1476b9cb9c
|
@ -23,6 +23,7 @@ export type AddonDefine = Registrable & {
|
||||||
input?: {
|
input?: {
|
||||||
[key: string]: AddonInputDefine;
|
[key: string]: AddonInputDefine;
|
||||||
};
|
};
|
||||||
|
showTest?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type AddonInstanceConfig = {
|
export type AddonInstanceConfig = {
|
||||||
|
|
|
@ -707,6 +707,10 @@ export default {
|
||||||
pipeline: "Pipeline",
|
pipeline: "Pipeline",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
addonType: "Type",
|
||||||
|
addonName: "Name",
|
||||||
|
addonNameHelper: "Fill freely, helps to distinguish when multiple same type exist",
|
||||||
|
addonTypeSelect: "Select type",
|
||||||
sys: {
|
sys: {
|
||||||
setting: {
|
setting: {
|
||||||
showRunStrategy: "Show RunStrategy",
|
showRunStrategy: "Show RunStrategy",
|
||||||
|
@ -714,7 +718,12 @@ export default {
|
||||||
|
|
||||||
captchaEnabled: "Enable Login Captcha",
|
captchaEnabled: "Enable Login Captcha",
|
||||||
captchaHelper: "Whether to enable captcha verification for login",
|
captchaHelper: "Whether to enable captcha verification for login",
|
||||||
captchaType: "Captcha Type",
|
captchaType: "Captcha Setting",
|
||||||
|
|
||||||
|
baseSetting: "Base Settings",
|
||||||
|
registerSetting: "Register Settings",
|
||||||
|
safeSetting: "Safe Settings",
|
||||||
|
paymentSetting: "Payment Settings",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modal: {
|
modal: {
|
||||||
|
|
|
@ -695,7 +695,10 @@ export default {
|
||||||
setAsDefault: "设为默认",
|
setAsDefault: "设为默认",
|
||||||
disabledLabel: "禁用",
|
disabledLabel: "禁用",
|
||||||
confirmToggleStatus: "确定要{action}吗?",
|
confirmToggleStatus: "确定要{action}吗?",
|
||||||
|
addonType: "类型",
|
||||||
|
addonName: "名称",
|
||||||
|
addonNameHelper: "随意填写,相同类型助于区分即可",
|
||||||
|
addonTypeSelect: "请选择",
|
||||||
template: {
|
template: {
|
||||||
title: "流水线模版",
|
title: "流水线模版",
|
||||||
edit: "流水线模版编辑",
|
edit: "流水线模版编辑",
|
||||||
|
@ -717,7 +720,12 @@ export default {
|
||||||
|
|
||||||
captchaEnabled: "启用登录验证码",
|
captchaEnabled: "启用登录验证码",
|
||||||
captchaHelper: "登录时是否启用验证码",
|
captchaHelper: "登录时是否启用验证码",
|
||||||
captchaType: "验证码类型",
|
captchaType: "验证码配置",
|
||||||
|
|
||||||
|
baseSetting: "基本设置",
|
||||||
|
registerSetting: "注册设置",
|
||||||
|
safeSetting: "安全设置",
|
||||||
|
paymentSetting: "支付设置",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modal: {
|
modal: {
|
||||||
|
|
|
@ -127,3 +127,16 @@ export function createAddonApi(opts: { from: any; addonType: string }) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const AddonTypeDefines = {
|
||||||
|
captcha: {
|
||||||
|
name: "captcha",
|
||||||
|
title: "验证码",
|
||||||
|
showDefault: false,
|
||||||
|
showTest: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export function getAddonTypeDefine(addonType: string) {
|
||||||
|
return AddonTypeDefines[addonType];
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { Modal } from "ant-design-vue";
|
||||||
import { mitter } from "/@/utils/util.mitt";
|
import { mitter } from "/@/utils/util.mitt";
|
||||||
import { useI18n } from "/src/locales";
|
import { useI18n } from "/src/locales";
|
||||||
import * as pipelineApi from "/@/views/certd/pipeline/api";
|
import * as pipelineApi from "/@/views/certd/pipeline/api";
|
||||||
|
import { getAddonTypeDefine } from "/@/views/certd/addon/api";
|
||||||
|
|
||||||
export function addonProvide(api: any) {
|
export function addonProvide(api: any) {
|
||||||
provide("addonApi", api);
|
provide("addonApi", api);
|
||||||
|
@ -104,7 +105,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
type: {
|
type: {
|
||||||
title: t("certd.notificationType"),
|
title: t("certd.addonType"),
|
||||||
type: "dict-select",
|
type: "dict-select",
|
||||||
dict: addonTypeDictRef,
|
dict: addonTypeDictRef,
|
||||||
search: {
|
search: {
|
||||||
|
@ -138,7 +139,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
rules: [{ required: true, message: t("certd.selectNotificationType") }],
|
rules: [{ required: true, message: t("certd.addonTypeSelect") }],
|
||||||
valueChange: {
|
valueChange: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
async handle({ value, mode, form, immediate }) {
|
async handle({ value, mode, form, immediate }) {
|
||||||
|
@ -173,14 +174,14 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
},
|
},
|
||||||
} as ColumnCompositionProps,
|
} as ColumnCompositionProps,
|
||||||
name: {
|
name: {
|
||||||
title: t("certd.notificationName"),
|
title: t("certd.addonName"),
|
||||||
search: {
|
search: {
|
||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
type: ["text"],
|
type: ["text"],
|
||||||
form: {
|
form: {
|
||||||
rules: [{ required: true, message: t("certd.enterName") }],
|
rules: [{ required: true, message: t("certd.enterName") }],
|
||||||
helper: t("certd.helperNotificationName"),
|
helper: t("certd.addonNameHelper"),
|
||||||
},
|
},
|
||||||
column: {
|
column: {
|
||||||
width: 200,
|
width: 200,
|
||||||
|
@ -196,6 +197,9 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
form: {
|
form: {
|
||||||
|
show: computed(() => {
|
||||||
|
return getAddonTypeDefine(addonType)?.showDefault ?? false;
|
||||||
|
}),
|
||||||
value: false,
|
value: false,
|
||||||
rules: [{ required: true, message: t("certd.selectIsDefault") }],
|
rules: [{ required: true, message: t("certd.selectIsDefault") }],
|
||||||
order: 999,
|
order: 999,
|
||||||
|
@ -203,6 +207,9 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
column: {
|
column: {
|
||||||
align: "center",
|
align: "center",
|
||||||
width: 100,
|
width: 100,
|
||||||
|
show: computed(() => {
|
||||||
|
return getAddonTypeDefine(addonType)?.showDefault ?? false;
|
||||||
|
}),
|
||||||
component: {
|
component: {
|
||||||
name: "a-switch",
|
name: "a-switch",
|
||||||
vModel: "checked",
|
vModel: "checked",
|
||||||
|
@ -210,6 +217,7 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
return value === true;
|
return value === true;
|
||||||
}),
|
}),
|
||||||
on: {
|
on: {
|
||||||
|
// @ts-ignore
|
||||||
change({ row }) {
|
change({ row }) {
|
||||||
Modal.confirm({
|
Modal.confirm({
|
||||||
title: t("certd.prompt"),
|
title: t("certd.prompt"),
|
||||||
|
@ -226,12 +234,12 @@ export function getCommonColumnDefine(crudExpose: any, typeRef: any, api: any, a
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as ColumnCompositionProps,
|
},
|
||||||
test: {
|
test: {
|
||||||
title: t("certd.test"),
|
title: t("certd.test"),
|
||||||
form: {
|
form: {
|
||||||
show: compute(({ form }) => {
|
show: compute(({ form }) => {
|
||||||
return !!form.type;
|
return !!form.type && currentDefine.value?.showTest === true;
|
||||||
}),
|
}),
|
||||||
component: {
|
component: {
|
||||||
name: "api-test",
|
name: "api-test",
|
||||||
|
|
|
@ -5,17 +5,17 @@
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<div class="sys-settings-body md:p-5">
|
<div class="sys-settings-body md:p-5">
|
||||||
<a-tabs :active-key="activeKey" type="card" class="sys-settings-tabs" @update:active-key="onChange">
|
<a-tabs :active-key="activeKey" type="card" class="sys-settings-tabs" @update:active-key="onChange">
|
||||||
<a-tab-pane key="base" tab="基本设置">
|
<a-tab-pane key="base" :tab="t('certd.sys.setting.baseSetting')">
|
||||||
<SettingBase v-if="activeKey === 'base'" />
|
<SettingBase v-if="activeKey === 'base'" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="register" tab="注册设置">
|
<a-tab-pane key="register" :tab="t('certd.sys.setting.registerSetting')">
|
||||||
<SettingRegister v-if="activeKey === 'register'" />
|
<SettingRegister v-if="activeKey === 'register'" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane v-if="settingsStore.isComm" key="payment" tab="支付设置">
|
<a-tab-pane v-if="settingsStore.isComm" key="payment" :tab="t('certd.sys.setting.paymentSetting')">
|
||||||
<SettingPayment v-if="activeKey === 'payment'" />
|
<SettingPayment v-if="activeKey === 'payment'" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
<a-tab-pane key="save" tab="安全设置">
|
<a-tab-pane key="safe" :tab="t('certd.sys.setting.safeSetting')">
|
||||||
<SettingSafe v-if="activeKey === 'save'" />
|
<SettingSafe v-if="activeKey === 'safe'" />
|
||||||
</a-tab-pane>
|
</a-tab-pane>
|
||||||
</a-tabs>
|
</a-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
@ -30,9 +30,11 @@ import SettingSafe from "/@/views/sys/settings/tabs/safe.vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { useSettingStore } from "/@/store/settings";
|
import { useSettingStore } from "/@/store/settings";
|
||||||
|
import { useI18n } from "/@/locales";
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: "SysSettings",
|
name: "SysSettings",
|
||||||
});
|
});
|
||||||
|
const { t } = useI18n();
|
||||||
const settingsStore = useSettingStore();
|
const settingsStore = useSettingStore();
|
||||||
const activeKey = ref("base");
|
const activeKey = ref("base");
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
|
@ -5,22 +5,24 @@ import { ICaptchaAddon } from "../api.js";
|
||||||
@IsAddon({
|
@IsAddon({
|
||||||
addonType:"captcha",
|
addonType:"captcha",
|
||||||
name: 'geetest',
|
name: 'geetest',
|
||||||
title: '极验验证码',
|
title: '极验验证码v4',
|
||||||
desc: '',
|
desc: '',
|
||||||
|
showTest:false,
|
||||||
})
|
})
|
||||||
export class GeeTestCaptcha extends BaseAddon implements ICaptchaAddon{
|
export class GeeTestCaptcha extends BaseAddon implements ICaptchaAddon{
|
||||||
|
|
||||||
@AddonInput({
|
@AddonInput({
|
||||||
title: 'captchaId',
|
title: '验证ID',
|
||||||
component: {
|
component: {
|
||||||
placeholder: 'captchaId',
|
placeholder: 'captchaId',
|
||||||
},
|
},
|
||||||
|
helper:"[极验验证码v4](https://console.geetest.com/sensbot/management) -> 创建业务模块 -> 新增业务场景",
|
||||||
required: true,
|
required: true,
|
||||||
})
|
})
|
||||||
captchaId = '';
|
captchaId = '';
|
||||||
|
|
||||||
@AddonInput({
|
@AddonInput({
|
||||||
title: 'captchaKey',
|
title: '验证Key',
|
||||||
component: {
|
component: {
|
||||||
placeholder: 'captchaKey',
|
placeholder: 'captchaKey',
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { nanoid } from "nanoid";
|
||||||
name: 'image',
|
name: 'image',
|
||||||
title: '图片验证码',
|
title: '图片验证码',
|
||||||
desc: '',
|
desc: '',
|
||||||
|
showTest:false,
|
||||||
})
|
})
|
||||||
export class ImageCaptcha extends BaseAddon implements ICaptchaAddon{
|
export class ImageCaptcha extends BaseAddon implements ICaptchaAddon{
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue