feat: 初始化 AI Gateway 项目
实现支持 OpenAI 和 Anthropic 双协议的统一大模型 API 网关 MVP 版本,包含: - OpenAI 和 Anthropic 协议代理 - 供应商和模型管理 - 用量统计 - 前端配置界面
This commit is contained in:
37
frontend/src/App.tsx
Normal file
37
frontend/src/App.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
import { useState } from 'react';
|
||||
import { ProvidersPage } from './pages/ProvidersPage';
|
||||
import { StatsPage } from './pages/StatsPage';
|
||||
import './App.css';
|
||||
|
||||
function App() {
|
||||
const [currentPage, setCurrentPage] = useState<'providers' | 'stats'>('providers');
|
||||
|
||||
return (
|
||||
<div className="app">
|
||||
<nav className="navbar">
|
||||
<h1>AI Gateway</h1>
|
||||
<div className="nav-links">
|
||||
<button
|
||||
className={currentPage === 'providers' ? 'active' : ''}
|
||||
onClick={() => setCurrentPage('providers')}
|
||||
>
|
||||
供应商管理
|
||||
</button>
|
||||
<button
|
||||
className={currentPage === 'stats' ? 'active' : ''}
|
||||
onClick={() => setCurrentPage('stats')}
|
||||
>
|
||||
用量统计
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main className="content">
|
||||
{currentPage === 'providers' && <ProvidersPage />}
|
||||
{currentPage === 'stats' && <StatsPage />}
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user