This commit is contained in:
2026-03-22 19:51:31 +01:00
parent 5dfe3ffa78
commit 75d7464655
3 changed files with 123 additions and 103 deletions
+1 -1
View File
@@ -63,7 +63,7 @@
</article>
{{else}}
<div
style="grid-column: 1 / -1; padding: 4rem; text-align: center; color: var(--muted); border: 1px dashed var(--border-dim);">
style="grid-column: 1 / -1; padding: 4rem; text-align: center; color: var(--muted); border: 1px dashed var(--border);">
No profiles found. Use the CLI to add users.
</div>
{{end}}
+12 -14
View File
@@ -11,15 +11,13 @@ async function renderChart(owner) {
if (!root) return;
try {
const response = await fetch(`${config.api.history}${encodeURIComponent(owner)}`);
if (!response.ok) throw new Error('Network error');
const response = await fetch(`${config.api.history}${encodeURIComponent(owner)}`); if (!response.ok) throw new Error('Network error');
const historyData = await response.json();
if (!historyData || historyData.length === 0) {
root.innerHTML = '<div class="spinner-container"><p class="stat-label">No history available.</p></div>';
root.innerHTML = '<p class="stat-label" style="text-align: center; padding: 2rem; color: var(--muted);">No history available.</p>';
return;
}
const parseUploadValue = (value) => {
if (typeof value !== 'string') return 0;
const num = parseFloat(value.replace(/,/g, '').replace(/TiB|GiB|MiB/i, '').trim());
@@ -33,7 +31,7 @@ async function renderChart(owner) {
const series = [
{
name: 'Upload',
name: 'Upload (TiB)',
data: historyData.map(r => ({ x: new Date(r.timestamp).getTime(), y: parseUploadValue(r.upload) }))
},
{
@@ -59,21 +57,21 @@ async function renderChart(owner) {
height: '100%',
width: '100%',
background: 'transparent',
foreColor: '#888',
foreColor: '#71717a',
fontFamily: 'Inter, system-ui, sans-serif',
toolbar: { show: false },
animations: { enabled: true, easing: 'easeinout', speed: 800 }
},
theme: { mode: 'dark' },
colors: ['#FFFFFF', '#00FF00', '#0066FF', '#FF00FF'],
colors: ['#FFFFFF', '#10b981', '#3b82f6', '#f43f5e'],
stroke: {
curve: 'smooth',
width: [3, 2, 2, 2],
dashArray: 0
},
grid: {
borderColor: '#1a1a1a',
strokeDashArray: 0,
borderColor: '#27272a',
strokeDashArray: 4,
padding: { top: 20, bottom: 0, left: 20, right: 20 },
xaxis: { lines: { show: true } },
yaxis: { lines: { show: true } }
@@ -89,9 +87,9 @@ async function renderChart(owner) {
},
yaxis: [
{
seriesName: 'Upload',
seriesName: 'Upload (TiB)',
labels: {
style: { colors: '#FFF', fontSize: '10px', fontWeight: 700 },
style: { colors: '#FFF', fontSize: '11px', fontWeight: 600 },
formatter: (v) => v != null ? v.toFixed(2) : ''
}
},
@@ -100,7 +98,7 @@ async function renderChart(owner) {
opposite: true,
reversed: true,
labels: {
style: { colors: '#00FF00', fontSize: '10px', fontWeight: 700 },
style: { colors: '#10b981', fontSize: '11px', fontWeight: 600 },
formatter: (v) => v != null ? '#' + Math.round(v) : ''
}
},
@@ -115,9 +113,9 @@ async function renderChart(owner) {
],
legend: {
position: 'bottom',
fontSize: '14px',
fontSize: '12px',
fontWeight: 600,
markers: { width: 10, height: 10, radius: 2 },
markers: { width: 8, height: 8, radius: 10 },
itemMargin: { horizontal: 15, vertical: 10 }
},
tooltip: {
+110 -88
View File
@@ -1,10 +1,13 @@
:root {
--bg: #000000;
--fg: #ffffff;
--border: #ffffff;
--border-dim: #1a1a1a;
--muted: #666666;
--accent: #ffffff;
--bg: #0a0a0b;
--card-bg: #111113;
--fg: #f4f4f5;
--muted: #71717a;
--border: #27272a;
--accent: #10b981;
--accent-dim: rgba(16, 185, 129, 0.1);
--rank-bg: #18181b;
--blue: #3b82f6;
}
* {
@@ -21,14 +24,14 @@ html,
body {
height: 100%;
background-color: var(--bg);
color: var(--fg);
font-family: 'Inter', system-ui, -apple-system, sans-serif;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
overflow: hidden;
}
body {
color: var(--fg);
font-family: 'Inter', system-ui, -apple-system, sans-serif;
line-height: 1.4;
-webkit-font-smoothing: antialiased;
display: flex;
justify-content: center;
}
@@ -36,7 +39,7 @@ body {
.container {
max-width: 1200px;
width: 100%;
padding: 2.5rem;
padding: 2rem;
display: flex;
flex-direction: column;
height: 100vh;
@@ -45,105 +48,125 @@ body {
header {
margin-bottom: 2.5rem;
text-align: center;
border-bottom: 1px solid var(--border-dim);
padding-bottom: 1.5rem;
flex-shrink: 0;
}
h1 {
font-size: 1.5rem;
font-size: 1.75rem;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 0.2em;
letter-spacing: 0.15em;
background: linear-gradient(to right, #fff, #71717a);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
}
.subtitle {
color: var(--muted);
font-size: 0.75rem;
margin-top: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.25em;
font-weight: 600;
}
main {
flex: 1;
overflow-y: auto;
min-height: 0;
padding: 0.5rem 0;
padding: 1rem 0;
}
.grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.25rem;
margin: 0 auto;
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
gap: 1.5rem;
}
.card {
background-color: var(--bg);
border: 1px solid var(--border-dim);
background-color: var(--card-bg);
border: 1px solid var(--border);
border-radius: 12px;
padding: 1.75rem;
display: flex;
flex-direction: column;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.card:hover {
border-color: var(--muted);
background-color: #050505;
border-color: var(--accent);
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 2rem;
align-items: center;
margin-bottom: 1.75rem;
}
.card h3 {
font-size: 1.1rem;
font-weight: 800;
text-transform: uppercase;
letter-spacing: -0.01em;
font-weight: 700;
color: #fff;
}
.rank-badge {
font-family: monospace;
font-family: 'JetBrains Mono', monospace;
font-size: 0.7rem;
color: var(--muted);
background: #111;
padding: 3px 6px;
color: var(--accent);
background: var(--accent-dim);
padding: 4px 10px;
border-radius: 6px;
font-weight: 700;
letter-spacing: 0.05em;
}
.stats-group {
display: grid;
grid-template-columns: 1fr;
gap: 0.75rem;
margin-bottom: 2rem;
gap: 1rem;
margin-bottom: 1.75rem;
}
.stat {
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #111;
padding-bottom: 0.4rem;
padding-bottom: 0.5rem;
border-bottom: 1px solid var(--border);
}
.stat:last-child {
border-bottom: none;
}
.stat-label {
font-size: 0.6rem;
font-size: 0.7rem;
text-transform: uppercase;
letter-spacing: 0.1em;
letter-spacing: 0.05em;
color: var(--muted);
font-weight: 600;
}
.stat-value {
font-size: 0.9rem;
font-weight: 700;
font-family: monospace;
font-size: 0.95rem;
font-weight: 600;
color: #efefef;
}
.btn-view {
margin-top: auto;
background: transparent;
border: 1px solid var(--border-dim);
background: var(--bg);
border: 1px solid var(--border);
color: var(--fg);
padding: 0.75rem;
font-size: 0.7rem;
font-weight: 800;
padding: 0.85rem;
font-size: 0.75rem;
font-weight: 700;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
text-transform: uppercase;
@@ -151,35 +174,38 @@ main {
}
.btn-view:hover {
background: var(--fg);
color: var(--bg);
border-color: var(--fg);
background: var(--accent);
color: #000;
border-color: var(--accent);
}
.modal-overlay {
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.9);
background-color: rgba(0, 0, 0, 0.8);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
backdrop-filter: blur(8px);
backdrop-filter: blur(12px);
}
.modal-panel {
background-color: var(--bg);
border: 1px solid var(--border-dim);
background-color: var(--card-bg);
border: 1px solid var(--border);
width: 90vw;
max-width: 1200px;
height: 80vh;
max-width: 1100px;
height: 75vh;
display: flex;
flex-direction: column;
border-radius: 16px;
overflow: hidden;
}
.modal-header {
padding: 1.25rem 2rem;
border-bottom: 1px solid var(--border-dim);
padding: 1.5rem 2rem;
background: #18181b;
border-bottom: 1px solid var(--border);
display: flex;
justify-content: space-between;
align-items: center;
@@ -187,13 +213,14 @@ main {
}
.modal-header h2 {
font-size: 0.8rem;
font-weight: 900;
letter-spacing: 0.2em;
font-size: 0.85rem;
font-weight: 800;
letter-spacing: 0.15em;
color: var(--muted);
}
.modal-body {
padding: 1.5rem 2rem;
padding: 2rem;
flex: 1;
display: flex;
flex-direction: column;
@@ -203,15 +230,20 @@ main {
}
.close-btn {
background: none;
background: rgba(255, 255, 255, 0.05);
border: none;
color: var(--muted);
cursor: pointer;
padding: 0.5rem;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
}
.close-btn:hover {
color: var(--fg);
color: #fff;
background: rgba(255, 255, 255, 0.1);
}
main::-webkit-scrollbar {
@@ -223,46 +255,36 @@ main::-webkit-scrollbar-track {
}
main::-webkit-scrollbar-thumb {
background: var(--border-dim);
background: var(--border);
border-radius: 10px;
}
.apexcharts-canvas,
.apexcharts-canvas *,
.apexcharts-canvas *:focus {
outline: none !important;
-webkit-tap-highlight-color: transparent;
}
.apexcharts-yaxis-label {
font-weight: 700 !important;
}
.apexcharts-tooltip {
background: #000 !important;
border: 1px solid #333 !important;
color: #fff !important;
border-radius: 0 !important;
box-shadow: none !important;
background: #18181b !important;
border: 1px solid var(--border) !important;
border-radius: 8px !important;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5) !important;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
@media (max-width: 1100px) {
.grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 700px) {}
@media (max-width: 700px) {
.container {
padding: 1.5rem;
}
.grid {
grid-template-columns: 1fr;
}
.container {
padding: 1.5rem;
.modal-panel {
width: 95vw;
height: 90vh;
}
}