Spaces:
Paused
Paused
Redesign: iOS 26 Liquid Glass theme
Browse files- public/index.html +231 -90
public/index.html
CHANGED
|
@@ -6,110 +6,250 @@
|
|
| 6 |
<title>Server Dashboard — Hedd</title>
|
| 7 |
<style>
|
| 8 |
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
|
|
| 9 |
body {
|
| 10 |
-
font-family: 'Segoe UI', system-ui,
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
}
|
| 13 |
-
.container { max-width: 960px; margin: 0 auto; padding: 1.5rem 1rem; }
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
.header {
|
| 16 |
-
|
| 17 |
-
margin-bottom: 2rem;
|
|
|
|
|
|
|
|
|
|
| 18 |
}
|
| 19 |
.header h1 {
|
| 20 |
-
font-size:
|
| 21 |
-
|
|
|
|
| 22 |
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
| 23 |
background-clip: text;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
}
|
| 25 |
-
.header-right { display: flex; align-items: center; gap: 0.5rem; }
|
| 26 |
.status-dot {
|
| 27 |
-
width: 8px; height: 8px; background: #
|
| 28 |
animation: pulse 2s infinite;
|
| 29 |
}
|
| 30 |
@keyframes pulse {
|
| 31 |
-
0%,100% { box-shadow: 0 0 0 0 rgba(
|
| 32 |
-
50% { box-shadow: 0 0 0 8px rgba(
|
| 33 |
}
|
| 34 |
-
.status-text { font-size: 0.8rem; color:
|
| 35 |
-
.refresh-info {
|
| 36 |
|
|
|
|
| 37 |
.stats {
|
| 38 |
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 39 |
gap: 1rem; margin-bottom: 2rem;
|
| 40 |
}
|
| 41 |
.stat-card {
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
.
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
.
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
.info-row {
|
| 60 |
display: flex; justify-content: space-between; align-items: center;
|
| 61 |
-
padding: 0.
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
.info-row:last-child { border-bottom: none; }
|
| 64 |
-
.info-key { color:
|
| 65 |
-
.info-val {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
|
|
|
| 67 |
.footer {
|
| 68 |
-
text-align: center; margin-top: 3rem;
|
| 69 |
-
|
| 70 |
}
|
| 71 |
-
.footer a { color:
|
|
|
|
| 72 |
|
|
|
|
| 73 |
@media (max-width: 600px) {
|
| 74 |
-
.
|
| 75 |
.stats { grid-template-columns: 1fr 1fr; }
|
| 76 |
-
.info-row { flex-direction: column; align-items: flex-start; gap: 0.
|
|
|
|
|
|
|
| 77 |
}
|
| 78 |
</style>
|
| 79 |
</head>
|
| 80 |
<body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
<div class="container">
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
<
|
| 87 |
-
|
| 88 |
-
<
|
| 89 |
-
<span class="status-text">Online</span>
|
| 90 |
<span class="refresh-info" id="lastUpdate">...</span>
|
| 91 |
</div>
|
| 92 |
</div>
|
| 93 |
|
|
|
|
| 94 |
<div class="stats">
|
| 95 |
-
<div class="stat-card">
|
| 96 |
<div class="stat-label">CPU Usage</div>
|
| 97 |
<div class="stat-value" id="cpuValue">--%</div>
|
| 98 |
<div class="stat-sub" id="cpuSub">Loading...</div>
|
| 99 |
<div class="progress-bar"><div class="progress-fill fill-green" id="cpuBar" style="width:0%"></div></div>
|
| 100 |
</div>
|
| 101 |
-
<div class="stat-card">
|
| 102 |
<div class="stat-label">Uptime</div>
|
| 103 |
<div class="stat-value" id="uptimeValue">--</div>
|
| 104 |
<div class="stat-sub" id="uptimeSub">Loading...</div>
|
| 105 |
</div>
|
| 106 |
-
<div class="stat-card">
|
| 107 |
<div class="stat-label">RAM Usage</div>
|
| 108 |
<div class="stat-value" id="memValue">-- GB</div>
|
| 109 |
<div class="stat-sub" id="memSub">Loading...</div>
|
| 110 |
<div class="progress-bar"><div class="progress-fill fill-green" id="memBar" style="width:0%"></div></div>
|
| 111 |
</div>
|
| 112 |
-
<div class="stat-card">
|
| 113 |
<div class="stat-label">Disk Usage</div>
|
| 114 |
<div class="stat-value" id="diskValue">-- GB</div>
|
| 115 |
<div class="stat-sub" id="diskSub">Loading...</div>
|
|
@@ -117,68 +257,70 @@
|
|
| 117 |
</div>
|
| 118 |
</div>
|
| 119 |
|
| 120 |
-
<
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
</div>
|
| 130 |
</div>
|
| 131 |
|
|
|
|
| 132 |
<div class="footer">
|
| 133 |
-
|
| 134 |
</div>
|
| 135 |
</div>
|
| 136 |
|
| 137 |
<script>
|
| 138 |
function getBarColor(p) { return p < 60 ? 'fill-green' : p < 80 ? 'fill-yellow' : 'fill-red'; }
|
| 139 |
|
| 140 |
-
function update(
|
| 141 |
-
const hn = (
|
| 142 |
-
document.getElementById('
|
| 143 |
|
| 144 |
-
const c =
|
| 145 |
document.getElementById('cpuValue').textContent = c.usage !== undefined ? c.usage + '%' : 'N/A';
|
| 146 |
-
const
|
| 147 |
document.getElementById('cpuSub').textContent =
|
| 148 |
-
c.cpuCount + '
|
| 149 |
-
(c.loadPercent ? ' · Load
|
| 150 |
-
(
|
| 151 |
const cpuB = document.getElementById('cpuBar');
|
| 152 |
const cpuPct = typeof c.usage === 'number' ? c.usage : 0;
|
| 153 |
cpuB.style.width = cpuPct + '%';
|
| 154 |
cpuB.className = 'progress-fill ' + getBarColor(cpuPct);
|
| 155 |
|
| 156 |
-
document.getElementById('uptimeValue').textContent =
|
| 157 |
-
document.getElementById('uptimeSub').textContent =
|
| 158 |
|
| 159 |
-
const m =
|
| 160 |
document.getElementById('memValue').textContent = m.used + ' GB';
|
| 161 |
document.getElementById('memSub').textContent = m.available + ' GB avail / ' + m.total + ' GB';
|
| 162 |
const memB = document.getElementById('memBar');
|
| 163 |
-
|
| 164 |
-
memB.
|
|
|
|
| 165 |
|
| 166 |
-
const
|
| 167 |
-
document.getElementById('diskValue').textContent =
|
| 168 |
-
document.getElementById('diskSub').textContent =
|
| 169 |
const diskB = document.getElementById('diskBar');
|
| 170 |
-
|
| 171 |
-
diskB.
|
|
|
|
| 172 |
|
| 173 |
-
document.getElementById('infoHostname').textContent =
|
| 174 |
-
document.getElementById('infoOS').textContent =
|
| 175 |
-
document.getElementById('infoKernel').textContent = (
|
| 176 |
-
document.getElementById('infoProcs').textContent =
|
| 177 |
-
document.getElementById('infoNode').textContent =
|
| 178 |
|
| 179 |
-
const t = new Date(
|
| 180 |
-
document.getElementById('infoTime').textContent =
|
| 181 |
-
document.getElementById('lastUpdate').textContent = 'Updated
|
| 182 |
}
|
| 183 |
|
| 184 |
async function fetchStats() {
|
|
@@ -187,9 +329,8 @@
|
|
| 187 |
if (!res.ok) throw new Error('HTTP ' + res.status);
|
| 188 |
const data = await res.json();
|
| 189 |
update(data);
|
| 190 |
-
} catch (
|
| 191 |
-
document.getElementById('lastUpdate').textContent = '
|
| 192 |
-
console.error(err);
|
| 193 |
}
|
| 194 |
}
|
| 195 |
|
|
|
|
| 6 |
<title>Server Dashboard — Hedd</title>
|
| 7 |
<style>
|
| 8 |
* { margin: 0; padding: 0; box-sizing: border-box; }
|
| 9 |
+
|
| 10 |
body {
|
| 11 |
+
font-family: -apple-system, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
|
| 12 |
+
min-height: 100vh;
|
| 13 |
+
background: #0a0a1a;
|
| 14 |
+
color: #fff;
|
| 15 |
+
overflow-x: hidden;
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
/* Animated gradient background */
|
| 19 |
+
.bg-gradient {
|
| 20 |
+
position: fixed; inset: 0; z-index: 0;
|
| 21 |
+
background:
|
| 22 |
+
radial-gradient(ellipse at 20% 50%, rgba(88, 60, 209, 0.35) 0%, transparent 60%),
|
| 23 |
+
radial-gradient(ellipse at 80% 20%, rgba(0, 180, 216, 0.25) 0%, transparent 50%),
|
| 24 |
+
radial-gradient(ellipse at 60% 80%, rgba(211, 47, 142, 0.2) 0%, transparent 50%),
|
| 25 |
+
radial-gradient(ellipse at 30% 80%, rgba(0, 150, 136, 0.15) 0%, transparent 50%),
|
| 26 |
+
#0a0a1a;
|
| 27 |
+
animation: bgShift 20s ease-in-out infinite alternate;
|
| 28 |
+
}
|
| 29 |
+
@keyframes bgShift {
|
| 30 |
+
0% { filter: hue-rotate(0deg); }
|
| 31 |
+
100% { filter: hue-rotate(40deg); }
|
| 32 |
+
}
|
| 33 |
+
|
| 34 |
+
/* Floating orbs */
|
| 35 |
+
.orb {
|
| 36 |
+
position: fixed; border-radius: 50%;
|
| 37 |
+
filter: blur(80px); opacity: 0.4;
|
| 38 |
+
animation: float 15s ease-in-out infinite alternate;
|
| 39 |
+
z-index: 0;
|
| 40 |
+
}
|
| 41 |
+
.orb-1 { width: 400px; height: 400px; background: #583cd1; top: -10%; left: -5%; animation-delay: 0s; }
|
| 42 |
+
.orb-2 { width: 350px; height: 350px; background: #e84393; bottom: -10%; right: -5%; animation-delay: -5s; }
|
| 43 |
+
.orb-3 { width: 300px; height: 300px; background: #00b4d8; top: 40%; right: 10%; animation-delay: -10s; }
|
| 44 |
+
@keyframes float {
|
| 45 |
+
0% { transform: translate(0, 0) scale(1); }
|
| 46 |
+
33% { transform: translate(30px, -40px) scale(1.05); }
|
| 47 |
+
66% { transform: translate(-20px, 20px) scale(0.95); }
|
| 48 |
+
100% { transform: translate(10px, -10px) scale(1); }
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
.container {
|
| 52 |
+
position: relative; z-index: 1;
|
| 53 |
+
max-width: 960px; margin: 0 auto;
|
| 54 |
+
padding: 2rem 1.25rem 3rem;
|
| 55 |
}
|
|
|
|
| 56 |
|
| 57 |
+
/* ===== LIQUID GLASS ===== */
|
| 58 |
+
.glass {
|
| 59 |
+
background: linear-gradient(
|
| 60 |
+
135deg,
|
| 61 |
+
rgba(255, 255, 255, 0.12) 0%,
|
| 62 |
+
rgba(255, 255, 255, 0.06) 40%,
|
| 63 |
+
rgba(255, 255, 255, 0.04) 60%,
|
| 64 |
+
rgba(255, 255, 255, 0.08) 100%
|
| 65 |
+
);
|
| 66 |
+
backdrop-filter: blur(40px) saturate(180%);
|
| 67 |
+
-webkit-backdrop-filter: blur(40px) saturate(180%);
|
| 68 |
+
border: 1px solid rgba(255, 255, 255, 0.18);
|
| 69 |
+
border-radius: 20px;
|
| 70 |
+
box-shadow:
|
| 71 |
+
0 8px 32px rgba(0, 0, 0, 0.3),
|
| 72 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.15),
|
| 73 |
+
inset 0 -1px 0 rgba(255, 255, 255, 0.05);
|
| 74 |
+
overflow: hidden;
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
/* Glass shimmer overlay */
|
| 78 |
+
.glass::before {
|
| 79 |
+
content: '';
|
| 80 |
+
position: absolute; inset: 0;
|
| 81 |
+
border-radius: 20px;
|
| 82 |
+
background: linear-gradient(
|
| 83 |
+
135deg,
|
| 84 |
+
rgba(255,255,255,0.08) 0%,
|
| 85 |
+
transparent 50%,
|
| 86 |
+
rgba(255,255,255,0.03) 100%
|
| 87 |
+
);
|
| 88 |
+
pointer-events: none;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
/* ===== HEADER ===== */
|
| 92 |
.header {
|
| 93 |
+
text-align: center;
|
| 94 |
+
margin-bottom: 2rem;
|
| 95 |
+
padding: 1.5rem 1rem;
|
| 96 |
+
border-radius: 24px;
|
| 97 |
+
position: relative;
|
| 98 |
}
|
| 99 |
.header h1 {
|
| 100 |
+
font-size: 2rem;
|
| 101 |
+
font-weight: 700;
|
| 102 |
+
background: linear-gradient(135deg, #a78bfa, #60a5fa, #34d399);
|
| 103 |
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
| 104 |
background-clip: text;
|
| 105 |
+
margin-bottom: 0.3rem;
|
| 106 |
+
}
|
| 107 |
+
.header-sub {
|
| 108 |
+
display: flex; align-items: center; justify-content: center; gap: 0.5rem;
|
| 109 |
+
flex-wrap: wrap;
|
| 110 |
}
|
|
|
|
| 111 |
.status-dot {
|
| 112 |
+
width: 8px; height: 8px; background: #34d399; border-radius: 50%;
|
| 113 |
animation: pulse 2s infinite;
|
| 114 |
}
|
| 115 |
@keyframes pulse {
|
| 116 |
+
0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.5); }
|
| 117 |
+
50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
|
| 118 |
}
|
| 119 |
+
.status-text, .refresh-info { font-size: 0.8rem; color: rgba(255,255,255,0.5); }
|
| 120 |
+
.refresh-info { margin-left: 0.5rem; font-variant-numeric: tabular-nums; }
|
| 121 |
|
| 122 |
+
/* ===== STAT CARDS ===== */
|
| 123 |
.stats {
|
| 124 |
display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
| 125 |
gap: 1rem; margin-bottom: 2rem;
|
| 126 |
}
|
| 127 |
.stat-card {
|
| 128 |
+
position: relative; padding: 1.3rem 1.2rem;
|
| 129 |
+
transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
|
| 130 |
+
}
|
| 131 |
+
.stat-card:hover {
|
| 132 |
+
transform: translateY(-2px);
|
| 133 |
+
border-color: rgba(255, 255, 255, 0.3);
|
| 134 |
+
box-shadow:
|
| 135 |
+
0 12px 40px rgba(0, 0, 0, 0.4),
|
| 136 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.2),
|
| 137 |
+
inset 0 -1px 0 rgba(255, 255, 255, 0.05);
|
| 138 |
+
}
|
| 139 |
+
.stat-label {
|
| 140 |
+
font-size: 0.65rem; color: rgba(255,255,255,0.4);
|
| 141 |
+
text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.3rem;
|
| 142 |
+
}
|
| 143 |
+
.stat-value {
|
| 144 |
+
font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums;
|
| 145 |
+
background: linear-gradient(135deg, #fff 30%, rgba(255,255,255,0.7));
|
| 146 |
+
-webkit-background-clip: text; -webkit-text-fill-color: transparent;
|
| 147 |
+
background-clip: text;
|
| 148 |
+
}
|
| 149 |
+
.stat-sub {
|
| 150 |
+
font-size: 0.7rem; color: rgba(255,255,255,0.35);
|
| 151 |
+
margin-top: 0.35rem; line-height: 1.4;
|
| 152 |
+
font-variant-numeric: tabular-nums;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
/* Progress bar — liquid glass style */
|
| 156 |
+
.progress-bar {
|
| 157 |
+
height: 4px; background: rgba(255,255,255,0.08);
|
| 158 |
+
border-radius: 2px; margin-top: 0.6rem; overflow: hidden;
|
| 159 |
+
}
|
| 160 |
+
.progress-fill {
|
| 161 |
+
height: 100%; border-radius: 2px;
|
| 162 |
+
transition: width 0.8s ease;
|
| 163 |
+
position: relative;
|
| 164 |
+
}
|
| 165 |
+
.progress-fill::after {
|
| 166 |
+
content: ''; position: absolute;
|
| 167 |
+
top: 0; right: 0; width: 20px; height: 100%;
|
| 168 |
+
background: rgba(255,255,255,0.4);
|
| 169 |
+
filter: blur(4px); border-radius: 2px;
|
| 170 |
+
}
|
| 171 |
+
.fill-green { background: linear-gradient(90deg, #34d399, #059669); }
|
| 172 |
+
.fill-yellow { background: linear-gradient(90deg, #fbbf24, #d97706); }
|
| 173 |
+
.fill-red { background: linear-gradient(90deg, #f87171, #dc2626); }
|
| 174 |
+
|
| 175 |
+
/* ===== INFO TABLE ===== */
|
| 176 |
+
.section-title {
|
| 177 |
+
font-size: 0.85rem; color: rgba(255,255,255,0.5);
|
| 178 |
+
margin-bottom: 0.6rem; padding-left: 0.2rem;
|
| 179 |
+
}
|
| 180 |
+
.info-list {
|
| 181 |
+
position: relative; overflow: hidden;
|
| 182 |
+
}
|
| 183 |
.info-row {
|
| 184 |
display: flex; justify-content: space-between; align-items: center;
|
| 185 |
+
padding: 0.7rem 1.2rem;
|
| 186 |
+
border-bottom: 1px solid rgba(255,255,255,0.06);
|
| 187 |
+
font-size: 0.85rem;
|
| 188 |
}
|
| 189 |
.info-row:last-child { border-bottom: none; }
|
| 190 |
+
.info-key { color: rgba(255,255,255,0.45); }
|
| 191 |
+
.info-val {
|
| 192 |
+
color: rgba(255,255,255,0.85); font-weight: 500;
|
| 193 |
+
text-align: right; font-family: 'SF Mono', 'Fira Code', monospace;
|
| 194 |
+
font-size: 0.78rem;
|
| 195 |
+
}
|
| 196 |
|
| 197 |
+
/* ===== FOOTER ===== */
|
| 198 |
.footer {
|
| 199 |
+
text-align: center; margin-top: 3rem;
|
| 200 |
+
color: rgba(255,255,255,0.2); font-size: 0.7rem;
|
| 201 |
}
|
| 202 |
+
.footer a { color: rgba(167,139,250,0.6); text-decoration: none; }
|
| 203 |
+
.footer a:hover { color: rgba(167,139,250,0.9); }
|
| 204 |
|
| 205 |
+
/* ===== RESPONSIVE ===== */
|
| 206 |
@media (max-width: 600px) {
|
| 207 |
+
.container { padding: 1.25rem 0.75rem 2rem; }
|
| 208 |
.stats { grid-template-columns: 1fr 1fr; }
|
| 209 |
+
.info-row { flex-direction: column; align-items: flex-start; gap: 0.15rem; padding: 0.6rem 1rem; }
|
| 210 |
+
.header h1 { font-size: 1.5rem; }
|
| 211 |
+
.stat-value { font-size: 1.6rem; }
|
| 212 |
}
|
| 213 |
</style>
|
| 214 |
</head>
|
| 215 |
<body>
|
| 216 |
+
<div class="bg-gradient"></div>
|
| 217 |
+
<div class="orb orb-1"></div>
|
| 218 |
+
<div class="orb orb-2"></div>
|
| 219 |
+
<div class="orb orb-3"></div>
|
| 220 |
+
|
| 221 |
<div class="container">
|
| 222 |
+
|
| 223 |
+
<!-- Header -->
|
| 224 |
+
<div class="header glass">
|
| 225 |
+
<h1>⚡ Server Dashboard</h1>
|
| 226 |
+
<div class="header-sub">
|
| 227 |
+
<span class="status-dot"></span>
|
| 228 |
+
<span class="status-text" id="hostnameLabel">Loading...</span>
|
|
|
|
| 229 |
<span class="refresh-info" id="lastUpdate">...</span>
|
| 230 |
</div>
|
| 231 |
</div>
|
| 232 |
|
| 233 |
+
<!-- Stats -->
|
| 234 |
<div class="stats">
|
| 235 |
+
<div class="stat-card glass">
|
| 236 |
<div class="stat-label">CPU Usage</div>
|
| 237 |
<div class="stat-value" id="cpuValue">--%</div>
|
| 238 |
<div class="stat-sub" id="cpuSub">Loading...</div>
|
| 239 |
<div class="progress-bar"><div class="progress-fill fill-green" id="cpuBar" style="width:0%"></div></div>
|
| 240 |
</div>
|
| 241 |
+
<div class="stat-card glass">
|
| 242 |
<div class="stat-label">Uptime</div>
|
| 243 |
<div class="stat-value" id="uptimeValue">--</div>
|
| 244 |
<div class="stat-sub" id="uptimeSub">Loading...</div>
|
| 245 |
</div>
|
| 246 |
+
<div class="stat-card glass">
|
| 247 |
<div class="stat-label">RAM Usage</div>
|
| 248 |
<div class="stat-value" id="memValue">-- GB</div>
|
| 249 |
<div class="stat-sub" id="memSub">Loading...</div>
|
| 250 |
<div class="progress-bar"><div class="progress-fill fill-green" id="memBar" style="width:0%"></div></div>
|
| 251 |
</div>
|
| 252 |
+
<div class="stat-card glass">
|
| 253 |
<div class="stat-label">Disk Usage</div>
|
| 254 |
<div class="stat-value" id="diskValue">-- GB</div>
|
| 255 |
<div class="stat-sub" id="diskSub">Loading...</div>
|
|
|
|
| 257 |
</div>
|
| 258 |
</div>
|
| 259 |
|
| 260 |
+
<!-- Server Info -->
|
| 261 |
+
<div class="section-title">📋 Server Info</div>
|
| 262 |
+
<div class="info-list glass">
|
| 263 |
+
<div class="info-row"><span class="info-key">Hostname</span><span class="info-val" id="infoHostname">...</span></div>
|
| 264 |
+
<div class="info-row"><span class="info-key">OS</span><span class="info-val" id="infoOS">...</span></div>
|
| 265 |
+
<div class="info-row"><span class="info-key">Kernel</span><span class="info-val" id="infoKernel">...</span></div>
|
| 266 |
+
<div class="info-row"><span class="info-key">Processes</span><span class="info-val" id="infoProcs">...</span></div>
|
| 267 |
+
<div class="info-row"><span class="info-key">Node.js</span><span class="info-val" id="infoNode">...</span></div>
|
| 268 |
+
<div class="info-row"><span class="info-key">Last Update</span><span class="info-val" id="infoTime">...</span></div>
|
|
|
|
| 269 |
</div>
|
| 270 |
|
| 271 |
+
<!-- Footer -->
|
| 272 |
<div class="footer">
|
| 273 |
+
Powered by <a href="https://github.com/openclaw/openclaw" target="_blank">OpenClaw</a> · Dashboard by Hedd
|
| 274 |
</div>
|
| 275 |
</div>
|
| 276 |
|
| 277 |
<script>
|
| 278 |
function getBarColor(p) { return p < 60 ? 'fill-green' : p < 80 ? 'fill-yellow' : 'fill-red'; }
|
| 279 |
|
| 280 |
+
function update(d) {
|
| 281 |
+
const hn = (d.hostname || '').split('-').slice(0, 3).join('-') || 'N/A';
|
| 282 |
+
document.getElementById('hostnameLabel').textContent = hn;
|
| 283 |
|
| 284 |
+
const c = d.cpu || {};
|
| 285 |
document.getElementById('cpuValue').textContent = c.usage !== undefined ? c.usage + '%' : 'N/A';
|
| 286 |
+
const la = Array.isArray(c.loadAvg) ? c.loadAvg.join(' ') : '';
|
| 287 |
document.getElementById('cpuSub').textContent =
|
| 288 |
+
c.cpuCount + ' cores' +
|
| 289 |
+
(c.loadPercent ? ' · Load ' + c.loadPercent + '%' : '') +
|
| 290 |
+
(la ? ' · avg(' + la + ')' : '');
|
| 291 |
const cpuB = document.getElementById('cpuBar');
|
| 292 |
const cpuPct = typeof c.usage === 'number' ? c.usage : 0;
|
| 293 |
cpuB.style.width = cpuPct + '%';
|
| 294 |
cpuB.className = 'progress-fill ' + getBarColor(cpuPct);
|
| 295 |
|
| 296 |
+
document.getElementById('uptimeValue').textContent = d.uptime || '--';
|
| 297 |
+
document.getElementById('uptimeSub').textContent = (d.kernel || '').split('(')[0].trim();
|
| 298 |
|
| 299 |
+
const m = d.mem || {};
|
| 300 |
document.getElementById('memValue').textContent = m.used + ' GB';
|
| 301 |
document.getElementById('memSub').textContent = m.available + ' GB avail / ' + m.total + ' GB';
|
| 302 |
const memB = document.getElementById('memBar');
|
| 303 |
+
const mPct = typeof m.percent === 'number' ? m.percent : 0;
|
| 304 |
+
memB.style.width = mPct + '%';
|
| 305 |
+
memB.className = 'progress-fill ' + getBarColor(mPct);
|
| 306 |
|
| 307 |
+
const dk = d.disk || {};
|
| 308 |
+
document.getElementById('diskValue').textContent = dk.used + ' GB';
|
| 309 |
+
document.getElementById('diskSub').textContent = dk.free + ' GB free / ' + dk.total + ' GB';
|
| 310 |
const diskB = document.getElementById('diskBar');
|
| 311 |
+
const dPct = typeof dk.percent === 'number' ? dk.percent : 0;
|
| 312 |
+
diskB.style.width = dPct + '%';
|
| 313 |
+
diskB.className = 'progress-fill ' + getBarColor(dPct);
|
| 314 |
|
| 315 |
+
document.getElementById('infoHostname').textContent = d.hostname || '—';
|
| 316 |
+
document.getElementById('infoOS').textContent = d.os || '—';
|
| 317 |
+
document.getElementById('infoKernel').textContent = (d.kernel || '').split(' (')[0] || '—';
|
| 318 |
+
document.getElementById('infoProcs').textContent = d.processes || '—';
|
| 319 |
+
document.getElementById('infoNode').textContent = d.node || '—';
|
| 320 |
|
| 321 |
+
const t = new Date(d.timestamp || Date.now()).toLocaleString('id-ID', { timeZone: 'Asia/Jakarta' });
|
| 322 |
+
document.getElementById('infoTime').textContent = t + ' WIB';
|
| 323 |
+
document.getElementById('lastUpdate').textContent = 'Updated ' + t;
|
| 324 |
}
|
| 325 |
|
| 326 |
async function fetchStats() {
|
|
|
|
| 329 |
if (!res.ok) throw new Error('HTTP ' + res.status);
|
| 330 |
const data = await res.json();
|
| 331 |
update(data);
|
| 332 |
+
} catch (e) {
|
| 333 |
+
document.getElementById('lastUpdate').textContent = 'Connection lost';
|
|
|
|
| 334 |
}
|
| 335 |
}
|
| 336 |
|