diff --git a/src/config/menu.tsx b/src/config/menu.tsx
index e011233..226dd6d 100644
--- a/src/config/menu.tsx
+++ b/src/config/menu.tsx
@@ -1,8 +1,9 @@
import type React from 'react'
-import { CodeOutlined, CloudServerOutlined, RobotOutlined, DashboardOutlined, DollarOutlined,
+import { DollarOutlined, CodeOutlined, CloudServerOutlined, RobotOutlined, DashboardOutlined,
UserOutlined,
BookOutlined,
ImportOutlined,
+ DollarOutlined,
SettingOutlined,
FileOutlined,
CloudOutlined,
@@ -32,6 +33,7 @@ export const adminMenuItems: AdminMenuItem[] = [
{ path: '/users/members', name: '普通用户' },
],
},
+ { path: '/membership', name: '会员与额度', icon: , requiredRole: 'ADMIN' },
{
path: '/knowledge',
name: '知识库管理',
diff --git a/src/pages/Billing.tsx b/src/pages/Billing.tsx
deleted file mode 100644
index 6542338..0000000
--- a/src/pages/Billing.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { useState } from 'react'
-import { useQuery, useQueryClient } from '@tanstack/react-query'
-import { Card, Row, Col, Statistic, Button, Tag, Space, Typography, App } from 'antd'
-import { DollarOutlined, ReloadOutlined, LinkOutlined } from '@ant-design/icons'
-import { getBilling, type BillingInfo } from '@/services/billing-api'
-
-const { Text } = Typography
-
-function BillingCard({ p }: { p: BillingInfo }) {
- const color = p.status === 'ok' ? (p.currency === 'CNY' && parseFloat(p.balance) < 10 ? '#faad14' : '#52c41a') : '#999'
- return (
- {p.name}{p.status === 'ok' ? '正常' : '未知'}}
- extra={} href={p.consoleUrl} target="_blank">控制台}
- >
- {p.currency}} />
-
- 模型: {p.model}
-
- {p.note}
-
-
- )
-}
-
-function BillingContent() {
- const qc = useQueryClient()
- const [refreshing, setRefreshing] = useState(false)
-
- const { data } = useQuery({
- queryKey: ['billing'],
- queryFn: getBilling,
- staleTime: 60_000,
- })
-
- const refresh = async () => {
- setRefreshing(true)
- await qc.invalidateQueries({ queryKey: ['billing'] })
- setTimeout(() => setRefreshing(false), 800)
- }
-
- return (
-
-
- API 用量
- } onClick={refresh} loading={refreshing}>刷新
-
-
- {(data?.providers || []).map(p => (
-
-
-
- ))}
-
-
- )
-}
-
-export default function BillingPage() {
- return
-}
diff --git a/src/services/billing-api.ts b/src/services/billing-api.ts
deleted file mode 100644
index f6115a0..0000000
--- a/src/services/billing-api.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { api } from './http-client'
-
-export interface BillingInfo {
- name: string
- model: string
- balance: string
- currency: string
- status: 'ok' | 'unknown'
- consoleUrl: string
- note: string
-}
-
-export function getBilling(): Promise<{ providers: BillingInfo[] }> {
- return api.get('/admin-api/billing')
-}