@anthonyhan/token-pilot 0.4.1 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/doctor.js +50 -1
- package/package.json +1 -1
- package/web/dashboard.html +16 -10
- package/web/panel.html +146 -11
package/dist/core/doctor.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// 只会觉得「这个月花得少」。
|
|
7
7
|
//
|
|
8
8
|
// 所以 doctor 的核心职责是:把「你以为在读但实际没读到」的地方摊开来说清楚。
|
|
9
|
-
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
9
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
10
10
|
import { CONFIG_DIR, CONFIG_PATH, DATA_PATH, loadConfig } from './config.js';
|
|
11
11
|
import { loadPricing } from './pricing.js';
|
|
12
12
|
import { ALL_ADAPTERS } from './collector.js';
|
|
@@ -27,6 +27,48 @@ function dataAgeMinutes() {
|
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* 检测「brew cask 与 app 自带更新器抢同一个 app」。
|
|
32
|
+
*
|
|
33
|
+
* 判定依据(任一成立即可报警,不要求 brew 命令可用):
|
|
34
|
+
* 1. Homebrew 的 Caskroom 里存在 token-pilot 记录 —— 说明这个 app 曾被 brew 装着;
|
|
35
|
+
* 2. 存在 brew 的软链 Caskroom/<ver>/token-pilot.app 指向 /Applications 下的同名 app。
|
|
36
|
+
*
|
|
37
|
+
* 冲突后果(真实踩过):Tauri updater 原地覆盖 /Applications 里的 app,
|
|
38
|
+
* brew 记录仍停在旧版本号,且 brew 会把这个软链当坏安装修,两个更新器互踩,
|
|
39
|
+
* 用户只看到「检查更新失败」「brew upgrade 不起作用」。
|
|
40
|
+
*
|
|
41
|
+
* 只读检测,不执行 brew 命令(GUI 启动的进程 PATH 里常常没有 brew)。
|
|
42
|
+
*/
|
|
43
|
+
export function detectUpdaterConflict() {
|
|
44
|
+
const caskroom = [
|
|
45
|
+
'/opt/homebrew/Caskroom/token-pilot',
|
|
46
|
+
'/usr/local/Caskroom/token-pilot',
|
|
47
|
+
].find((p) => existsSync(p));
|
|
48
|
+
if (!caskroom)
|
|
49
|
+
return null;
|
|
50
|
+
// 读出 Caskroom 目录里记着的版本(目录名就是 brew 认为的版本)
|
|
51
|
+
let versions = [];
|
|
52
|
+
try {
|
|
53
|
+
versions = readdirSync(caskroom).filter((n) => /^\d+\.\d+/.test(n));
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
/* 读不到就当没记录 */
|
|
57
|
+
}
|
|
58
|
+
const appLink = versions
|
|
59
|
+
.map((v) => path.join(caskroom, v, 'token-pilot.app'))
|
|
60
|
+
.find((p) => existsSync(p));
|
|
61
|
+
const verText = versions.length ? `brew 记录版本 ${versions.join(', ')}` : 'brew 有安装记录';
|
|
62
|
+
return {
|
|
63
|
+
level: 'warn',
|
|
64
|
+
title: '更新通道冲突(brew 与自动更新抢同一个 app)',
|
|
65
|
+
detail: `${caskroom} 存在,说明这个 app 曾被 Homebrew 安装(${verText})。` +
|
|
66
|
+
'app 自带的自动更新会原地覆盖 /Applications 里的程序,而 brew 仍按自己的记录管理,' +
|
|
67
|
+
'两边互踩会导致「检查更新失败」或 brew upgrade 反而装回旧版。',
|
|
68
|
+
fix: '二选一:① 只用自动更新 —— `brew uninstall --cask token-pilot`(app 保留在 /Applications);' +
|
|
69
|
+
'② 只用 brew —— 别点「安装更新」,每次 `brew upgrade --cask token-pilot`',
|
|
70
|
+
};
|
|
71
|
+
}
|
|
30
72
|
export async function runDoctor() {
|
|
31
73
|
const items = [];
|
|
32
74
|
const push = (i) => items.push(i);
|
|
@@ -42,6 +84,13 @@ export async function runDoctor() {
|
|
|
42
84
|
fix: '跑一次 `token-pilot sync` 就会建好',
|
|
43
85
|
});
|
|
44
86
|
}
|
|
87
|
+
// ── 1b. 更新通道冲突:brew cask 与 app 自带更新器抢同一个 app ──
|
|
88
|
+
// 真实踩过:brew 装的 app 被 Tauri updater 原地覆盖成新版本,brew 仍记着
|
|
89
|
+
// 旧版本号;于是 `brew upgrade` 会倒退、而 updater 又被 brew 的软链结构
|
|
90
|
+
// 绊住——两边都更新不动,用户只看到「检查更新失败」。
|
|
91
|
+
const conflict = detectUpdaterConflict();
|
|
92
|
+
if (conflict)
|
|
93
|
+
push(conflict);
|
|
45
94
|
// ── 2. 采集宿主:逐个检测,重点说清「装了但读不到」 ──
|
|
46
95
|
const detected = [];
|
|
47
96
|
const missing = [];
|
package/package.json
CHANGED
package/web/dashboard.html
CHANGED
|
@@ -613,12 +613,12 @@ footer .notes{max-width:560px}
|
|
|
613
613
|
<div id="cmpBody"><div class="cmp-empty">本月暂无明显可压缩的上下文浪费。</div></div>
|
|
614
614
|
</section>
|
|
615
615
|
|
|
616
|
-
<section class="sec acc-violet full-only" data-od-id="quota" style="margin-top:16px">
|
|
616
|
+
<section class="sec acc-violet full-only" data-od-id="quota" id="quotaSection" style="margin-top:16px;display:none">
|
|
617
617
|
<div class="sec-head">
|
|
618
618
|
<h2 class="sec-title"><span class="icon-chip ic-violet"><svg viewBox="0 0 24 24"><path d="M3 12a9 9 0 0 1 9-9"/><path d="M21 12a9 9 0 0 1-9 9"/><path d="M12 7v5l3 3"/></svg></span>订阅额度与余额</h2>
|
|
619
619
|
<span class="sec-note" id="quotaNote">还能用多少 · 与账单互补</span>
|
|
620
620
|
</div>
|
|
621
|
-
<div id="quotaBody"
|
|
621
|
+
<div id="quotaBody"></div>
|
|
622
622
|
</section>
|
|
623
623
|
|
|
624
624
|
<section class="sec acc-blue full-only" data-od-id="adapters" style="margin-top:16px">
|
|
@@ -1280,12 +1280,17 @@ function qPace(w){
|
|
|
1280
1280
|
var QSRC={api:'官方接口',cli:'官方 CLI',computed:'本地计算',manual:'手动登记'};
|
|
1281
1281
|
function renderQuota(){
|
|
1282
1282
|
var box=document.getElementById('quotaBody');
|
|
1283
|
-
|
|
1283
|
+
var sec=document.getElementById('quotaSection');
|
|
1284
|
+
if(!box||!sec)return;
|
|
1284
1285
|
var q=D.quota;
|
|
1286
|
+
// 没有任何可监控平台就整块隐藏——空壳标题比不显示更碍事,
|
|
1287
|
+
// 也没有信息量。面板用同一规则(见 web/panel.html 的 renderQuota)。
|
|
1285
1288
|
if(!q||!q.providers||!q.providers.length){
|
|
1286
|
-
|
|
1289
|
+
sec.style.display='none';
|
|
1290
|
+
box.innerHTML='';
|
|
1287
1291
|
return;
|
|
1288
1292
|
}
|
|
1293
|
+
sec.style.display='';
|
|
1289
1294
|
// 三段:订阅窗口 / Token Plan / 现金余额
|
|
1290
1295
|
var subs=[],plans=[],bals=[];
|
|
1291
1296
|
q.providers.forEach(function(p){
|
|
@@ -1397,14 +1402,15 @@ function renderTok(){
|
|
|
1397
1402
|
}
|
|
1398
1403
|
|
|
1399
1404
|
/* ---------- footer ---------- */
|
|
1400
|
-
/*
|
|
1401
|
-
|
|
1405
|
+
/* 版本号:只显示正在运行的二进制版本(app_version 命令)。
|
|
1406
|
+
数据里的 appVersion 是生成数据的 CLI 版本,两条更新路径节奏不同
|
|
1407
|
+
(npm 装 CLI 常比 app 自动更新快),并列显示会让人误以为出错了。
|
|
1408
|
+
拿不到 app 版本时(浏览器直接打开看板)才退回数据版本。 */
|
|
1402
1409
|
var APP_VER=null;
|
|
1403
1410
|
function verText(){
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
return "";
|
|
1411
|
+
if(APP_VER)return "v"+APP_VER;
|
|
1412
|
+
var data=(D&&D.appVersion)||null;
|
|
1413
|
+
return data?"v"+data:"";
|
|
1408
1414
|
}
|
|
1409
1415
|
if(inTauri()&&window.__TAURI__.core){
|
|
1410
1416
|
try{
|
package/web/panel.html
CHANGED
|
@@ -210,6 +210,30 @@ body.closed .reopen:hover{color:var(--fg)}
|
|
|
210
210
|
.save-amt.warn{color:var(--warn);background:color-mix(in oklab,var(--warn) 12%,var(--tint))}
|
|
211
211
|
.save-amt.info{color:var(--info);background:color-mix(in oklab,var(--info) 13%,var(--tint))}
|
|
212
212
|
|
|
213
|
+
/* 订阅额度与余额:面板宽度有限,每个平台一行,窗口用细进度条 + 百分比。
|
|
214
|
+
与看板保持同一份数据契约(DashboardData.quota),只换更紧凑的表达。 */
|
|
215
|
+
.quota{margin:0 14px 4px}
|
|
216
|
+
.q-prov{padding:7px 0;border-bottom:1px solid var(--gridln)}
|
|
217
|
+
.q-prov:last-child{border-bottom:0}
|
|
218
|
+
.q-head{display:flex;align-items:baseline;gap:6px}
|
|
219
|
+
.q-name{font-weight:700;font-size:12px;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
220
|
+
.q-src{color:var(--muted);font-size:9.5px;font-weight:600;flex:none}
|
|
221
|
+
.q-win{display:flex;align-items:center;gap:7px;margin-top:4px}
|
|
222
|
+
.q-lab{color:var(--muted);font-size:10.5px;flex:none;min-width:52px;max-width:96px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
223
|
+
.q-bar{flex:1;height:5px;border-radius:3px;background:var(--track);overflow:hidden;min-width:36px}
|
|
224
|
+
.q-bar i{display:block;height:100%;border-radius:3px;background:var(--pos)}
|
|
225
|
+
.q-bar i.mid{background:var(--accent)}
|
|
226
|
+
.q-bar i.hot{background:var(--warn)}
|
|
227
|
+
.q-pct{font-size:10.5px;font-weight:700;min-width:34px;text-align:right;flex:none}
|
|
228
|
+
.q-pct.hot{color:var(--warn)}
|
|
229
|
+
.q-abs{color:var(--muted);font-size:9.5px;flex:none}
|
|
230
|
+
.q-bal{display:flex;align-items:baseline;gap:6px;margin-top:4px}
|
|
231
|
+
.q-bal .amt{font-size:14px;font-weight:800}
|
|
232
|
+
.q-bal .amt.low{color:var(--warn)}
|
|
233
|
+
.q-sub{color:var(--muted);font-size:10px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
234
|
+
.q-err{color:var(--muted);font-size:10.5px;margin-top:3px}
|
|
235
|
+
.q-empty{color:var(--muted);font-size:11px;padding:6px 0}
|
|
236
|
+
|
|
213
237
|
.p-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px;padding:10px 14px 12px;border-top:1px solid var(--border)}
|
|
214
238
|
.open-full{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:700;color:var(--info);border:1px solid color-mix(in oklab,var(--info) 30%,var(--tint));border-radius:9px;padding:6px 12px;transition:background .15s var(--ease),border-color .25s var(--ease),color .25s var(--ease)}
|
|
215
239
|
.open-full:hover{background:color-mix(in oklab,var(--info) 10%,var(--tint))}
|
|
@@ -309,6 +333,12 @@ body.closed .reopen:hover{color:var(--fg)}
|
|
|
309
333
|
<div class="live-more num">另有 1 个空闲会话 · 8 分钟前停更</div>
|
|
310
334
|
</div>
|
|
311
335
|
|
|
336
|
+
<div class="sec-t" data-od-id="quota-title" id="quotaTitle" style="display:none">
|
|
337
|
+
<h2><span class="ic" style="--cc:var(--accent-3)"><svg viewBox="0 0 24 24"><path d="M3 12h4l3-7 4 14 3-7h4"/></svg></span>订阅额度与余额</h2>
|
|
338
|
+
<span class="more">还剩多少</span>
|
|
339
|
+
</div>
|
|
340
|
+
<div class="quota num" data-od-id="quota" id="quotaBox" style="display:none"></div>
|
|
341
|
+
|
|
312
342
|
<div class="sec-t" data-od-id="savings-title">
|
|
313
343
|
<h2><span class="ic" style="--cc:var(--info)"><svg viewBox="0 0 24 24"><path d="M9 18h6M10 21h4M12 3a6 6 0 0 1 4 10c-.8.7-1 1.5-1 2.5h-6c0-1-.2-1.8-1-2.5a6 6 0 0 1 4-10z"/></svg></span>省钱建议</h2>
|
|
314
344
|
<span class="more">事后分析 · 不拦截</span>
|
|
@@ -331,6 +361,8 @@ body.closed .reopen:hover{color:var(--fg)}
|
|
|
331
361
|
</div>
|
|
332
362
|
</div>
|
|
333
363
|
|
|
364
|
+
|
|
365
|
+
|
|
334
366
|
</div>
|
|
335
367
|
<footer class="p-foot" data-od-id="panel-foot">
|
|
336
368
|
<a class="open-full" href="http://127.0.0.1:17895/">打开完整看板<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7M9 7h8v8"/></svg></a>
|
|
@@ -349,23 +381,26 @@ body.closed .reopen:hover{color:var(--fg)}
|
|
|
349
381
|
try{if(T){tauriInvoke=(T.core&&T.core.invoke)||T.invoke||null}}catch(e){tauriInvoke=null}
|
|
350
382
|
|
|
351
383
|
/* ===== 版本号 =====
|
|
352
|
-
|
|
384
|
+
只显示「当前运行的程序」版本,来源优先级:
|
|
353
385
|
1. app_version(Tauri 命令):正在跑的二进制版本,权威
|
|
354
|
-
2. __TP_DATA__.appVersion
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
386
|
+
2. __TP_DATA__.appVersion(数据文件):仅在拿不到 1 时兜底
|
|
387
|
+
(浏览器直接打开面板,没有 Tauri 环境)
|
|
388
|
+
3. 都没有就不显示
|
|
389
|
+
刻意不把两者并列。数据文件由 CLI 生成,npm 装 CLI 往往比 app
|
|
390
|
+
自动更新快,两者不一致是常态;并列显示「v0.4.1 · 数据 v0.4.2」
|
|
391
|
+
只会让人以为出了问题。 */
|
|
358
392
|
var APP_VER=null;
|
|
359
393
|
function setVer(){
|
|
360
394
|
var el=document.querySelector(".p-head .ver-badge");
|
|
361
395
|
if(!el)return;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
396
|
+
// 只显示**当前运行的程序**版本。数据文件里的 appVersion 是生成数据的
|
|
397
|
+
// CLI 的版本,两者节奏不同(npm 装 CLI 比 app 自动更新快是常态),
|
|
398
|
+
// 并列成「v0.4.1 · 数据 v0.4.2」会让人以为哪里坏了——那不是错误,
|
|
399
|
+
// 也不是用户需要关心的信息。只有拿不到 app 版本(浏览器打开面板)时,
|
|
400
|
+
// 才退回用数据版本,避免完全不显示。
|
|
401
|
+
var txt=APP_VER?"v"+APP_VER:(D&&D.appVersion?"v"+D.appVersion:"");
|
|
367
402
|
el.textContent=txt;
|
|
368
|
-
el.title=
|
|
403
|
+
el.title="当前版本";
|
|
369
404
|
}
|
|
370
405
|
if(tauriInvoke){
|
|
371
406
|
try{tauriInvoke("app_version").then(function(v){if(v){APP_VER=String(v);setVer()}},function(){})}catch(e){}
|
|
@@ -648,6 +683,105 @@ body.closed .reopen:hover{color:var(--fg)}
|
|
|
648
683
|
}).join("");
|
|
649
684
|
}
|
|
650
685
|
|
|
686
|
+
/* ===== 订阅额度与余额 =====
|
|
687
|
+
面板宽度只有 480,塞不下看板那种「每个窗口一行」的完整表。
|
|
688
|
+
这里每个平台压成一行:显示最紧张的那个窗口,鼠标悬停看全部。
|
|
689
|
+
数据契约与看板完全一致(D.quota.providers),分类口径也一致:
|
|
690
|
+
windows → 订阅额度(会重置)
|
|
691
|
+
tokenPlan → 预付 token 包
|
|
692
|
+
balance → 现金余额
|
|
693
|
+
三者经济含义不同,不能合并算。 */
|
|
694
|
+
var QSRC={api:"官方接口",cli:"官方 CLI",computed:"本地计算",manual:"手动登记"};
|
|
695
|
+
function qResets(iso){
|
|
696
|
+
if(!iso)return "";
|
|
697
|
+
var t=Date.parse(iso);if(isNaN(t))return "";
|
|
698
|
+
var ms=t-Date.now();
|
|
699
|
+
if(ms<=0)return "即将重置";
|
|
700
|
+
var m=Math.floor(ms/60000);
|
|
701
|
+
if(m<60)return m+" 分钟后";
|
|
702
|
+
var h=Math.floor(m/60);
|
|
703
|
+
if(h<24)return h+" 小时后";
|
|
704
|
+
return Math.floor(h/24)+" 天后";
|
|
705
|
+
}
|
|
706
|
+
function qTightest(windows){
|
|
707
|
+
var best=null;
|
|
708
|
+
(windows||[]).forEach(function(w){
|
|
709
|
+
if(!best||(+w.percent||0)>(+best.percent||0))best=w;
|
|
710
|
+
});
|
|
711
|
+
return best;
|
|
712
|
+
}
|
|
713
|
+
function qAll(windows){
|
|
714
|
+
return (windows||[]).map(function(w){
|
|
715
|
+
return w.label+" "+(Math.round((+w.percent||0)*10)/10)+"%"+
|
|
716
|
+
(w.used!=null&&w.total!=null?" ("+w.used+"/"+w.total+")":"")+
|
|
717
|
+
(w.resetsAt?" · "+qResets(w.resetsAt)+"刷新":"");
|
|
718
|
+
}).join("\n");
|
|
719
|
+
}
|
|
720
|
+
function renderQuota(){
|
|
721
|
+
var title=document.getElementById("quotaTitle");
|
|
722
|
+
var box=document.getElementById("quotaBox");
|
|
723
|
+
if(!box||!title)return;
|
|
724
|
+
var q=D&&D.quota;
|
|
725
|
+
var provs=(q&&q.providers)||[];
|
|
726
|
+
if(!provs.length){
|
|
727
|
+
// 与看板同一规则:没有任何可监控平台时整块隐藏。
|
|
728
|
+
// 空标题 +「暂未检测到」只会占位置,用户也做不了什么。
|
|
729
|
+
title.style.display="none";
|
|
730
|
+
box.style.display="none";
|
|
731
|
+
box.innerHTML="";
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
var rows=provs.map(function(p){
|
|
735
|
+
var src='<span class="q-src">'+esc(QSRC[p.source]||p.source||"")+'</span>';
|
|
736
|
+
var head='<div class="q-head"><span class="q-name">'+esc(p.displayName)+'</span>'+src+'</div>';
|
|
737
|
+
|
|
738
|
+
if(!p.ok&&!(p.balance)){
|
|
739
|
+
return '<div class="q-prov">'+head+
|
|
740
|
+
'<div class="q-err">'+esc(p.error||"获取失败")+'</div></div>';
|
|
741
|
+
}
|
|
742
|
+
// 现金余额:直接给数额,低于 20 标红(和看板一致的口径)
|
|
743
|
+
if(p.balance){
|
|
744
|
+
var amt=+p.balance.amount;
|
|
745
|
+
var low=amt<20;
|
|
746
|
+
return '<div class="q-prov">'+head+'<div class="q-bal">'+
|
|
747
|
+
'<span class="amt'+(low?" low":"")+'">'+
|
|
748
|
+
(p.balance.currency==="CNY"?"¥":"$")+amt.toFixed(2)+'</span>'+
|
|
749
|
+
(low?'<span class="q-err" style="margin:0">余额偏低</span>':"")+
|
|
750
|
+
'</div></div>';
|
|
751
|
+
}
|
|
752
|
+
var wins=p.windows||[];
|
|
753
|
+
if(wins.length){
|
|
754
|
+
var t=qTightest(wins);
|
|
755
|
+
var pct=Math.max(0,Math.min(100,+t.percent||0));
|
|
756
|
+
var cls=pct>=90?"hot":(pct>=70?"mid":"");
|
|
757
|
+
var abs=(t.used!=null&&t.total!=null)?'<span class="q-abs">'+t.used+"/"+t.total+'</span>':"";
|
|
758
|
+
var more=wins.length>1?'<span class="q-abs">共 '+wins.length+' 个窗口</span>':"";
|
|
759
|
+
return '<div class="q-prov" title="'+esc(qAll(wins))+'">'+head+
|
|
760
|
+
'<div class="q-win">'+
|
|
761
|
+
'<span class="q-lab" title="'+esc(t.label)+'">最紧张</span>'+
|
|
762
|
+
'<div class="q-bar"><i class="'+cls+'" style="width:'+pct+'%"></i></div>'+
|
|
763
|
+
'<span class="q-pct '+cls+'">'+(Math.round(pct*10)/10)+'%</span>'+
|
|
764
|
+
'</div>'+
|
|
765
|
+
'<div class="q-sub">'+esc(t.label)+
|
|
766
|
+
(abs?" · "+abs:"")+
|
|
767
|
+
(t.resetsAt?" · "+esc(qResets(t.resetsAt))+"后刷新":"")+
|
|
768
|
+
(more?" · "+more:"")+
|
|
769
|
+
'</div>'+
|
|
770
|
+
'</div>';
|
|
771
|
+
}
|
|
772
|
+
var tp=p.tokenPlan;
|
|
773
|
+
if(tp){
|
|
774
|
+
return '<div class="q-prov">'+head+'<div class="q-bal">'+
|
|
775
|
+
'<span class="amt">'+(tp.remainingTokens!=null?fmtTokS(tp.remainingTokens):"—")+'</span>'+
|
|
776
|
+
'<span class="q-abs">剩余 tokens</span></div></div>';
|
|
777
|
+
}
|
|
778
|
+
return '<div class="q-prov">'+head+'<div class="q-err">暂无额度数据</div></div>';
|
|
779
|
+
}).join("");
|
|
780
|
+
title.style.display="";
|
|
781
|
+
box.style.display="";
|
|
782
|
+
box.innerHTML=rows;
|
|
783
|
+
}
|
|
784
|
+
|
|
651
785
|
/* ===== 数据装载:__TP_DATA__ → __TAURI__ → /api/data ===== */
|
|
652
786
|
function renderAll(){
|
|
653
787
|
if(!D)return;
|
|
@@ -661,6 +795,7 @@ body.closed .reopen:hover{color:var(--fg)}
|
|
|
661
795
|
renderTokTrend();
|
|
662
796
|
renderLive();
|
|
663
797
|
renderSavings();
|
|
798
|
+
renderQuota();
|
|
664
799
|
setVer();
|
|
665
800
|
}
|
|
666
801
|
function applyData(d){
|