chore: version info modal

This commit is contained in:
jialin
2024-07-12 12:06:17 +08:00
parent c5327d3e56
commit 320db56fbe
38 changed files with 334 additions and 108 deletions
+28 -8
View File
@@ -1,6 +1,7 @@
// @ts-nocheck
import avatarImg from '@/assets/images/avatar.png';
import externalLinks from '@/config/external-links';
import langConfigMap from '@/locales/lang-config-map';
import {
DiscordOutlined,
@@ -27,6 +28,7 @@ export function getRightRenderContent(opts: {
intl: any;
}) {
const { intl, collapsed, siderWidth } = opts;
const allLocals = getAllLocales();
if (opts.runtimeConfig.rightRender) {
return opts.runtimeConfig.rightRender(
@@ -73,22 +75,25 @@ export function getRightRenderContent(opts: {
key: 'site',
icon: <HomeOutlined />,
label: 'GPUStack',
url: 'https://gpustack.ai/'
url: externalLinks.site
},
{
key: 'github',
icon: <GithubOutlined />,
label: 'GitHub'
label: 'GitHub',
url: externalLinks.github
},
{
key: 'Discord',
icon: <DiscordOutlined />,
label: 'Discord'
label: 'Discord',
url: externalLinks.discord
},
{
key: 'docs',
icon: <ReadOutlined />,
label: intl.formatMessage({ id: 'common.button.docs' })
label: intl.formatMessage({ id: 'common.button.docs' }),
url: externalLinks.documentation
},
{
key: 'version',
@@ -118,11 +123,26 @@ export function getRightRenderContent(opts: {
label: (
<span className="flex flex-center">
{item.icon}
<a className="m-l-8" href="#" target="_blank">
{item.label}
</a>
{item.key === 'version' ? (
<a className="m-l-8">{item.label}</a>
) : (
<a
className="m-l-8"
href={item.url}
target="_blank"
rel="noreferrer"
>
{item.label}
</a>
)}
</span>
)
),
onClick() {
if (item.key === 'version') {
// opts.runtimeConfig.showVersion();
opts.runtimeConfig.showVersion();
}
}
}))
}
]