feat: show node connection status and traffic stats in admin panel

Enable sing-box Clash/V2Ray APIs for per-user metrics, persist cumulative
traffic in SQLite, and refresh the dashboard every five seconds.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-16 09:57:16 +08:00
parent f0a3317e8b
commit ccf7e2a4c7
12 changed files with 595 additions and 3 deletions
+72
View File
@@ -110,6 +110,76 @@ input[readonly] {
margin-bottom: 12px;
}
.node-head h2 { margin: 0; font-size: 1.1rem; }
.node-title {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.status-badge {
font-size: 0.75rem;
padding: 3px 10px;
border-radius: 999px;
border: 1px solid var(--border);
}
.status-badge.online {
color: #34d399;
border-color: rgba(52, 211, 153, 0.45);
background: rgba(52, 211, 153, 0.12);
}
.status-badge.offline {
color: var(--muted);
background: #111827;
}
.status-text.ok { color: #34d399; }
.status-text.err { color: #f87171; }
.summary-bar {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 12px;
margin-bottom: 24px;
}
.summary-item {
background: var(--card);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 14px 16px;
}
.summary-label {
display: block;
color: var(--muted);
font-size: 0.85rem;
margin-bottom: 6px;
}
.node-stats {
margin-bottom: 16px;
padding: 12px;
border-radius: 10px;
background: rgba(17, 24, 39, 0.55);
border: 1px solid var(--border);
}
.stat-grid {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 10px;
}
.stat-box {
display: flex;
flex-direction: column;
gap: 4px;
}
.stat-label {
color: var(--muted);
font-size: 0.78rem;
}
.stat-value {
font-size: 0.95rem;
font-variant-numeric: tabular-nums;
}
.tag {
font-size: 0.8rem;
color: var(--muted);
@@ -168,4 +238,6 @@ input[readonly] {
@media (max-width: 640px) {
.hero { flex-direction: column; align-items: flex-start; }
.copy-row { grid-template-columns: 1fr; }
.summary-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}