feat: redesign admin panel with cyberpunk UI theme

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-11 13:27:42 +08:00
parent 78b85c0d83
commit 46728e12f7
5 changed files with 551 additions and 108 deletions
+12 -4
View File
@@ -210,6 +210,14 @@ function setStatusBadge(el, online) {
el.classList.toggle("offline", !online);
}
function setStatText(el, value) {
if (!el || el.textContent === value) return;
el.textContent = value;
el.classList.remove("stat-flash");
void el.offsetWidth;
el.classList.add("stat-flash");
}
function updateStats(data) {
const summary = data.summary || {};
const onlineEl = document.getElementById("summaryOnline");
@@ -218,10 +226,10 @@ function updateStats(data) {
const statusEl = document.getElementById("summaryStatus");
if (onlineEl) {
onlineEl.textContent = `${summary.online || 0} / ${summary.total_nodes || 0}`;
setStatText(onlineEl, `${summary.online || 0} / ${summary.total_nodes || 0}`);
}
if (upEl) upEl.textContent = summary.upload_speed_human || "0 B/s";
if (downEl) downEl.textContent = summary.download_speed_human || "0 B/s";
if (upEl) setStatText(upEl, summary.upload_speed_human || "0 B/s");
if (downEl) setStatText(downEl, summary.download_speed_human || "0 B/s");
if (statusEl) {
if (data.singbox) {
statusEl.textContent = "正常";
@@ -241,7 +249,7 @@ function updateStats(data) {
const setText = (role, value) => {
const el = card.querySelector(`[data-role="${role}"]`);
if (el) el.textContent = value;
if (el) setStatText(el, value);
};
setText("connections", String(node.connections ?? 0));