1
0

feat: 将"关于"从系统托盘原生对话框迁移到前端页面

移除系统托盘右键菜单中的"关于"选项及各平台原生对话框实现,
在前端新增 /about 路由和关于页面展示品牌信息,侧边栏增加关于导航入口
This commit is contained in:
2026-04-24 23:17:22 +08:00
parent b9b487c591
commit 9105a36097
13 changed files with 78 additions and 78 deletions

View File

@@ -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 }}>

View 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>
)
}

View File

@@ -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>