diff options
| author | batsumaru <> | 2026-07-01 17:08:29 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-07-01 17:08:29 +0900 |
| commit | 45f7fb33d96350798bfcc16877be152e2fa308bf (patch) | |
| tree | 4fb32c83686fcdb7a4c20c3daa4fbd4c6fe3f657 /statuspage/render.sh | |
| parent | f0c6add973af795f3ed9b069bcdba16fb7f1f66b (diff) | |
Fix uptime to include hours/minutes, add a purple/gold theme
hw.sh's uptime was parsed from `uptime`'s text output, which cut off
at the first comma - dropping the H:MM part entirely. It also never
actually rolled over to months/years for long uptimes (FreeBSD's
uptime just keeps growing the day count). Replaced with a direct
`sysctl kern.boottime` computation for a fully deterministic "Nd Hh
Mm" format. Caught a real bug along the way: the first attempt at the
sed extraction grabbed `usec` instead of `sec`, since "usec" contains
"sec" as a substring and the pattern wasn't anchored tightly enough.
render.sh's palette now uses purple/lavender for headings and borders
and a gold accent (title underline, value-column text), taking cues
from reference character art. The green/yellow/red/gray status
squares are untouched - they carry semantic meaning the color scheme
shouldn't interfere with.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Diffstat (limited to 'statuspage/render.sh')
| -rwxr-xr-x | statuspage/render.sh | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/statuspage/render.sh b/statuspage/render.sh index a7f23c4..301b85d 100755 --- a/statuspage/render.sh +++ b/statuspage/render.sh @@ -120,19 +120,20 @@ END { print "<title>" htmlesc(host) " status</title>" print "<meta http-equiv=\"refresh\" content=\"30\">" print "<style>" - print "body { background:#111; color:#ddd; font-family: monospace; padding: 2em; }" - print "h1 { color: #6ff; margin-bottom: 0; }" - print "h2 { color: #9cf; border-bottom: 1px solid #333; padding-bottom: 4px; }" + print "body { background:#15111d; color:#e4dcee; font-family: monospace; padding: 2em; }" + print "h1 { color: #e0c3ff; margin-bottom: 0; display: inline-block; border-bottom: 2px solid #d9a441; padding-bottom: 6px; }" + print "h2 { color: #c084fc; border-bottom: 1px solid #3a2b4a; padding-bottom: 4px; }" print ".cols { column-width: 380px; column-gap: 2.5em; }" print ".section { break-inside: avoid; -webkit-column-break-inside: avoid; display: inline-block; width: 100%; vertical-align: top; margin-bottom: 1.5em; }" print "table { border-collapse: collapse; width: 100%; }" - print "td { padding: 6px 10px; border-bottom: 1px solid #222; }" + print "td { padding: 6px 10px; border-bottom: 1px solid #241c30; }" print ".sq { display:inline-block; width:12px; height:12px; border-radius:2px; margin-right:6px; vertical-align:middle; }" print ".green { background:#3c3; }" print ".yellow { background:#cc3; }" print ".red { background:#c33; }" print ".gray { background:#666; }" - print ".dim { color:#888; font-size: 0.85em; }" + print ".dim { color:#9c8aad; font-size: 0.85em; }" + print ".val { color:#d9a441; }" print "</style>" print "</head>" print "<body>" @@ -147,7 +148,7 @@ END { print "<h2>" htmlesc(sect) "</h2>" print "<table>" for (j = 1; j <= count[sect]; j++) { - valcell = (V[sect, j] == "") ? "" : "<td>" htmlesc(V[sect, j]) "</td>" + valcell = (V[sect, j] == "") ? "" : "<td class=\"val\">" htmlesc(V[sect, j]) "</td>" print "<tr><td><span class=\"sq " sqclass(S[sect, j]) "\"></span>" htmlesc(L[sect, j]) "</td>" valcell "</tr>" } print "</table>" |
