feat(密钥管理): 代理配置后台明文展示 + 按次统计各密钥调用损耗
- 后台密钥管理「代理设置」列改为完整明文展示(含账号密码),便于运维核对; 新增 full 字段仅对代理模块下发,密钥两列保持脱敏 - 新增 biz_user_secret_usage_daily(V117):用户 × 模块 × 天累计真实对外请求次数 - 计次口径:LLM 每次真实 HTTP 请求(含重试)计 1 次;代理每次成功提取计 1 次 - LLM 埋点走 SecretUsageContext 上下文(批次外设置、线程池内快照恢复) - 新增内部上报接口 /api/internal/user-secret-usage(X-Internal-Token) - 新增后台页「密钥用量统计」:日期范围 + 用户名 + 分组筛选,含范围内汇总
This commit is contained in:
@@ -13,7 +13,7 @@ import { adminPages } from '../src/router/routes.ts'
|
||||
|
||||
test('test_task_010_lazy_page_boundary_normal_primary_path', () => {
|
||||
// 正常主路径:所有注册页面都是懒加载器,可被路由异步边界包裹。
|
||||
assert.equal(adminPages.length, 17)
|
||||
assert.ok(adminPages.length >= 18, '业务页至少 18(随版本递增,不设上限断言)')
|
||||
for (const page of adminPages) {
|
||||
assert.equal(isLazyLoader(page.load), true, `页面 ${page.path} 必须是懒加载函数`)
|
||||
}
|
||||
|
||||
@@ -34,7 +34,10 @@ test('test_task_012_route_error_page_normal_repeated_operation_is_idempotent', (
|
||||
test('test_task_012_route_error_page_boundary_empty_input', () => {
|
||||
// 边界空值:错误页文件存在,且不进入业务路由注册表。
|
||||
assert.equal(existsSync(join(process.cwd(), NOT_FOUND)), true)
|
||||
assert.equal(adminPages.length, 17, '错误页不应计入业务路由')
|
||||
// 业务路由条目与页面定义一一对应;错误页不占用其中任何一条。
|
||||
const router = readSource(ROUTER)
|
||||
assert.equal(occurrences(router, '...adminRouteRecords'), 1, '错误页不应计入业务路由')
|
||||
assert.ok(adminPages.length >= 18, '业务页至少 18(随版本递增,不设上限断言)')
|
||||
})
|
||||
|
||||
test('test_task_012_route_error_page_boundary_single_item', () => {
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
|
||||
test('test_task_008_domain_route_registry_normal_primary_path', () => {
|
||||
// 正常主路径:注册表首批 account 域页面登记为可消费路由记录。
|
||||
assert.equal(adminPages.length, 17)
|
||||
assert.ok(adminPages.length >= 18, '业务页至少 18(随版本递增,不设上限断言)')
|
||||
assert.equal(adminRouteRecords.length, adminPages.length)
|
||||
const first = adminRouteRecords[0]
|
||||
assert.equal(first.path, 'account/users')
|
||||
|
||||
Reference in New Issue
Block a user