import { useQuery, useQueryClient } from '@tanstack/react-query' import { Card, Row, Col, Statistic, Table, Tag, Button, Typography } from 'antd' import { ReloadOutlined, CloudOutlined } from '@ant-design/icons' import { api } from '@/services/http-client' const { Title, Text } = Typography export default function AiGatewayPage() { const qc = useQueryClient() const { data } = useQuery({ queryKey: ['ai-gateway', 'status'], queryFn: (): Promise => api.get('/admin-api/ai-gateway/status'), staleTime: 30_000 }) const tierCols = [ { title: '级别', dataIndex: 'name', width: 80 }, { title: '主模型', dataIndex: 'provider', width: 120 }, { title: '模型', dataIndex: 'model', width: 180 }, { title: '备用', dataIndex: 'fallback', width: 180, render: (v: string) => v || '-' }, ] const tiers = data?.tiers ? [ { name: 'cheap', ...data.tiers.cheap, fallback: data.tiers.cheap.fallback?.model || '-' }, { name: 'primary', ...data.tiers.primary, fallback: data.tiers.primary.fallback?.model || data.tiers.primary.fallback || '-' }, { name: 'strong', ...data.tiers.strong, fallback: data.tiers.strong.fallback?.model || '-' }, ] : [] return (
<CloudOutlined /> AI Gateway
({ name: p }))} columns={[{ title: '名称', dataIndex: 'name', render: (v: string) => {v} }]} rowKey="name" pagination={false} size="small" />
({ name: p }))} columns={[{ title: '名称', dataIndex: 'name', render: (v: string) => {v} }]} rowKey="name" pagination={false} size="small" /> ) }