refactor(admin): 配置按域收口到「系统配置」页,Usage 只留用量观测

原本模型配置在「模型」页、计费规则与支付渠道却塞在「分析 > 计费&用量」观测页里(该页
~1290 行,首屏全是表单、真正的用量观测在第四屏)。按「域」重组:

- 新建「系统配置」页,两个 Tab:
  · 模型 = 模型登记/激活/连通性测试 + 计费规则(汇率/硬拦截/按模型定价与权重)
  · 支付 = 支付渠道配置(兑换码/积分包/微信参数) + 订单流水(订单流/对账/人工退款)
  配了什么就在同处看它的规则与数据,不用来回跳。三块直接复用原组件,零重写。
- 「计费 & 用量」瘦成纯用量观测(消耗趋势/租户排行/发放积分)。
- 导航「模型」页并入系统配置(12 页 → 11),侧栏图标换齿轮。
- 顺带修残留 bug:数据源页「前往模型管理」原为 href=#/models + onClick 改 hash,
  既指向已废弃路径、又是 hash 写法(早已换 BrowserRouter,点了不跳),改正规 <Link to=/admin/settings>。

tsc + build + vitest 41 过。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Blizzard
2026-07-20 10:19:32 +08:00
parent d189dd967a
commit c3151d1078
5 changed files with 78 additions and 26 deletions
+6 -9
View File
@@ -1,4 +1,5 @@
import { useEffect, useState } from "react";
import { Link } from "react-router-dom";
import { adminDatasources, listModels, migrateKbStorage, type DatasourceKB, type MigrateKbResult } from "../api";
// 数据源 & RAG:真数据(全平台知识库清单,来自 sundynix_kb/sundynix_doc)。
@@ -71,16 +72,12 @@ export function DatasourcesPage() {
<code className="text-xs font-mono font-medium text-gray-800">{activeEmbedding}</code>
</div>
</div>
<a
href="#/models"
onClick={(e) => {
// 如果使用 hash 路由或 react-router,可正常导航。这里提示用户去模型页配置
window.location.hash = "#/models";
}}
className="text-xs text-violet-600 hover:text-violet-700 font-medium hover:underline flex items-center gap-1"
<Link
to="/admin/settings"
className="flex items-center gap-1 text-xs font-medium text-violet-600 hover:text-violet-700 hover:underline"
>
</a>
</Link>
</div>
{/* 运维工具 (RAG 迁移) */}