Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(frontend): 添加产品文档入口 #8572 #8574

Open
wants to merge 1 commit into
base: frontend_dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion dbm-ui/frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
@click="handleShowSystemVersionLog">
{{ t('版本日志') }}
</div>
<div
class="item"
@click="linkToDoc">
{{ t('产品文档') }}
</div>
</template>
</BkPopover>
<BkPopover
Expand Down Expand Up @@ -64,7 +69,7 @@

import { useSQLTaskNotify } from '@hooks';

import { useUserProfile } from '@stores';
import { useSystemEnviron, useUserProfile } from '@stores';

import DbRouterView from '@components/db-router-view/Index.vue';
import LocaleSwitch from '@components/locale-switch/Index.vue';
Expand All @@ -83,6 +88,7 @@
const userProfileStore = useUserProfile();
userProfileStore.fetchProfile();
const { t, locale } = useI18n();
const systemEnvironStore = useSystemEnviron();

const documentTitles: Record<string, string> = {
en: 'DBM | Tencent BlueKing',
Expand Down Expand Up @@ -111,6 +117,13 @@
isShowSystemVersionLog.value = true;
};

const linkToDoc = () => {
const url = systemEnvironStore.urls.BK_HELPER_URL;
if (url) {
window.open(url, '_blank');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_blank 应该可以省去,默认就是新开tab

}
};

const handleSignOut = () => {
InfoBox({
title: t('确认退出登录'),
Expand Down
1 change: 1 addition & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -3714,5 +3714,6 @@
"% 不能单独使用": "% 不能单独使用",
"访问 DB 名必须合法": "访问 DB 名必须合法",
"请输入访问DB名_以字母开头_支持 % 通配符 或 % 单独使用代表ALL_多个使用英文逗号_分号或换行分隔": "请输入访问DB名,以字母开头,支持 % 通配符 或 % 单独使用代表ALL。多个使用英文逗号、分号或换行分隔",
"产品文档": "产品文档",
"这行勿动!新增翻译请在上一行添加!": ""
}