diff --git a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts
index d300dc382..61ea3973c 100644
--- a/packages/ui/certd-client/src/locales/langs/en-US/certd.ts
+++ b/packages/ui/certd-client/src/locales/langs/en-US/certd.ts
@@ -795,6 +795,8 @@ export default {
reverseProxyEmpty: "No reverse proxy list configured",
environmentVars: "Environment Variables",
environmentVarsHelper: "configure the runtime environment variables, one per line, format: KEY=VALUE",
+
+ bindUrl: "Bind URL",
},
},
modal: {
diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts
index 39c496214..fcc346979 100644
--- a/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts
+++ b/packages/ui/certd-client/src/locales/langs/zh-CN/certd.ts
@@ -804,6 +804,7 @@ export default {
reverseProxyEmpty: "未配置反向代理",
environmentVars: "环境变量",
environmentVarsHelper: "配置运行时环境变量,每行一个,格式:KEY=VALUE",
+ bindUrl: "绑定URL",
},
},
modal: {
diff --git a/packages/ui/certd-client/src/store/settings/index.tsx b/packages/ui/certd-client/src/store/settings/index.tsx
index 09ccb3e24..955c242b4 100644
--- a/packages/ui/certd-client/src/store/settings/index.tsx
+++ b/packages/ui/certd-client/src/store/settings/index.tsx
@@ -272,14 +272,27 @@ export const useSettingStore = defineStore({
},
async checkUrlBound() {
const userStore = useUserStore();
- const settingStore = useSettingStore();
if (!userStore.isAdmin) {
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 };
mitter.emit("getModal", event);
const Modal = event.ModalRef;
- let modalRef: any = null;
const bindUrl = this.installInfo.bindUrl;
const bindUrl2 = this.installInfo.bindUrl2;
@@ -289,57 +302,47 @@ export const useSettingStore = defineStore({
modalRef.destroy();
}
};
-
- if (!bindUrl) {
- //绑定url
- await this.doBindUrl("url");
- } else {
- //检查当前url 是否与绑定的url一致
- const url = window.location.href;
- if (!url.startsWith(bindUrl) && !url.startsWith(bindUrl2)) {
- modalRef = Modal.warning({
- title: "URL地址未绑定,是否绑定此地址?",
- width: 500,
- keyboard: false,
- content: () => {
- return (
-
-
-
- 绑定地址1:
- {bindUrl || "未占用"}
-
-
doBindRequest("url")}>
- 绑定到地址1
-
-
-
-
- 绑定地址2:
- {bindUrl2 || "未占用"}
-
-
doBindRequest("url2")}>
- 绑定到地址2
-
-
-
- );
- },
- onOk: async () => {
- // await this.doBindUrl();
- window.location.href = bindUrl;
- },
- okButtonProps: {
- danger: true,
- },
- okText: "不,回到原来的地址",
- cancelText: "不,回到原来的地址",
- onCancel: () => {
- window.location.href = bindUrl;
- },
- });
- }
- }
+ const modalRef: any = Modal.warning({
+ title: "URL地址未绑定,是否绑定此地址?",
+ width: 500,
+ keyboard: false,
+ content: () => {
+ return (
+
+
+
+ 绑定地址1:
+ {bindUrl || "未占用"}
+
+
doBindRequest("url")}>
+ 绑定到地址1
+
+
+
+
+ 绑定地址2:
+ {bindUrl2 || "未占用"}
+
+
doBindRequest("url2")}>
+ 绑定到地址2
+
+
+
+ );
+ },
+ onOk: async () => {
+ // await this.doBindUrl();
+ window.location.href = bindUrl;
+ },
+ okButtonProps: {
+ danger: true,
+ },
+ okText: "不,回到原来的地址",
+ cancelText: "不,回到原来的地址",
+ onCancel: () => {
+ window.location.href = bindUrl;
+ },
+ });
},
async loadProductInfo() {
try {
diff --git a/packages/ui/certd-client/src/views/certd/project/detail/index.vue b/packages/ui/certd-client/src/views/certd/project/detail/index.vue
index f3cce0f7c..c2bb178cc 100644
--- a/packages/ui/certd-client/src/views/certd/project/detail/index.vue
+++ b/packages/ui/certd-client/src/views/certd/project/detail/index.vue
@@ -49,6 +49,7 @@ defineOptions({
const route = useRoute();
const projectIdStr = route.query.projectId as string;
+const migrate = route.query.migrate as string;
let projectId = Number(projectIdStr);
const projectStore = useProjectStore();
if (!projectId) {
@@ -116,7 +117,11 @@ onMounted(async () => {
return;
}
await loadProjectDetail();
- crudExpose.doRefresh();
+ await crudExpose.doRefresh();
+
+ if (migrate === "true") {
+ openTransferDialog();
+ }
});
onActivated(async () => {
await crudExpose.doRefresh();
diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue
index ee466d074..746f5197e 100644
--- a/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue
+++ b/packages/ui/certd-client/src/views/sys/settings/tabs/mode.vue
@@ -8,9 +8,10 @@
SaaS模式:每个用户管理自己的流水线和授权资源,独立使用。
企业模式:通过项目合作管理流水线证书和授权资源,所有用户视为企业内部员工。
+
建议在开始使用时固定一个合适的模式,之后就不要随意切换了。
+
商业版不建议设置为企业模式,除非你确定要转成企业内部使用
-
@@ -33,6 +34,7 @@ import { useI18n } from "/src/locales";
import { dict } from "@fast-crud/fast-crud";
import { useProjectStore } from "/@/store/project";
import AdminModeIntro from "/@/views/sys/enterprise/project/intro.vue";
+import { useRouter } from "vue-router";
const { t } = useI18n();
defineOptions({
@@ -82,5 +84,15 @@ const onFinish = async (form: any) => {
saveLoading.value = false;
}
};
+
+const router = useRouter();
+const goCurrentProject = () => {
+ router.push({
+ path: "/certd/project/detail",
+ query: {
+ migrate: "true",
+ },
+ });
+};
diff --git a/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue b/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue
index c6782fe07..0d8bacfd5 100644
--- a/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue
+++ b/packages/ui/certd-client/src/views/sys/settings/tabs/oauth.vue
@@ -8,7 +8,7 @@
{{ t("certd.sys.setting.passkeyEnabledHelper", [bindDomain]) }}
- {{ t("certd.sys.setting.passkeyHostnameNotSame") }}
+ {{ t("certd.sys.setting.passkeyHostnameNotSame") }}
{{ t("certd.sys.setting.bindUrl") }}