mirror of
https://github.com/certd/certd.git
synced 2026-04-24 20:57:26 +08:00
perf: 企业模式下面增加个人数据迁移的引导
This commit is contained in:
@@ -795,6 +795,8 @@ export default {
|
|||||||
reverseProxyEmpty: "No reverse proxy list configured",
|
reverseProxyEmpty: "No reverse proxy list configured",
|
||||||
environmentVars: "Environment Variables",
|
environmentVars: "Environment Variables",
|
||||||
environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE",
|
environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE",
|
||||||
|
|
||||||
|
bindUrl: "Bind URL",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modal: {
|
modal: {
|
||||||
|
|||||||
@@ -804,6 +804,7 @@ export default {
|
|||||||
reverseProxyEmpty: "未配置反向代理",
|
reverseProxyEmpty: "未配置反向代理",
|
||||||
environmentVars: "环境变量",
|
environmentVars: "环境变量",
|
||||||
environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE",
|
environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE",
|
||||||
|
bindUrl: "绑定URL",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
modal: {
|
modal: {
|
||||||
|
|||||||
@@ -272,14 +272,27 @@ export const useSettingStore = defineStore({
|
|||||||
},
|
},
|
||||||
async checkUrlBound() {
|
async checkUrlBound() {
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const settingStore = useSettingStore();
|
|
||||||
if (!userStore.isAdmin) {
|
if (!userStore.isAdmin) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const bindUrl = this.installInfo.bindUrl;
|
||||||
|
const bindUrl2 = this.installInfo.bindUrl2;
|
||||||
|
if (!bindUrl) {
|
||||||
|
//绑定url
|
||||||
|
await this.doBindUrl("url");
|
||||||
|
} else {
|
||||||
|
//检查当前url 是否与绑定的url一致
|
||||||
|
const url = window.location.href;
|
||||||
|
if (!url.startsWith(bindUrl) && !url.startsWith(bindUrl2)) {
|
||||||
|
this.openBindUrlModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
openBindUrlModal() {
|
||||||
const event: any = { ModalRef: null };
|
const event: any = { ModalRef: null };
|
||||||
mitter.emit("getModal", event);
|
mitter.emit("getModal", event);
|
||||||
const Modal = event.ModalRef;
|
const Modal = event.ModalRef;
|
||||||
let modalRef: any = null;
|
|
||||||
const bindUrl = this.installInfo.bindUrl;
|
const bindUrl = this.installInfo.bindUrl;
|
||||||
const bindUrl2 = this.installInfo.bindUrl2;
|
const bindUrl2 = this.installInfo.bindUrl2;
|
||||||
|
|
||||||
@@ -289,57 +302,47 @@ export const useSettingStore = defineStore({
|
|||||||
modalRef.destroy();
|
modalRef.destroy();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const modalRef: any = Modal.warning({
|
||||||
if (!bindUrl) {
|
title: "URL地址未绑定,是否绑定此地址?",
|
||||||
//绑定url
|
width: 500,
|
||||||
await this.doBindUrl("url");
|
keyboard: false,
|
||||||
} else {
|
content: () => {
|
||||||
//检查当前url 是否与绑定的url一致
|
return (
|
||||||
const url = window.location.href;
|
<div class="p-4">
|
||||||
if (!url.startsWith(bindUrl) && !url.startsWith(bindUrl2)) {
|
<div class="flex items-center justify-between">
|
||||||
modalRef = Modal.warning({
|
<span>
|
||||||
title: "URL地址未绑定,是否绑定此地址?",
|
绑定地址1:
|
||||||
width: 500,
|
<a-tag color="green">{bindUrl || "未占用"}</a-tag>
|
||||||
keyboard: false,
|
</span>
|
||||||
content: () => {
|
<a-button type="primary" onClick={() => doBindRequest("url")}>
|
||||||
return (
|
绑定到地址1
|
||||||
<div class="p-4">
|
</a-button>
|
||||||
<div class="flex items-center justify-between">
|
</div>
|
||||||
<span>
|
<div class="flex items-center justify-between mt-3">
|
||||||
绑定地址1:
|
<span>
|
||||||
<a-tag color="green">{bindUrl || "未占用"}</a-tag>
|
绑定地址2:
|
||||||
</span>
|
<a-tag color="green">{bindUrl2 || "未占用"}</a-tag>
|
||||||
<a-button type="primary" onClick={() => doBindRequest("url")}>
|
</span>
|
||||||
绑定到地址1
|
<a-button type="primary" onClick={() => doBindRequest("url2")}>
|
||||||
</a-button>
|
绑定到地址2
|
||||||
</div>
|
</a-button>
|
||||||
<div class="flex items-center justify-between mt-3">
|
</div>
|
||||||
<span>
|
</div>
|
||||||
绑定地址2:
|
);
|
||||||
<a-tag color="green">{bindUrl2 || "未占用"}</a-tag>
|
},
|
||||||
</span>
|
onOk: async () => {
|
||||||
<a-button type="primary" onClick={() => doBindRequest("url2")}>
|
// await this.doBindUrl();
|
||||||
绑定到地址2
|
window.location.href = bindUrl;
|
||||||
</a-button>
|
},
|
||||||
</div>
|
okButtonProps: {
|
||||||
</div>
|
danger: true,
|
||||||
);
|
},
|
||||||
},
|
okText: "不,回到原来的地址",
|
||||||
onOk: async () => {
|
cancelText: "不,回到原来的地址",
|
||||||
// await this.doBindUrl();
|
onCancel: () => {
|
||||||
window.location.href = bindUrl;
|
window.location.href = bindUrl;
|
||||||
},
|
},
|
||||||
okButtonProps: {
|
});
|
||||||
danger: true,
|
|
||||||
},
|
|
||||||
okText: "不,回到原来的地址",
|
|
||||||
cancelText: "不,回到原来的地址",
|
|
||||||
onCancel: () => {
|
|
||||||
window.location.href = bindUrl;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
async loadProductInfo() {
|
async loadProductInfo() {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ defineOptions({
|
|||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const projectIdStr = route.query.projectId as string;
|
const projectIdStr = route.query.projectId as string;
|
||||||
|
const migrate = route.query.migrate as string;
|
||||||
let projectId = Number(projectIdStr);
|
let projectId = Number(projectIdStr);
|
||||||
const projectStore = useProjectStore();
|
const projectStore = useProjectStore();
|
||||||
if (!projectId) {
|
if (!projectId) {
|
||||||
@@ -116,7 +117,11 @@ onMounted(async () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await loadProjectDetail();
|
await loadProjectDetail();
|
||||||
crudExpose.doRefresh();
|
await crudExpose.doRefresh();
|
||||||
|
|
||||||
|
if (migrate === "true") {
|
||||||
|
openTransferDialog();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
onActivated(async () => {
|
onActivated(async () => {
|
||||||
await crudExpose.doRefresh();
|
await crudExpose.doRefresh();
|
||||||
|
|||||||
@@ -8,9 +8,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="helper">SaaS模式:每个用户管理自己的流水线和授权资源,独立使用。</div>
|
<div class="helper">SaaS模式:每个用户管理自己的流水线和授权资源,独立使用。</div>
|
||||||
<div class="helper">企业模式:通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。</div>
|
<div class="helper">企业模式:通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。</div>
|
||||||
|
<div class="helper"><a @click="adminModeIntroOpen = true">更多管理模式介绍</a></div>
|
||||||
<div class="helper text-red-500">建议在开始使用时固定一个合适的模式,之后就不要随意切换了。</div>
|
<div class="helper text-red-500">建议在开始使用时固定一个合适的模式,之后就不要随意切换了。</div>
|
||||||
|
<div v-if="formState.public.adminMode === 'enterprise'" class="helper">设置为企业模式之后,之前创建的个人数据不会显示,您可以选择<a @click="goCurrentProject"> 将个人数据迁移到项目</a></div>
|
||||||
<div v-if="settingsStore.isComm" class="helper text-red-500">商业版不建议设置为企业模式,除非你确定要转成企业内部使用</div>
|
<div v-if="settingsStore.isComm" class="helper text-red-500">商业版不建议设置为企业模式,除非你确定要转成企业内部使用</div>
|
||||||
<div><a @click="adminModeIntroOpen = true"> 更多管理模式介绍</a></div>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
|
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
|
||||||
@@ -33,6 +34,7 @@ import { useI18n } from "/src/locales";
|
|||||||
import { dict } from "@fast-crud/fast-crud";
|
import { dict } from "@fast-crud/fast-crud";
|
||||||
import { useProjectStore } from "/@/store/project";
|
import { useProjectStore } from "/@/store/project";
|
||||||
import AdminModeIntro from "/@/views/sys/enterprise/project/intro.vue";
|
import AdminModeIntro from "/@/views/sys/enterprise/project/intro.vue";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
@@ -82,5 +84,15 @@ const onFinish = async (form: any) => {
|
|||||||
saveLoading.value = false;
|
saveLoading.value = false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
const goCurrentProject = () => {
|
||||||
|
router.push({
|
||||||
|
path: "/certd/project/detail",
|
||||||
|
query: {
|
||||||
|
migrate: "true",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less"></style>
|
<style lang="less"></style>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<pre class="helper pre">{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}</pre>
|
<pre class="helper pre">{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}</pre>
|
||||||
<div v-if="!bindDomainIsSame" class="text-red-500 text-sm mt-2">
|
<div v-if="!bindDomainIsSame" class="text-red-500 text-sm mt-2">
|
||||||
{{ t("certd.sys.setting.passkeyHostnameNotSame") }}
|
{{ t("certd.sys.setting.passkeyHostnameNotSame") }} <a-button class="ml-2" size="small" type="primary" @click="settingsStore.openBindUrlModal()">{{ t("certd.sys.setting.bindUrl") }}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :label="t('certd.sys.setting.enableOauth')" :name="['public', 'oauthEnabled']">
|
<a-form-item :label="t('certd.sys.setting.enableOauth')" :name="['public', 'oauthEnabled']">
|
||||||
|
|||||||
Reference in New Issue
Block a user