From 43ad0f5dd82cb4615804a87f76e46d74537e859e Mon Sep 17 00:00:00 2001 From: xue jiahao Date: Wed, 6 Nov 2024 21:56:14 +0800 Subject: [PATCH] show domain page for all user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. show ドメイン管理 2. hide ドメイン適用 --- frontend/src/layouts/MainLayout.vue | 81 ++++++----------------------- frontend/src/pages/TenantDomain.vue | 3 +- frontend/src/router/routes.ts | 2 +- frontend/src/stores/useAuthStore.ts | 8 +-- 4 files changed, 24 insertions(+), 70 deletions(-) diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index 83d81f5..bd890db 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -22,6 +22,8 @@
+ + @@ -83,58 +85,23 @@ const essentialLinks: EssentialLinkProps[] = [ // link:'https://cybozu.dev/ja/kintone/docs/', // icon:'help_outline' // }, +]; + +const domainLinks: EssentialLinkProps[] = [ + { + title: 'ドメイン管理', + caption: 'kintoneのドメイン設定', + icon: 'domain', + link: '/#/domain', + target: '_self' + }, // { - // title:'', - // isSeparator:true + // title: 'ドメイン適用', + // caption: 'ユーザー使用可能なドメインの設定', + // icon: 'assignment_ind', + // link: '/#/userDomain', + // target: '_self' // }, - // { - // title: 'Docs', - // caption: 'quasar.dev', - // icon: 'school', - // link: 'https://quasar.dev' - // }, - // { - // title: 'Icons', - // caption: 'Material Icons', - // icon: 'insert_emoticon', - // link: 'https://fonts.google.com/icons?selected=Material+Icons:insert_emoticon:' - // }, - // { - // title: 'Github', - // caption: 'github.com/quasarframework', - // icon: 'code', - // link: 'https://github.com/quasarframework' - // }, - // { - // title: 'Discord Chat Channel', - // caption: 'chat.quasar.dev', - // icon: 'chat', - // link: 'https://chat.quasar.dev' - // }, - // { - // title: 'Forum', - // caption: 'forum.quasar.dev', - // icon: 'record_voice_over', - // link: 'https://forum.quasar.dev' - // }, - // { - // title: 'Twitter', - // caption: '@quasarframework', - // icon: 'rss_feed', - // link: 'https://twitter.quasar.dev' - // }, - // { - // title: 'Facebook', - // caption: '@QuasarFramework', - // icon: 'public', - // link: 'https://facebook.quasar.dev' - // }, - // { - // title: 'Quasar Awesome', - // caption: 'Community Quasar projects', - // icon: 'favorite', - // link: 'https://awesome.quasar.dev' - // } ]; const adminLinks: EssentialLinkProps[] = [ @@ -145,20 +112,6 @@ const adminLinks: EssentialLinkProps[] = [ link: '/#/user', target: '_self' }, - { - title: 'ドメイン管理', - caption: 'kintoneのドメイン設定', - icon: 'domain', - link: '/#/domain', - target: '_self' - }, - { - title: 'ドメイン適用', - caption: 'ユーザー使用可能なドメインの設定', - icon: 'assignment_ind', - link: '/#/userDomain', - target: '_self' - }, ] const version = process.env.version; diff --git a/frontend/src/pages/TenantDomain.vue b/frontend/src/pages/TenantDomain.vue index b880503..4e2956b 100644 --- a/frontend/src/pages/TenantDomain.vue +++ b/frontend/src/pages/TenantDomain.vue @@ -155,7 +155,8 @@ let editId = ref(0); const getDomain = async () => { loading.value = true; - const result = await api.get(`api/domains/1`); + const userId = authStore.userId; + const result = await api.get(`api/domain?userId=${userId}`); rows.value = result.data.map((item) => { return { id: item.id, tenantid: item.tenantid, name: item.name, url: item.url, user: item.kintoneuser, password: item.kintonepwd } }); diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index f7c6d02..364eb8d 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -25,7 +25,7 @@ const routes: RouteRecordRaw[] = [ // { path: 'FlowChart', component: () => import('pages/FlowChart.vue') }, { path: 'right', component: () => import('pages/testRight.vue') }, { path: 'domain', component: () => import('pages/TenantDomain.vue') }, - { path: 'userdomain', component: () => import('pages/UserDomain.vue')}, + // { path: 'userdomain', component: () => import('pages/UserDomain.vue')}, { path: 'user', component: () => import('pages/UserManagement.vue')}, { path: 'condition', component: () => import('pages/conditionPage.vue') } ], diff --git a/frontend/src/stores/useAuthStore.ts b/frontend/src/stores/useAuthStore.ts index 8887ddd..b32a023 100644 --- a/frontend/src/stores/useAuthStore.ts +++ b/frontend/src/stores/useAuthStore.ts @@ -60,11 +60,11 @@ export const useAuthStore = defineStore('auth', { } }, async getCurrentDomain(): Promise { - const activedomain = await api.get(`api/activedomain`); + const activedomain = (await api.get(`api/activedomain`))?.data; return { - id: activedomain.data.id, - domainName: activedomain.data.name, - kintoneUrl: activedomain.data.url, + id: activedomain?.id, + domainName: activedomain?.name, + kintoneUrl: activedomain?.url, }; }, async getUserDomains(): Promise {