perf(dashboard): 仪表盘加载提速

- models-dev 快照移出主 bundle(1.35MB→515KB),改为 /models-dev.json 运行时异步加载,就绪后重渲染
- Rust 启动时后台预热价格索引(warm_price_index),首次 get_summary 不再卡
- get_summary 扫描结果 8s TTL 缓存(按 home),切 tab/改范围复用;刷新按钮 refresh=true 强制重扫
This commit is contained in:
KimiSwitch Dev committed 2026-08-01 19:37:20 +08:00
1 parent 9fd22ef55a
commit 1fecb161a9
7 files changed
+64112 -23

No files matched your search

+5 -2
View File
@@ -23,11 +23,14 @@ export function useDashboard() {
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const refresh = useCallback(async () => {
const refresh = useCallback(async (force = false) => {
setLoading(true);
setError(null);
try {
const result = await invoke<SummaryResult>("get_summary", { range });
const result = await invoke<SummaryResult>("get_summary", {
range,
refresh: force,
});
setData(result);
} catch (err) {
const msg = err instanceof Error ? err.message : String(err);