feat(v0.2): 功能门槛统一为数据源通用的能力标准

- 后端: 数据集→能力映射增广 (daily/adj_factor/minute/financial),
  非 tickflow provider 按声明数据集动态 grant; 数据源偏好更新与
  删除数据源后刷新 app.state.capabilities 快照; 新增 8 项测试
- 前端: 通用界面去档位词, 缺能力统一「{能力名} · 不可用」徽章
  (capability-labels 新增 MissingCapChip, 点击跳设置→数据源);
  StatCard/深度配置/分钟同步/历史扩展/财务页等 20+ 文件对齐;
  实时模式判定改用 quoteStatus.mode 与 realtime_allowed,
  替代前端 tierRank 推断; 监控设置页放开整页拦截
- 档位词仅保留 TickFlow 专属界面 (Key 配置/端点测速/引导页),
  docs/configuration.md 档位表加注解说明
This commit is contained in:
shy3130
2026-08-23 12:34:40 +08:00
parent 0f2c7ce9b0
commit da3ada28e1
25 changed files with 327 additions and 172 deletions
@@ -3,12 +3,12 @@ import { useMutation, useQueryClient } from '@tanstack/react-query'
import { api } from '@/lib/api'
import { QK } from '@/lib/queryKeys'
import { usePreferences, useCapabilities } from '@/lib/useSharedQueries'
import { isExpertOrAbove } from '@/lib/capability-labels'
import { MissingCapChip } from '@/lib/capability-labels'
/**
* 五档盘口 sealed(真假涨停) 配置内容(纯内容, 无外框, 由父级 Card 包裹)。
*
* - 轮询间隔: Pro 10~120s / Expert 3~120s
* - 轮询间隔: 常规 10~120s · 数据源具备实时推送能力时 3~120s
* - 盘后定版时间: 15:01~18:00, 默认 15:02
* - disabled 时(监控关闭)输入框禁用
*/
@@ -19,8 +19,9 @@ export function DepthConfigContent({ disabled }: { disabled?: boolean }) {
const caps = useCapabilities()
const hasDepth = !!caps.data?.capabilities?.['depth5.batch']
const tierLabel = caps.data?.label ?? ''
const range = isExpertOrAbove(tierLabel) ? { lo: 3, hi: 120 } : { lo: 10, hi: 120 }
// 能力判定(非档位): 具备实时推送能力的数据源允许更快的盘口轮询
const fastPolling = !!caps.data?.capabilities?.['websocket']
const range = fastPolling ? { lo: 3, hi: 120 } : { lo: 10, hi: 120 }
const interval = prefs.data?.depth_polling_interval ?? 10
const finalizeTime = prefs.data?.depth_finalize_time ?? { hour: 15, minute: 2 }
@@ -45,13 +46,16 @@ export function DepthConfigContent({ disabled }: { disabled?: boolean }) {
onSuccess: () => qc.invalidateQueries({ queryKey: QK.preferences }),
})
// 无能力: 显示升级提示
// 无能力: 显示能力缺失说明 + 去数据源配置入口
if (!hasDepth) {
return (
<p className="text-xs text-muted leading-relaxed">
, <span className="text-accent">Pro </span>
()()
</p>
<div className="space-y-2">
<p className="text-xs text-muted leading-relaxed">
,
,()()
</p>
<MissingCapChip capKey="depth5.batch" />
</div>
)
}