Skip to content

Commit

Permalink
fix: 修复多租户相关文本展示 (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlmac authored Jan 7, 2025
1 parent 498d34b commit bca5bf1
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/dashboard-front/.bk.development.env
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ BK_LOGIN_URL = ''
BK_APP_HOST = 'dev-apigw.example.com'

# 开发 port
#BK_APP_PORT = 8888
BK_APP_PORT = 80
BK_APP_PORT = 8888
#BK_APP_PORT = 80

BK_DASHBOARD_CSRF_COOKIE_NAME = 'bk_apigw_dashboard_csrftoken'

Expand Down
1 change: 0 additions & 1 deletion src/dashboard-front/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,3 @@ dist/
.prettierrc

bkcodeai.json
.bk.local.tenant.env
4 changes: 2 additions & 2 deletions src/dashboard-front/bk.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ module.exports = {
client: {
overlay: false,
},
// https: !process.env.BK_HTTPS,
https: false,
https: !process.env.BK_HTTPS,
// https: false,
},
};
},
Expand Down
12 changes: 12 additions & 0 deletions src/dashboard-front/src/enums/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import i18n from '@/language/i18n';

const { t } = i18n.global;

const TENANT_MODE_TEXT_MAP: Record<string, string> = {
global: t('全租户'),
single: t('单租户'),
};

export {
TENANT_MODE_TEXT_MAP,
};
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</article>
<article>
<header class="content-title">{{ t('租户模式') }}</header>
<main class="content-main">{{ basics.tenant_mode }}</main>
<main class="content-main">{{ TENANT_MODE_TEXT_MAP[basics.tenant_mode] }}</main>
</article>
<article>
<header class="content-title">{{ t('租户 ID') }}</header>
Expand Down Expand Up @@ -105,6 +105,7 @@ import {
TabType,
} from '@/views/apiDocs/types';
import LangSelector from '@/views/apiDocs/components/lang-selector.vue';
import { TENANT_MODE_TEXT_MAP } from '@/enums';
const { t } = useI18n();
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard-front/src/views/apiDocs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
:width="120"
>
<template #default="{ row }">
{{ row.tenant_mode || '--' }}
{{ TENANT_MODE_TEXT_MAP[row.tenant_mode as string] || '--' }}
</template>
</bk-table-column>
<bk-table-column
Expand Down Expand Up @@ -283,6 +283,7 @@ import {
import { AngleUpFill } from 'bkui-vue/lib/icon';
import { useTemplateRefsList } from '@vueuse/core';
import { useUser } from '@/store';
import { TENANT_MODE_TEXT_MAP } from '@/enums';
const { t } = useI18n();
const route = useRoute();
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard-front/src/views/basic-info/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<div class="detail-item-content-item">
<div class="label">{{ `${t('租户模式')}:` }}</div>
<div class="value">
<span>{{ basicInfoData.tenant_mode || '是' }}</span>
<span>{{ TENANT_MODE_TEXT_MAP[basicInfoData.tenant_mode] || '是' }}</span>
</div>
</div>
<div class="detail-item-content-item">
Expand Down Expand Up @@ -320,6 +320,7 @@ import { getGateWaysInfo, toggleGateWaysStatus, deleteGateWays, editGateWays } f
import GateWaysEditTextarea from '@/components/gateways-edit/textarea.vue';
import GateWaysEditMemberSelector from '@/components/gateways-edit/member-selector.vue';
import MemberSelect from '@/components/member-select';
import { TENANT_MODE_TEXT_MAP } from '@/enums';
const { t } = useI18n();
const route = useRoute();
Expand Down
3 changes: 2 additions & 1 deletion src/dashboard-front/src/views/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</div>
<template v-if="user.featureFlags?.ENABLE_MULTI_TENANT_MODE">
<div class="flex-1 of1">
{{ item.tenant_mode || '是' }}
{{ TENANT_MODE_TEXT_MAP[item.tenant_mode as string] || '是' }}
</div>
<div class="flex-1 of1">{{ item.tenant_id || '--' }}</div>
</template>
Expand Down Expand Up @@ -262,6 +262,7 @@ import { useRouter } from 'vue-router';
import { useGetApiList/* , useGetGlobalProperties */ } from '@/hooks';
import { is24HoursAgo } from '@/common/util';
import { useCommon } from '@/store';
import { TENANT_MODE_TEXT_MAP } from '@/enums';
import MemberSelect from '@/components/member-select';
// @ts-ignore
import TableEmpty from '@/components/table-empty.vue';
Expand Down

0 comments on commit bca5bf1

Please sign in to comment.