Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

Commit 696f232

Browse files
committed
revamp admin dashboard UI/UX — premium command center design
- Redesigned login: glassmorphism card, icon inputs, glow background - Sidebar: brand logo with icon, section labels, status indicator, pill badges - Cards: icon-enriched with colored glow effects, hover animations - Terminal: macOS-style header dots, search with icon, refined toolbar - Cost hero: full-width gradient card with radial glow - Top bar: sticky with live clock - Charts: refined colors, point styles, smoother curves - Tables: cleaner spacing, hover states, empty state styling - Color system: curated palette (green/blue/purple/amber) - Typography: tighter letter-spacing, consistent font weights - Animations: fade-in page transitions, pulse badge, hover elevations
1 parent f86898a commit 696f232

3 files changed

Lines changed: 405 additions & 183 deletions

File tree

‎admin/app.js‎

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ function navigate(page) {
4747
if (el) el.classList.add('active');
4848
const nav = document.querySelector(`[data-page="${page}"]`);
4949
if (nav) nav.classList.add('active');
50+
51+
// Update page title
52+
const titles = { overview:'Overview', logs:'Live Terminal', llm:'LLM & Costs', github:'GitHub Traffic' };
53+
const titleEl = document.getElementById('page-title');
54+
if (titleEl) titleEl.textContent = titles[page] || page;
55+
5056
if (page === 'overview') loadOverview();
5157
if (page === 'llm') loadLLM();
5258
if (page === 'github') loadGitHub();
@@ -396,8 +402,8 @@ function renderHourlyChart(data) {
396402
data: {
397403
labels,
398404
datasets: [
399-
{label:'Requests',data:counts,backgroundColor:'rgba(108,92,231,0.6)',borderRadius:4},
400-
{label:'Errors',data:errors,backgroundColor:'rgba(255,107,107,0.6)',borderRadius:4}
405+
{label:'Requests',data:counts,backgroundColor:'rgba(124,108,240,0.5)',borderColor:'rgba(124,108,240,0.8)',borderWidth:1,borderRadius:6,borderSkipped:false},
406+
{label:'Errors',data:errors,backgroundColor:'rgba(248,113,113,0.5)',borderColor:'rgba(248,113,113,0.8)',borderWidth:1,borderRadius:6,borderSkipped:false}
401407
]
402408
},
403409
options: chartOpts('Hourly Request Volume (24h)')
@@ -417,8 +423,8 @@ function renderDailyLLMChart(data) {
417423
data: {
418424
labels,
419425
datasets: [
420-
{label:'LLM Calls',data:calls,borderColor:'#6c5ce7',backgroundColor:'rgba(108,92,231,0.1)',fill:true,tension:.3},
421-
{label:'Tokens (÷100)',data:tokens.map(t=>Math.round(t/100)),borderColor:'#00cec9',backgroundColor:'rgba(0,206,201,0.1)',fill:true,tension:.3}
426+
{label:'LLM Calls',data:calls,borderColor:'#a78bfa',backgroundColor:'rgba(167,139,250,0.08)',fill:true,tension:.4,pointBackgroundColor:'#a78bfa'},
427+
{label:'Tokens (÷100)',data:tokens.map(t=>Math.round(t/100)),borderColor:'#34d399',backgroundColor:'rgba(52,211,153,0.08)',fill:true,tension:.4,pointBackgroundColor:'#34d399'}
422428
]
423429
},
424430
options: chartOpts('Daily LLM Usage (7d)')
@@ -440,8 +446,8 @@ function renderGitHubChart(views, clones) {
440446
data: {
441447
labels,
442448
datasets: [
443-
{label:'Views',data:viewCounts,borderColor:'#74b9ff',backgroundColor:'rgba(116,185,255,0.1)',fill:true,tension:.3},
444-
{label:'Clones',data:cloneCounts,borderColor:'#00cec9',backgroundColor:'rgba(0,206,201,0.1)',fill:true,tension:.3}
449+
{label:'Views',data:viewCounts,borderColor:'#60a5fa',backgroundColor:'rgba(96,165,250,0.08)',fill:true,tension:.4,pointBackgroundColor:'#60a5fa'},
450+
{label:'Clones',data:cloneCounts,borderColor:'#34d399',backgroundColor:'rgba(52,211,153,0.08)',fill:true,tension:.4,pointBackgroundColor:'#34d399'}
445451
]
446452
},
447453
options: chartOpts('GitHub Traffic (14d)')
@@ -451,11 +457,15 @@ function renderGitHubChart(views, clones) {
451457
function chartOpts(title) {
452458
return {
453459
responsive:true, maintainAspectRatio:false,
454-
plugins:{legend:{labels:{color:'#8888a0',font:{size:11}}},title:{display:true,text:title,color:'#e4e4f0',font:{size:13}}},
460+
plugins:{
461+
legend:{labels:{color:'#7878a0',font:{family:'Inter',size:11},usePointStyle:true,pointStyle:'circle',padding:16}},
462+
title:{display:false}
463+
},
455464
scales:{
456-
x:{ticks:{color:'#8888a0',font:{size:10}},grid:{color:'rgba(42,42,58,0.5)'}},
457-
y:{ticks:{color:'#8888a0',font:{size:10}},grid:{color:'rgba(42,42,58,0.5)'},beginAtZero:true}
458-
}
465+
x:{ticks:{color:'#50506e',font:{family:'Inter',size:10}},grid:{color:'rgba(30,30,58,0.4)',drawBorder:false}},
466+
y:{ticks:{color:'#50506e',font:{family:'Inter',size:10}},grid:{color:'rgba(30,30,58,0.4)',drawBorder:false},beginAtZero:true}
467+
},
468+
elements:{line:{borderWidth:2},point:{radius:3,hoverRadius:5}}
459469
};
460470
}
461471

@@ -478,9 +488,23 @@ function escHtml(s) {
478488
}
479489

480490
// ── Init ─────────────────────────────────────────────────────────
491+
function _updateClock() {
492+
const el = document.getElementById('topbar-clock');
493+
if (!el) return;
494+
const now = new Date();
495+
const h = String(now.getHours()).padStart(2,'0');
496+
const m = String(now.getMinutes()).padStart(2,'0');
497+
const s = String(now.getSeconds()).padStart(2,'0');
498+
el.textContent = `${h}:${m}:${s}`;
499+
}
500+
481501
document.addEventListener('DOMContentLoaded', () => {
482502
token = localStorage.getItem('xmem_admin_token') || '';
483503

504+
// Start clock
505+
_updateClock();
506+
setInterval(_updateClock, 1000);
507+
484508
if (token) {
485509
// Verify token still valid
486510
apiFetch('/server/metrics').then(r => {

0 commit comments

Comments
 (0)