docs: annotate all shared frontend modules in Chinese

This commit is contained in:
cieanyau committed 2026-11-06 00:30:15 +08:00
1 parent 2be21c1c62
commit 408f8e5c98
55 files changed
+349

No files matched your search

+3
View File
@@ -1,8 +1,10 @@
/** 财务模块监控数据转为图表百分比;非法或缺测值保留 null,不伪造零使用率。 */
function e(e) {
if (typeof e != `number` && (typeof e != `string` || !e.trim())) return null;
let t = Number(e);
return Number.isFinite(t) ? t : null;
}
/** 已是百分比的曲线直接归一;容量曲线按同一时间戳匹配总量与已用/空闲量后计算。 */
function t(t, n) {
let r = t.list ?? [],
i = t.label ?? [],
@@ -21,6 +23,7 @@ function t(t, n) {
data: e.map((e) => o(e.value)),
};
}
// 不能按数组下标直接相除:不同曲线可能缺点,必须用时间戳对齐。
let c = i.findIndex((e) => /总|total|allocated/i.test(e)),
l = c >= 0 ? c : 0,
u = i.findIndex((e) => /空闲|可用|free|available/i.test(e)),