Change look of status page

This commit is contained in:
Peter Stockings
2025-12-23 22:36:44 +11:00
parent c792b0107b
commit a597930fde
2 changed files with 533 additions and 319 deletions

View File

@@ -1,257 +1,315 @@
{% macro donut(label, pct, subtitle, value_text=None) %} {% macro gauge(label, pct, subtitle, value_text=None) %}
{% set p = pct if pct is not none else 0 %} {% set p = pct if pct is not none else 0 %}
{% if p < 0 %}{% set p=0 %}{% endif %} {% if p> 100 %}{% set p = 100 %}{% endif %} {% if p < 0 %}{% set p=0 %}{% endif %} {% if p> 100 %}{% set p = 100 %}{% endif %}
{% if p < 60 %} {% set col="#16a34a" %} {% elif p < 85 %} {% set col="#f59e0b" %} {% else %} {% set col="#ef4444" %} {% if p < 60 %} {% set col="#00ff88" %} {% set status="OK" %} {% elif p < 85 %} {% set col="#ffb86c" %} {% set
{% endif %} {% set r=24 %} {% set stroke=10 %} {% set c=2 * 3.1415926 * r %} {% set dash=(p / 100.0) * c %} {% status="WARN" %} {% else %} {% set col="#ff5555" %} {% set status="CRIT" %} {% endif %} {% set txt=value_text if
set txt=value_text if value_text else (p|round(0) ~ "%" ) %} <div style=" value_text else (p|round(0)|int ~ "%" ) %} <div style="
border:1px solid rgba(0,0,0,.08); border: 2px solid {{ col }};
border-radius: 16px; background: rgba({{ '0, 255, 136' if p < 60 else ('255, 184, 108' if p < 85 else '255, 85, 85') }}, 0.05);
padding: 14px; padding: 16px;
background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.80)); position: relative;
box-shadow: 0 8px 24px rgba(0,0,0,.06); transition: all 0.3s ease;
display:flex; ">
align-items:center; <!-- Status indicator -->
gap: 14px; <div style="
min-height: 92px; position: absolute;
top: 8px;
right: 8px;
font-size: 9px;
font-weight: 700;
letter-spacing: 1px;
color: {{ col }};
padding: 2px 6px;
border: 1px solid {{ col }};
background: rgba({{ '0, 255, 136' if p < 60 else ('255, 184, 108' if p < 85 else '255, 85, 85') }}, 0.1);
"> ">
<svg width="72" height="72" viewBox="0 0 72 72" style="flex: 0 0 auto;"> [{{ status }}]
<defs> </div>
<filter id="softShadow" x="-50%" y="-50%" width="200%" height="200%">
<feDropShadow dx="0" dy="2" stdDeviation="2" flood-opacity="0.18" />
</filter>
</defs>
<!-- track --> <!-- Label -->
<circle cx="36" cy="36" r="{{ r }}" fill="none" stroke="rgba(0,0,0,.08)" stroke-width="{{ stroke }}" <div style="
stroke-linecap="round" /> font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
color: #8b949e;
text-transform: uppercase;
margin-bottom: 8px;
">
> {{ label }}
</div>
<!-- progress --> <!-- Value -->
<circle cx="36" cy="36" r="{{ r }}" fill="none" stroke="{{ col }}" stroke-width="{{ stroke }}" <div style="
stroke-linecap="round" stroke-dasharray="{{ dash }} {{ c - dash }}" transform="rotate(-90 36 36)" font-size: 28px;
filter="url(#softShadow)" /> font-weight: 700;
color: {{ col }};
margin-bottom: 8px;
text-shadow: 0 0 10px rgba({{ '0, 255, 136' if p < 60 else ('255, 184, 108' if p < 85 else '255, 85, 85') }}, 0.5);
">
{{ txt }}
</div>
<!-- center --> <!-- Subtitle -->
<text x="36" y="40" text-anchor="middle" font-size="14" font-weight="800" <div style="
font-family="system-ui, -apple-system, Segoe UI, Roboto" fill="rgba(0,0,0,.82)">{{ txt }}</text> font-size: 11px;
</svg> color: #8b949e;
margin-bottom: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
">
{{ subtitle }}
</div>
<div style="min-width: 0; width: 100%;"> <!-- Progress bar -->
<div style="display:flex; align-items:center; justify-content:space-between; gap: 10px;"> <div style="
<div style="font-weight:800; letter-spacing:-0.2px;">{{ label }}</div> height: 6px;
<div style=" background: #30363d;
font-size:12px; position: relative;
padding: 2px 8px; overflow: hidden;
border-radius: 999px; ">
background: rgba(0,0,0,.04); <div style="
color: rgba(0,0,0,.65); height: 100%;
flex: 0 0 auto;"> width: {{ p }}%;
live background: {{ col }};
</div> box-shadow: 0 0 10px {{ col }};
</div> transition: width 0.5s ease;
"></div>
</div>
<div <!-- ASCII bar representation -->
style="margin-top:4px; font-size:12.5px; color: rgba(0,0,0,.62); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;"> <div style="
{{ subtitle }} font-size: 10px;
</div> color: {{ col }};
margin-top: 8px;
<div font-family: 'JetBrains Mono', monospace;
style="margin-top:10px; height:8px; border-radius:999px; background: rgba(0,0,0,.07); overflow:hidden;"> letter-spacing: 0;
<div style="height:100%; width: {{ p }}%; background: {{ col }}; border-radius:999px;"></div> ">
</div> {% set blocks = (p / 5)|round(0)|int %}
{% set empty = 20 - blocks %}
[{% for i in range(blocks) %}█{% endfor %}{% for i in range(empty) %}░{% endfor %}]
</div> </div>
</div> </div>
{% endmacro %} {% endmacro %}
<h2 <h2>[ LIVE METRICS ]</h2>
style="margin-top: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: #1e293b; margin-bottom: 16px;">
📊 Live Usage</h2>
<div <div
style="display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 0 0 32px 0;"> style="display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin: 0 0 32px 0;">
{{ donut("CPU", data.gauges.cpu_total_pct, "Sum of container CPU% (clamped)") }} {{ gauge("CPU", data.gauges.cpu_total_pct, "Sum of container CPU% (clamped)") }}
{{ donut("RAM", data.gauges.ram_pct, "All containers vs host RAM", (data.gauges.ram_used_h ~ " / " ~ {{ gauge("RAM", data.gauges.ram_pct, "All containers vs host RAM", (data.gauges.ram_used_h ~ " / " ~
data.gauges.ram_total_h)) }} data.gauges.ram_total_h)) }}
{{ donut("Docker disk", data.gauges.docker_images_pct, "Images used vs total store") }} {{ gauge("DOCKER_DISK", data.gauges.docker_images_pct, "Images used vs total store") }}
</div> </div>
<h2 style="font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: #1e293b; margin-bottom: 16px;">💻 <h2>[ SYSTEM INFO ]</h2>
System</h2>
<div <div
style="display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 0 0 32px 0;"> style="display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin: 0 0 32px 0;">
<div style=" <div style="
border: 1px solid rgba(102, 126, 234, 0.15); border: 2px solid #30363d;
border-radius: 16px; background: rgba(0, 217, 255, 0.02);
padding: 20px; padding: 20px;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%); transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); " onmouseover="this.style.borderColor='#00d9ff'; this.style.boxShadow='0 0 20px rgba(0, 217, 255, 0.3)';"
transition: all 0.3s ease; onmouseout="this.style.borderColor='#30363d'; this.style.boxShadow='none';">
" onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 20px rgba(0,0,0,0.08)';" <div style="
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 4px 12px rgba(0,0,0,0.04)';"> color: #00d9ff;
<div font-size: 10px;
style="color: #64748b; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;"> font-weight: 700;
🖥️ Host</div> letter-spacing: 2px;
<div style="font-size: 18px; font-weight: 800; color: #1e293b; margin-bottom: 6px;">{{ data.system.name text-transform: uppercase;
or "—" }}</div> margin-bottom: 12px;
<div style="color: #64748b; font-size: 13px; line-height: 1.5;">{{ data.system.operating_system }} · {{ ">
data.system.kernel_version }}</div> [HOST]
</div>
<div style="font-size: 18px; font-weight: 700; color: #c9d1d9; margin-bottom: 8px;">
{{ data.system.name or "—" }}
</div>
<div style="color: #8b949e; font-size: 12px; line-height: 1.6;">
{{ data.system.operating_system }}<br>
Kernel: {{ data.system.kernel_version }}
</div>
</div> </div>
<div style=" <div style="
border: 1px solid rgba(102, 126, 234, 0.15); border: 2px solid #30363d;
border-radius: 16px; background: rgba(0, 255, 136, 0.02);
padding: 20px; padding: 20px;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%); transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); " onmouseover="this.style.borderColor='#00ff88'; this.style.boxShadow='0 0 20px rgba(0, 255, 136, 0.3)';"
transition: all 0.3s ease; onmouseout="this.style.borderColor='#30363d'; this.style.boxShadow='none';">
" onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 20px rgba(0,0,0,0.08)';" <div style="
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 4px 12px rgba(0,0,0,0.04)';"> color: #00ff88;
<div font-size: 10px;
style="color: #64748b; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;"> font-weight: 700;
⚡ Compute</div> letter-spacing: 2px;
<div style="font-size: 15px; font-weight: 600; color: #334155; margin-bottom: 4px;"><strong text-transform: uppercase;
style="color: #667eea; font-size: 18px;">{{ data.system.cpus or "—" }}</strong> CPUs</div> margin-bottom: 12px;
<div style="font-size: 15px; font-weight: 600; color: #334155;"><strong ">
style="color: #667eea; font-size: 18px;">{{ data.system.mem_total_h or "—" }}</strong> RAM</div> [COMPUTE]
</div>
<div style="font-size: 14px; font-weight: 600; color: #c9d1d9; margin-bottom: 6px;">
<span style="color: #00ff88; font-size: 20px; font-weight: 700;">{{ data.system.cpus or "—"
}}</span> CPUs
</div>
<div style="font-size: 14px; font-weight: 600; color: #c9d1d9;">
<span style="color: #00ff88; font-size: 20px; font-weight: 700;">{{ data.system.mem_total_h or "—"
}}</span> RAM
</div>
</div> </div>
<div style=" <div style="
border: 1px solid rgba(102, 126, 234, 0.15); border: 2px solid #30363d;
border-radius: 16px; background: rgba(255, 184, 108, 0.02);
padding: 20px; padding: 20px;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%); transition: all 0.3s ease;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); " onmouseover="this.style.borderColor='#ffb86c'; this.style.boxShadow='0 0 20px rgba(255, 184, 108, 0.3)';"
transition: all 0.3s ease; onmouseout="this.style.borderColor='#30363d'; this.style.boxShadow='none';">
" onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 8px 20px rgba(0,0,0,0.08)';" <div style="
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 4px 12px rgba(0,0,0,0.04)';"> color: #ffb86c;
<div font-size: 10px;
style="color: #64748b; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;"> font-weight: 700;
🐳 Docker</div> letter-spacing: 2px;
<div style="font-size: 13px; color: #334155; margin-bottom: 4px; line-height: 1.6;">Engine: <strong text-transform: uppercase;
style="color: #667eea;">{{ data.system.server_version or "—" }}</strong></div> margin-bottom: 12px;
<div style="font-size: 13px; color: #334155; margin-bottom: 4px; line-height: 1.6;">Images: <strong ">
style="color: #667eea;">{{ data.system.images or "—" }}</strong></div> [DOCKER]
<div style="font-size: 13px; color: #334155; line-height: 1.6;">Containers: <strong </div>
style="color: #16a34a;">{{ data.system.containers_running or "—" }}</strong> running / <strong <div style="font-size: 12px; color: #c9d1d9; margin-bottom: 6px; line-height: 1.7;">
style="color: #64748b;">{{ data.system.containers_stopped or "—" }}</strong> stopped</div> Engine: <span style="color: #ffb86c; font-weight: 700;">{{ data.system.server_version or "—"
}}</span>
</div>
<div style="font-size: 12px; color: #c9d1d9; margin-bottom: 6px; line-height: 1.7;">
Images: <span style="color: #ffb86c; font-weight: 700;">{{ data.system.images or "—" }}</span>
</div>
<div style="font-size: 12px; color: #c9d1d9; line-height: 1.7;">
Containers: <span style="color: #00ff88; font-weight: 700;">{{ data.system.containers_running or "—"
}}</span> up / <span style="color: #8b949e; font-weight: 700;">{{ data.system.containers_stopped
or "—" }}</span> down
</div>
</div> </div>
</div> </div>
<h3>DOCKER DISK USAGE</h3>
<h3 style="font-size: 18px; font-weight: 700; letter-spacing: -0.2px; color: #334155; margin: 32px 0 16px 0;">💾 <div style="overflow-x: auto; margin-bottom: 24px;">
Docker Disk Usage</h3> <table>
<div style="overflow-x: auto; border-radius: 12px; border: 1px solid rgba(0,0,0,0.06);">
<table style="margin: 0;">
<thead> <thead>
<tr> <tr>
<th <th>TYPE</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);"> <th>TOTAL</th>
Type</th> <th>ACTIVE</th>
<th <th>SIZE</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);"> <th>RECLAIMABLE</th>
Total</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Active</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Size</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Reclaimable</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for typ, r in data.system.system_df.items() %} {% for typ, r in data.system.system_df.items() %}
<tr style="transition: background-color 0.2s ease;" <tr>
onmouseover="this.style.backgroundColor='rgba(102, 126, 234, 0.04)';" <td><span style="color: #00d9ff; font-weight: 700;">[{{ typ }}]</span></td>
onmouseout="this.style.backgroundColor='transparent';"> <td>{{ r.total }}</td>
<td><strong style="color: #667eea;">{{ typ }}</strong></td> <td>{{ r.active }}</td>
<td style="color: #334155;">{{ r.total }}</td> <td>{{ r.size }}</td>
<td style="color: #334155;">{{ r.active }}</td> <td>{{ r.reclaimable }}</td>
<td style="color: #334155;">{{ r.size }}</td>
<td style="color: #334155;">{{ r.reclaimable }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div style="margin-top: 16px; color: #64748b; font-size: 13px; font-weight: 500;">⏱️ Generated at: {{ <div style="
data.generated_at }}</div> font-size: 11px;
color: #8b949e;
margin-bottom: 32px;
font-weight: 500;
">
<span style="color: #00d9ff;">[TIMESTAMP]</span> {{ data.generated_at }}
</div>
{% if data.warnings %} {% if data.warnings %}
<div style=" <div style="
margin: 20px 0; margin: 24px 0;
padding: 16px 20px; padding: 16px 20px;
border: 1px solid #fbbf24; border: 2px solid #ffb86c;
background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); background: rgba(255, 184, 108, 0.05);
border-radius: 12px; position: relative;
box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15); ">
"> <div style="
<strong position: absolute;
style="color: #92400e; font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 12px;">⚠️ top: -12px;
Warnings</strong> left: 16px;
<ul style="margin: 0; padding-left: 20px; color: #78350f;"> background: #161b22;
padding: 0 8px;
color: #ffb86c;
font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
">
[!! WARNINGS !!]
</div>
<ul style="margin: 8px 0 0 0; padding-left: 24px; color: #ffb86c;">
{% for w in data.warnings %} {% for w in data.warnings %}
<li style="margin: 6px 0;">{{ w }}</li> <li style="margin: 6px 0; font-size: 13px;">{{ w }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endif %} {% endif %}
<h2 style="font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: #1e293b; margin: 40px 0 16px 0;">🚀 <h2>[ APPLICATIONS ]</h2>
Apps</h2> <div style="overflow-x: auto; margin-bottom: 32px;">
<div style="overflow-x: auto; border-radius: 12px; border: 1px solid rgba(0,0,0,0.06);"> <table>
<table style="margin: 0;">
<thead> <thead>
<tr> <tr>
<th <th>APP</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);"> <th>URL</th>
App</th> <th>STATUS</th>
<th <th>CPU</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);"> <th>RAM</th>
URL</th> <th>RESTARTS</th>
<th <th>IMAGE</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Status</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
CPU</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
RAM</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Restarts</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Image</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for r in data.apps %} {% for r in data.apps %}
<tr style="transition: background-color 0.2s ease;" <tr>
onmouseover="this.style.backgroundColor='rgba(102, 126, 234, 0.04)';" <td><span style="color: #00d9ff; font-weight: 700;">{{ r.app }}</span></td>
onmouseout="this.style.backgroundColor='transparent';"> <td>
<td><strong style="color: #667eea;">{{ r.app }}</strong></td> <a href="{{ r.url }}" style="
<td><a href="{{ r.url }}" color: #00ff88;
style="color: #667eea; text-decoration: none; transition: all 0.2s ease;" text-decoration: none;
onmouseover="this.style.textDecoration='underline'; this.style.color='#764ba2';" transition: all 0.2s ease;
onmouseout="this.style.textDecoration='none'; this.style.color='#667eea';">{{ r.url " onmouseover="this.style.color='#00d9ff'; this.style.textShadow='0 0 10px rgba(0, 217, 255, 0.5)';"
}}</a></td> onmouseout="this.style.color='#00ff88'; this.style.textShadow='none';">
<td><span {{ r.url }}
style="padding: 4px 10px; background: rgba(102, 126, 234, 0.1); color: #667eea; border-radius: 6px; font-size: 12px; font-weight: 600;">{{ </a>
r.status }}</span></td> </td>
<td style="color: #334155; font-weight: 600;">{{ r.cpu or "—" }}</td> <td>
<td style="color: #334155; font-size: 13px;"> <span style="
padding: 3px 8px;
background: rgba(0, 255, 136, 0.1);
color: #00ff88;
border: 1px solid #00ff88;
font-size: 10px;
font-weight: 700;
letter-spacing: 1px;
">
{{ r.status }}
</span>
</td>
<td style="color: #00ff88; font-weight: 600;">{{ r.cpu or "—" }}</td>
<td style="font-size: 12px;">
{% if r.mem_used %} {% if r.mem_used %}
{{ r.mem_used }} / {{ r.mem_limit }} <span style="color: #667eea; font-weight: 600;">({{ {{ r.mem_used }} / {{ r.mem_limit }}
r.mem_pct }})</span> <span style="color: #00d9ff; font-weight: 700;">({{ r.mem_pct }})</span>
{% else %} — {% endif %} {% else %} — {% endif %}
</td> </td>
<td style="color: #334155; font-weight: 600;">{{ r.restarts }}</td> <td style="
<td style="color: #64748b; font-size: 12px;">{{ r.image }}</td> color: {% if r.restarts >= 3 %}#ff5555{% else %}#8b949e{% endif %};
font-weight: 700;
">
{{ r.restarts }}
</td>
<td style="color: #8b949e; font-size: 11px;">{{ r.image }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@@ -259,50 +317,50 @@
</div> </div>
{% if data.infra %} {% if data.infra %}
<h2 style="font-size: 22px; font-weight: 800; letter-spacing: -0.3px; color: #1e293b; margin: 40px 0 16px 0;"> <h2>[ INFRASTRUCTURE ]</h2>
🏗️ Infra</h2> <div style="overflow-x: auto;">
<div style="overflow-x: auto; border-radius: 12px; border: 1px solid rgba(0,0,0,0.06);"> <table>
<table style="margin: 0;">
<thead> <thead>
<tr> <tr>
<th <th>CONTAINER</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);"> <th>STATUS</th>
Container</th> <th>CPU</th>
<th <th>RAM</th>
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);"> <th>RESTARTS</th>
Status</th> <th>IMAGE</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
CPU</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
RAM</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Restarts</th>
<th
style="background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);">
Image</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for r in data.infra %} {% for r in data.infra %}
<tr style="transition: background-color 0.2s ease;" <tr>
onmouseover="this.style.backgroundColor='rgba(102, 126, 234, 0.04)';" <td><span style="color: #ffb86c; font-weight: 700;">{{ r.container }}</span></td>
onmouseout="this.style.backgroundColor='transparent';"> <td>
<td><strong style="color: #667eea;">{{ r.container }}</strong></td> <span style="
<td><span padding: 3px 8px;
style="padding: 4px 10px; background: rgba(102, 126, 234, 0.1); color: #667eea; border-radius: 6px; font-size: 12px; font-weight: 600;">{{ background: rgba(0, 255, 136, 0.1);
r.status }}</span></td> color: #00ff88;
<td style="color: #334155; font-weight: 600;">{{ r.cpu or "—" }}</td> border: 1px solid #00ff88;
<td style="color: #334155; font-size: 13px;"> font-size: 10px;
font-weight: 700;
letter-spacing: 1px;
">
{{ r.status }}
</span>
</td>
<td style="color: #00ff88; font-weight: 600;">{{ r.cpu or "—" }}</td>
<td style="font-size: 12px;">
{% if r.mem_used %} {% if r.mem_used %}
{{ r.mem_used }} / {{ r.mem_limit }} <span style="color: #667eea; font-weight: 600;">({{ {{ r.mem_used }} / {{ r.mem_limit }}
r.mem_pct }})</span> <span style="color: #00d9ff; font-weight: 700;">({{ r.mem_pct }})</span>
{% else %} — {% endif %} {% else %} — {% endif %}
</td> </td>
<td style="color: #334155; font-weight: 600;">{{ r.restarts }}</td> <td style="
<td style="color: #64748b; font-size: 12px;">{{ r.image }}</td> color: {% if r.restarts >= 3 %}#ff5555{% else %}#8b949e{% endif %};
font-weight: 700;
">
{{ r.restarts }}
</td>
<td style="color: #8b949e; font-size: 11px;">{{ r.image }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>

View File

@@ -4,101 +4,230 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Status - peterstockings.com</title> <title>DokkuStatus :: Terminal</title>
<link rel="icon" <link rel="icon"
href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'>📊</text></svg>" /> href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='0.9em' font-size='90'></text></svg>" />
<script src="https://unpkg.com/htmx.org@1.9.10"></script> <script src="https://unpkg.com/htmx.org@1.9.10"></script>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap"
rel="stylesheet">
<style> <style>
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
@keyframes scanline {
0% {
transform: translateY(-100%);
}
100% {
transform: translateY(100vh);
}
}
@keyframes flicker {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.97;
}
}
@keyframes glow {
0%,
100% {
text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}
50% {
text-shadow: 0 0 20px rgba(0, 217, 255, 0.8);
}
}
body { body {
font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
margin: 0; margin: 0;
padding: 0; padding: 0;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); background: #0a0e17;
background-image:
linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
background-size: 50px 50px;
min-height: 100vh; min-height: 100vh;
color: #c9d1d9;
position: relative;
}
/* Scanline effect */
body::before {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100vh;
background: linear-gradient(transparent 50%,
rgba(0, 217, 255, 0.02) 50%);
background-size: 100% 4px;
pointer-events: none;
z-index: 999;
animation: flicker 0.15s infinite;
}
/* Moving scanline */
body::after {
content: '';
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 3px;
background: linear-gradient(transparent, rgba(0, 217, 255, 0.4), transparent);
pointer-events: none;
z-index: 1000;
animation: scanline 8s linear infinite;
} }
.container { .container {
max-width: 1400px; max-width: 1600px;
margin: 0 auto; margin: 0 auto;
padding: 32px 24px; padding: 20px;
position: relative;
z-index: 1;
} }
.header-card { .header-terminal {
background: rgba(255, 255, 255, 0.98); background: #161b22;
backdrop-filter: blur(10px); border: 2px solid #00d9ff;
border-radius: 20px; box-shadow:
padding: 28px 32px; 0 0 20px rgba(0, 217, 255, 0.3),
margin-bottom: 24px; inset 0 0 20px rgba(0, 217, 255, 0.05);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), padding: 20px 24px;
0 0 0 1px rgba(255, 255, 255, 0.3) inset; margin-bottom: 20px;
border: 1px solid rgba(255, 255, 255, 0.5); position: relative;
overflow: hidden;
}
.header-terminal::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 30px;
background: linear-gradient(90deg,
#00d9ff 0%,
#00ff88 50%,
#00d9ff 100%);
opacity: 0.1;
}
.terminal-title {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
}
.terminal-prompt {
color: #00ff88;
font-weight: 700;
font-size: 18px;
animation: glow 2s ease-in-out infinite;
} }
h1 { h1 {
margin: 0 0 8px 0; margin: 0;
font-size: 36px; font-size: 24px;
font-weight: 800; font-weight: 700;
letter-spacing: -0.5px; letter-spacing: 1px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #00d9ff;
-webkit-background-clip: text; text-transform: uppercase;
-webkit-text-fill-color: transparent; display: inline-block;
background-clip: text;
} }
.meta-info { .meta-info {
display: flex; display: flex;
align-items: center; align-items: center;
gap: 12px; gap: 16px;
flex-wrap: wrap; flex-wrap: wrap;
color: #64748b; font-size: 13px;
font-size: 14px; color: #8b949e;
font-weight: 500; font-weight: 500;
} }
.meta-info span {
color: #00ff88;
}
.meta-info .separator {
color: #30363d;
}
.meta-info a { .meta-info a {
color: #667eea; color: #00d9ff;
text-decoration: none; text-decoration: none;
padding: 4px 12px; padding: 4px 10px;
background: rgba(102, 126, 234, 0.1); background: rgba(0, 217, 255, 0.1);
border-radius: 6px; border: 1px solid rgba(0, 217, 255, 0.3);
font-weight: 600;
transition: all 0.2s ease; transition: all 0.2s ease;
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
gap: 6px;
} }
.meta-info a:hover { .meta-info a:hover {
background: rgba(102, 126, 234, 0.2); background: rgba(0, 217, 255, 0.2);
border-color: #00d9ff;
box-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
transform: translateY(-1px); transform: translateY(-1px);
} }
.content-card { .content-terminal {
background: rgba(255, 255, 255, 0.98); background: #161b22;
backdrop-filter: blur(10px); border: 2px solid #30363d;
border-radius: 20px; box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
padding: 32px; padding: 24px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), position: relative;
0 0 0 1px rgba(255, 255, 255, 0.3) inset; }
border: 1px solid rgba(255, 255, 255, 0.5);
.content-terminal::before {
content: '[ STATUS MONITOR ]';
position: absolute;
top: -12px;
left: 20px;
background: #161b22;
padding: 0 10px;
color: #00d9ff;
font-size: 11px;
font-weight: 700;
letter-spacing: 2px;
} }
.loading { .loading {
text-align: center; text-align: center;
padding: 60px 20px; padding: 60px 20px;
color: #64748b; color: #00ff88;
font-size: 16px; font-size: 14px;
font-weight: 500; font-weight: 600;
letter-spacing: 2px;
}
.loading::before {
content: '[ ';
color: #00d9ff;
} }
.loading::after { .loading::after {
content: '...'; content: ' ]';
color: #00d9ff;
animation: dots 1.5s steps(4, end) infinite; animation: dots 1.5s steps(4, end) infinite;
} }
@@ -106,111 +235,138 @@
0%, 0%,
20% { 20% {
content: '.'; content: ' .]';
} }
40% { 40% {
content: '..'; content: ' ..]';
} }
60%, 60%,
100% { 100% {
content: '...'; content: ' ...]';
} }
} }
table { table {
border-collapse: collapse; border-collapse: collapse;
width: 100%; width: 100%;
border: 1px solid #30363d;
} }
th, th,
td { td {
border-bottom: 1px solid rgba(0, 0, 0, 0.06); border: 1px solid #30363d;
padding: 12px; padding: 12px 16px;
vertical-align: top; vertical-align: top;
text-align: left;
} }
th { th {
text-align: left; background: rgba(0, 217, 255, 0.05);
color: #00d9ff;
font-weight: 700; font-weight: 700;
color: #1e293b; font-size: 11px;
font-size: 13px;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 0.5px; letter-spacing: 1px;
background: rgba(102, 126, 234, 0.04);
} }
td { td {
color: #334155; color: #c9d1d9;
font-size: 14px; font-size: 13px;
} }
tbody tr { tbody tr {
transition: background-color 0.2s ease; transition: all 0.2s ease;
background: transparent;
} }
tbody tr:hover { tbody tr:hover {
background: rgba(102, 126, 234, 0.03); background: rgba(0, 217, 255, 0.05);
box-shadow: inset 2px 0 0 #00d9ff;
} }
.muted { .muted {
color: #64748b; color: #8b949e;
font-size: 0.9em; font-size: 0.9em;
} }
.pill {
display: inline-block;
padding: 4px 10px;
border-radius: 999px;
background: rgba(102, 126, 234, 0.1);
color: #667eea;
font-size: 12px;
font-weight: 600;
}
h2 { h2 {
font-size: 22px; font-size: 16px;
font-weight: 800; font-weight: 700;
letter-spacing: -0.3px; letter-spacing: 2px;
color: #1e293b; color: #00d9ff;
margin: 0 0 16px 0; margin: 0 0 16px 0;
text-transform: uppercase;
padding-left: 12px;
border-left: 3px solid #00ff88;
} }
h3 { h3 {
font-size: 18px; font-size: 14px;
font-weight: 700; font-weight: 700;
letter-spacing: -0.2px; letter-spacing: 1px;
color: #334155; color: #8b949e;
margin: 24px 0 12px 0; margin: 24px 0 12px 0;
text-transform: uppercase;
}
h3::before {
content: '> ';
color: #00d9ff;
}
/* Responsive */
@media (max-width: 768px) {
.container {
padding: 12px;
}
h1 {
font-size: 18px;
}
.meta-info {
font-size: 11px;
gap: 8px;
}
} }
</style> </style>
</head> </head>
<body> <body>
<div class="container"> <div class="container">
<div class="header-card"> <div class="header-terminal">
<h1>Status Dashboard</h1> <div class="terminal-title">
<span class="terminal-prompt">root@dokku:~$</span>
<h1>DokkuStatus</h1>
</div>
<div class="meta-info"> <div class="meta-info">
<span>🔄 Auto-refresh every {{ poll_seconds }}s</span> <span>[LIVE]</span>
<span></span> <span class="separator">|</span>
<a href="/api/status">📊 JSON API</a> <span>REFRESH: {{ poll_seconds }}s</span>
<span></span> <span class="separator">|</span>
<a href="/api/status">
<svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
<path d="M2 2h12v2H2V2zm0 3h12v2H2V5zm0 3h12v2H2V8zm0 3h12v2H2v-2z" />
</svg>
JSON_API
</a>
<span class="separator">|</span>
<a href="https://gitea.peterstockings.com/peterstockings/DokkuStatus" target="_blank" <a href="https://gitea.peterstockings.com/peterstockings/DokkuStatus" target="_blank"
rel="noopener noreferrer" style="display: inline-flex; align-items: center; gap: 6px;"> rel="noopener noreferrer">
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" <svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor">
xmlns="http://www.w3.org/2000/svg">
<path <path
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" /> d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" />
</svg> </svg>
Source SOURCE
</a> </a>
</div> </div>
</div> </div>
<div class="content-card"> <div class="content-terminal">
<div hx-get="/partial/apps" hx-trigger="load, every {{ poll_seconds }}s" hx-swap="innerHTML"> <div hx-get="/partial/apps" hx-trigger="load, every {{ poll_seconds }}s" hx-swap="innerHTML">
<div class="loading">Loading status data</div> <div class="loading">INITIALIZING SYSTEM</div>
</div> </div>
</div> </div>
</div> </div>