mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
chore: admin mode
This commit is contained in:
@@ -94,7 +94,7 @@ provide("fn:ai.open", openChat);
|
||||
<div class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<vip-button class="flex-center header-btn" mode="nav" />
|
||||
</div>
|
||||
<div v-if="!settingStore.isComm" class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full">
|
||||
<div v-if="!settingStore.isComm" class="hover:bg-accent ml-1 mr-2 cursor-pointer rounded-full hidden md:block">
|
||||
<fs-button shape="circle" type="text" icon="ion:logo-github" :text="null" @click="goGithub" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -230,7 +230,7 @@ export const sysResources = [
|
||||
title: "certd.sysResources.enterpriseSetting",
|
||||
name: "EnterpriseSetting",
|
||||
path: "/sys/enterprise/setting",
|
||||
redirect: "/sys/settings?tab=enterprise",
|
||||
redirect: "/sys/settings?tab=mode",
|
||||
meta: {
|
||||
isMenu: true,
|
||||
show: true,
|
||||
|
||||
@@ -111,7 +111,7 @@ function clearPreferencesAndLogout() {
|
||||
<template v-for="slot in leftSlots.filter(item => item.index < REFERENCE_VALUE)" :key="slot.name">
|
||||
<slot :name="slot.name">
|
||||
<template v-if="slot.name === 'refresh'">
|
||||
<VbenIconButton class="my-0 mr-1 rounded-md" @click="refresh">
|
||||
<VbenIconButton class="my-0 mr-1 rounded-md hidden md:block" @click="refresh">
|
||||
<RotateCw class="size-4" />
|
||||
</VbenIconButton>
|
||||
</template>
|
||||
@@ -131,7 +131,7 @@ function clearPreferencesAndLogout() {
|
||||
<template v-for="slot in rightSlots" :key="slot.name">
|
||||
<slot :name="slot.name">
|
||||
<template v-if="slot.name === 'global-search'">
|
||||
<GlobalSearch :enable-shortcut-key="globalSearchShortcutKey" :menus="accessStore.accessMenus" class="mr-1 sm:mr-4" />
|
||||
<GlobalSearch :enable-shortcut-key="globalSearchShortcutKey" :menus="accessStore.accessMenus" class="mr-1 sm:mr-4 hidden md:block" />
|
||||
</template>
|
||||
|
||||
<template v-else-if="slot.name === 'preferences'">
|
||||
@@ -144,7 +144,7 @@ function clearPreferencesAndLogout() {
|
||||
<LanguageToggle class="mr-1" />
|
||||
</template>
|
||||
<template v-else-if="slot.name === 'fullscreen'">
|
||||
<VbenFullScreen class="mr-1" />
|
||||
<VbenFullScreen class="mr-1 hidden md:block" />
|
||||
</template>
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
|
||||
export const projectPermissionDict = dict({
|
||||
data: [
|
||||
{
|
||||
label: "read",
|
||||
value: "只读",
|
||||
},
|
||||
{
|
||||
label: "write",
|
||||
value: "读写",
|
||||
},
|
||||
{
|
||||
label: "admin",
|
||||
value: "管理员",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export const projectDict = dict({
|
||||
url: "/sys/enterprise/project/list",
|
||||
});
|
||||
@@ -14,6 +14,7 @@ import GroupSelector from "/@/views/certd/pipeline/group/group-selector.vue";
|
||||
import { statusUtil } from "/@/views/certd/pipeline/pipeline/utils/util.status";
|
||||
import { useCertViewer } from "/@/views/certd/pipeline/use";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { projectDict } from "../dicts";
|
||||
|
||||
export default function ({ crudExpose, context: { selectedRowKeys, openCertApplyDialog } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
|
||||
const router = useRouter();
|
||||
@@ -294,6 +295,11 @@ export default function ({ crudExpose, context: { selectedRowKeys, openCertApply
|
||||
width: 100,
|
||||
},
|
||||
},
|
||||
projectId: {
|
||||
title: t("certd.fields.projectName"),
|
||||
type: "number",
|
||||
dict: projectDict,
|
||||
},
|
||||
title: {
|
||||
title: t("certd.fields.pipelineName"),
|
||||
type: "link",
|
||||
|
||||
@@ -74,7 +74,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
name: {
|
||||
title: t("certd.ent.projectName"),
|
||||
type: "text",
|
||||
type: "link",
|
||||
search: {
|
||||
show: true,
|
||||
},
|
||||
@@ -85,6 +85,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
|
||||
},
|
||||
column: {
|
||||
width: 200,
|
||||
cellRender({ row }) {
|
||||
return (
|
||||
<router-link to={`/sys/enterprise/project/member`} query={{ projectId: row.id }}>
|
||||
{row.name}
|
||||
</router-link>
|
||||
);
|
||||
},
|
||||
},
|
||||
},
|
||||
disabled: {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<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" />
|
||||
<fs-dict-radio v-model:value="formState.public.adminMode" :dict="adminModeDict" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
|
||||
@@ -20,22 +20,25 @@ import { merge } from "lodash-es";
|
||||
import { useSettingStore } from "/@/store/settings";
|
||||
import { notification } from "ant-design-vue";
|
||||
import { useI18n } from "/src/locales";
|
||||
import { dict } from "@fast-crud/fast-crud";
|
||||
const { t } = useI18n();
|
||||
|
||||
defineOptions({
|
||||
name: "SettingMode",
|
||||
});
|
||||
|
||||
const adminModeDict = [
|
||||
{
|
||||
label: t("certd.adminMode.enterpriseMode"),
|
||||
value: "enterprise",
|
||||
},
|
||||
{
|
||||
label: t("certd.adminMode.saasMode"),
|
||||
value: "saas",
|
||||
},
|
||||
];
|
||||
const adminModeDict = dict({
|
||||
data: [
|
||||
{
|
||||
label: t("certd.adminMode.enterpriseMode"),
|
||||
value: "enterprise",
|
||||
},
|
||||
{
|
||||
label: t("certd.adminMode.saasMode"),
|
||||
value: "saas",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const formState = reactive<Partial<SysSettings>>({
|
||||
public: {},
|
||||
|
||||
Reference in New Issue
Block a user