feat: instances on worker

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 949eded4ee
commit 43936e21d9
21 changed files with 589 additions and 184 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ import SmallLogo from '@/assets/images/small-logo-200x200.png';
import React from 'react';
const LogoIcon: React.FC = () => {
return <img src={GpustackLogo} alt="logo" style={{ height: 16 }} />;
return <img src={GpustackLogo} alt="logo" style={{ height: 24 }} />;
};
const SLogoIcon: React.FC = () => {
return <img src={SmallLogo} alt="logo" style={{ height: 24 }} />;
-5
View File
@@ -180,11 +180,6 @@ export default (props: any) => {
showShortcuts: () => {
return showShortcuts();
},
setTheme: setTheme,
toggleTheme: () => {
const newTheme = userSettings.theme === 'realDark' ? 'light' : 'realDark';
setTheme(newTheme);
},
notFound: <span>404 not found</span>
};
+2 -63
View File
@@ -2,20 +2,17 @@
import avatarImg from '@/assets/images/avatar.png';
import IconFont from '@/components/icon-font';
import externalLinks from '@/constants/external-links';
import langConfigMap from '@/locales/lang-config-map';
import {
DiscordOutlined,
GithubOutlined,
HomeOutlined,
InfoCircleOutlined,
LogoutOutlined,
MoonOutlined,
MoreOutlined,
ReadOutlined,
SettingOutlined,
SunOutlined
SettingOutlined
} from '@ant-design/icons';
import { getAllLocales, history, setLocale } from '@umijs/max';
import { getAllLocales, history } from '@umijs/max';
import { Avatar, Menu, Spin } from 'antd';
import _ from 'lodash';
import React from 'react';
@@ -191,64 +188,6 @@ export const getRightRenderContent = (opts: {
]
};
const langMenu = {
selectedKeys: [],
className: collapsed
? 'user-menu-container user-menu-collapsed'
: 'user-menu-container',
mode: 'vertical',
expandIcon: false,
// inlineCollapsed: collapsed,
triggerSubMenuAction: 'hover',
items: [
{
key: 'lang',
icon: <IconFont type="icon-language" />,
label: (
<span className="sub-title">
{intl?.formatMessage?.({ id: 'common.settings.language' })}
</span>
),
children: allLocals.map((key) => ({
key,
label: (
<span className="flex flex-center">
<span>{_.get(langConfigMap, [key, 'label'])}</span>
</span>
),
onClick: () => {
setLocale(key, false);
}
}))
}
]
};
const themeMenu = {
selectedKeys: [],
className: collapsed
? 'user-menu-container user-menu-collapsed'
: 'user-menu-container',
mode: 'vertical',
expandIcon: false,
// inlineCollapsed: collapsed,
triggerSubMenuAction: 'click',
items: [
{
key: 'theme',
icon: isDarkTheme ? <MoonOutlined /> : <SunOutlined />,
label: (
<span className="sub-title">
{intl?.formatMessage?.({ id: 'common.appearance' })}
</span>
),
onClick: () => {
opts.runtimeConfig.toggleTheme();
}
}
]
};
const userMenu = {
selectedKeys: [],
className: collapsed
+1 -1
View File
@@ -17,7 +17,7 @@ interface MenuItem {
interface SiderMenuProps {
menuData: MenuItem[];
collapsed?: boolean;
initialState: Global.InitialState;
initialState: Global.InitialStateType;
}
const useStyles = createStyles(({ css, token }) => {