feat: 将"关于"从系统托盘原生对话框迁移到前端页面
移除系统托盘右键菜单中的"关于"选项及各平台原生对话框实现, 在前端新增 /about 路由和关于页面展示品牌信息,侧边栏增加关于导航入口
This commit is contained in:
@@ -1,6 +1,13 @@
|
||||
import { useState } from 'react'
|
||||
import { Outlet, useLocation, useNavigate } from 'react-router'
|
||||
import { ServerIcon, ChartLineIcon, SettingIcon, ChevronLeftIcon, ChevronRightIcon } from 'tdesign-icons-react'
|
||||
import {
|
||||
ServerIcon,
|
||||
ChartLineIcon,
|
||||
SettingIcon,
|
||||
InfoCircleIcon,
|
||||
ChevronLeftIcon,
|
||||
ChevronRightIcon,
|
||||
} from 'tdesign-icons-react'
|
||||
import { Layout, Menu, Button } from 'tdesign-react'
|
||||
|
||||
const { MenuItem } = Menu
|
||||
@@ -14,6 +21,7 @@ export function AppLayout() {
|
||||
if (location.pathname === '/providers') return '供应商管理'
|
||||
if (location.pathname === '/stats') return '用量统计'
|
||||
if (location.pathname === '/settings') return '设置'
|
||||
if (location.pathname === '/about') return '关于'
|
||||
return 'AI Gateway'
|
||||
}
|
||||
|
||||
@@ -70,6 +78,9 @@ export function AppLayout() {
|
||||
<MenuItem value='/settings' icon={<SettingIcon />}>
|
||||
设置
|
||||
</MenuItem>
|
||||
<MenuItem value='/about' icon={<InfoCircleIcon />}>
|
||||
关于
|
||||
</MenuItem>
|
||||
</Menu>
|
||||
</Layout.Aside>
|
||||
<Layout style={{ marginLeft: asideWidth }}>
|
||||
|
||||
30
frontend/src/pages/About/index.tsx
Normal file
30
frontend/src/pages/About/index.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Card } from 'tdesign-react'
|
||||
|
||||
export default function AboutPage() {
|
||||
return (
|
||||
<Card bordered={false}>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
padding: '4rem 0',
|
||||
}}
|
||||
>
|
||||
<h1 style={{ margin: 0, fontSize: '2rem' }}>Nex</h1>
|
||||
<p style={{ margin: '0.5rem 0 0', color: 'var(--td-text-color-secondary)', fontSize: '1rem' }}>
|
||||
AI Gateway - 统一的大模型 API 网关
|
||||
</p>
|
||||
<a
|
||||
href='https://github.com/nex/gateway'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'
|
||||
style={{ marginTop: '1rem', color: 'var(--td-brand-color)' }}
|
||||
>
|
||||
https://github.com/nex/gateway
|
||||
</a>
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import { AppLayout } from '@/components/AppLayout'
|
||||
const ProvidersPage = lazy(() => import('@/pages/Providers'))
|
||||
const StatsPage = lazy(() => import('@/pages/Stats'))
|
||||
const SettingsPage = lazy(() => import('@/pages/Settings'))
|
||||
const AboutPage = lazy(() => import('@/pages/About'))
|
||||
const NotFound = lazy(() => import('@/pages/NotFound'))
|
||||
|
||||
export function AppRoutes() {
|
||||
@@ -17,6 +18,7 @@ export function AppRoutes() {
|
||||
<Route path='providers' element={<ProvidersPage />} />
|
||||
<Route path='stats' element={<StatsPage />} />
|
||||
<Route path='settings' element={<SettingsPage />} />
|
||||
<Route path='about' element={<AboutPage />} />
|
||||
<Route path='*' element={<NotFound />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
|
||||
Reference in New Issue
Block a user