diff --git a/webui/app.js b/webui/app.js
index 5c52cd1..3e35bf2 100644
--- a/webui/app.js
+++ b/webui/app.js
@@ -1118,6 +1118,63 @@ function notifyApiFail() {
if (_apiFailStreak >= _apiFailThreshold) setConnState("error");
}
+function renderOverviewSparkline(svgId, timeline) {
+ const svg = document.getElementById(svgId);
+ if (!svg) return;
+ // 把 fudai_open_detail + fudai_attend_ok 两个序列合成一条迷你折线
+ const series = (timeline && timeline.series) || {};
+ const keys = ["fudai_open_detail", "fudai_attend_ok"];
+ const arrs = keys.map((k) => Array.isArray(series[k]) ? series[k] : []);
+ const len = Math.max(...arrs.map((a) => a.length), 0);
+ if (len < 2) {
+ svg.innerHTML = "";
+ svg.classList.remove("hasData");
+ return;
+ }
+ const combined = new Array(len).fill(0);
+ for (const arr of arrs) {
+ for (let i = 0; i < arr.length; i++) combined[i] += Number(arr[i]) || 0;
+ }
+ const maxY = Math.max(1, ...combined);
+ // 100x24 viewBox:留 1px 边
+ const W = 100, H = 24, padY = 1.5;
+ const xAt = (i) => (W * i) / (len - 1);
+ const yAt = (v) => H - padY - ((H - padY * 2) * v) / maxY;
+ let d = "";
+ for (let i = 0; i < len; i++) {
+ const x = xAt(i).toFixed(2), y = yAt(combined[i]).toFixed(2);
+ d += (i === 0 ? "M" : " L") + x + " " + y;
+ }
+ // 渐变填充区
+ const dArea = d + ` L ${W} ${H} L 0 ${H} Z`;
+ const NS = "http://www.w3.org/2000/svg";
+ svg.setAttribute("viewBox", `0 0 ${W} ${H}`);
+ svg.innerHTML = "";
+ // gradient defs
+ const defs = document.createElementNS(NS, "defs");
+ const gid = svgId + "Grad";
+ const grad = document.createElementNS(NS, "linearGradient");
+ grad.setAttribute("id", gid);
+ grad.setAttribute("x1", "0"); grad.setAttribute("y1", "0");
+ grad.setAttribute("x2", "0"); grad.setAttribute("y2", "1");
+ grad.innerHTML = `