App.tsx
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { BrowserRouter, Routes, Route, Navigate, useNavigate, useLocation } from 'react-router-dom';
import { ConfigProvider, Layout, Menu } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import { AppstoreOutlined, KeyOutlined, SettingOutlined, FileTextOutlined, ThunderboltOutlined, CompassOutlined, SafetyCertificateOutlined, BarChartOutlined } from '@ant-design/icons';
import ProviderList from './pages/Providers/ProviderList';
import AccountList from './pages/Accounts/AccountList';
import StrategyList from './pages/Strategies/StrategyList';
import PromptList from './pages/Prompts/PromptList';
import CallMonitor from './pages/Calls/CallMonitor';
import ModelPlaza from './pages/DebugConsole/ModelPlaza';
import WordBankList from './pages/WordBank/WordBankList';
import StatisticsDashboard from './pages/Statistics/StatisticsDashboard';
import './design-tokens.css';
const { Sider, Content } = Layout;
const menuItems = [
{ key: '/debug', icon: <CompassOutlined />, label: '模型广场' },
{ key: '/providers', icon: <AppstoreOutlined />, label: '供应商管理' },
{ key: '/accounts', icon: <KeyOutlined />, label: '账号配置' },
{ key: '/strategies', icon: <SettingOutlined />, label: '调用策略' },
{ key: '/prompts', icon: <FileTextOutlined />, label: '提示词模板' },
{ key: '/calls', icon: <ThunderboltOutlined />, label: '模型调用' },
{ key: '/word-bank', icon: <SafetyCertificateOutlined />, label: '敏感词库' },
{ key: '/statistics', icon: <BarChartOutlined />, label: '调用统计' },
];
function AppLayout() {
const navigate = useNavigate();
const location = useLocation();
return (
<Layout className="app-layout">
<Sider width={220} className="app-sider">
<div className="sider-header">
<div className="sider-logo">L</div>
<span className="sider-title">LLM 调度平台</span>
</div>
<Menu
mode="inline"
selectedKeys={[location.pathname]}
items={menuItems}
onClick={({ key }) => navigate(key)}
className="sider-menu"
/>
</Sider>
<Content className="app-content">
<div className="app-content-wrap">
<Routes>
<Route path="/providers" element={<ProviderList />} />
<Route path="/accounts" element={<AccountList />} />
<Route path="/strategies" element={<StrategyList />} />
<Route path="/prompts" element={<PromptList />} />
<Route path="/calls" element={<CallMonitor />} />
<Route path="/debug" element={<ModelPlaza />} />
<Route path="/word-bank" element={<WordBankList />} />
<Route path="/statistics" element={<StatisticsDashboard />} />
<Route path="*" element={<Navigate to="/providers" replace />} />
</Routes>
</div>
</Content>
</Layout>
);
}
export default function App() {
return (
<ConfigProvider
locale={zhCN}
theme={{
token: {
colorPrimary: '#6366f1',
borderRadius: 6,
fontFamily: "'Inter', -apple-system, BlinkMacSystemFont, sans-serif",
},
}}
>
<BrowserRouter>
<AppLayout />
</BrowserRouter>
</ConfigProvider>
);
}