mirror of
https://github.com/certd/certd.git
synced 2026-04-26 05:37:25 +08:00
chore: 企业管理模式初步
This commit is contained in:
@@ -861,4 +861,8 @@ export default {
|
||||
select: "Select",
|
||||
placeholder: "select please",
|
||||
},
|
||||
adminMode: {
|
||||
enterpriseMode: "Enterprise Mode",
|
||||
saasMode: "SaaS Mode",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -876,4 +876,8 @@ export default {
|
||||
select: "选择",
|
||||
placeholder: "请选择",
|
||||
},
|
||||
adminMode: {
|
||||
enterpriseMode: "企业模式",
|
||||
saasMode: "SaaS模式",
|
||||
},
|
||||
};
|
||||
|
||||
@@ -86,6 +86,9 @@ export type SysPublicSetting = {
|
||||
>;
|
||||
// 系统通知
|
||||
notice?: string;
|
||||
|
||||
// 管理员模式
|
||||
adminMode?: "enterprise" | "saas";
|
||||
};
|
||||
export type SuiteSetting = {
|
||||
enabled?: boolean;
|
||||
|
||||
@@ -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="mode" :tab="t('certd.adminMode')">
|
||||
<SettingMode v-if="activeKey === 'mode'" />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</fs-page>
|
||||
@@ -39,6 +42,8 @@ import SettingSafe from "/@/views/sys/settings/tabs/safe.vue";
|
||||
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 { useRoute, useRouter } from "vue-router";
|
||||
import { ref } from "vue";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
<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>
|
||||
<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']">
|
||||
@@ -68,8 +70,6 @@ import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { util } from "/@/utils";
|
||||
import { useI18n } from "/src/locales";
|
||||
import AddonSelector from "../../../certd/addon/addon-selector/index.vue";
|
||||
import CaptchaInput from "/@/components/captcha/captcha-input.vue";
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<template>
|
||||
<div class="sys-settings-form sys-settings-mode">
|
||||
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
|
||||
<a-form-item :label="t('certd.adminMode')" :name="['public', 'adminMode']">
|
||||
<fs-dict-radio v-model:checked="formState.public.adminMode" :dict="adminModeDict" />
|
||||
</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: "SettingMode",
|
||||
});
|
||||
|
||||
const adminModeDict = [
|
||||
{
|
||||
label: t("certd.adminMode.enterpriseMode"),
|
||||
value: "enterprise",
|
||||
},
|
||||
{
|
||||
label: t("certd.adminMode.saasMode"),
|
||||
value: "saas",
|
||||
},
|
||||
];
|
||||
|
||||
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"></style>
|
||||
Reference in New Issue
Block a user