feat(web): dashboard redesign — Gitea palette, health panels, VM/audit enrichment (stages A–C)
Stage A: swap CSS tokens to the real Gitea dark palette (accent blue #4183c4); add Jinja formatting filters (humanbytes/duration/relative_time/localtime/shorten_path/thousands), a health status-header, and an inline SVG icon sprite; fix two UI bugs — unthemed action pages (htmx swap into #action-slot with a full-page HX-Request fallback) and polling wiping form input (hx-preserve). Stage B: four read-only panels that degrade to notices (never 500) — host resources (/proc, two-sample CPU%), VMware module health, template inventory (.vmem warn + last backup), and a path-contained file browser; backup card becomes a validated template dropdown; expensive dir-size walk is TTL-cached. Adds operations/inventory.py plus host_resources()/vmware_module_health() in operations/host.py. Stage C: parse_clone_name() adds a Job column (job_id + started) to the VM table; nav gains a Gitea link-out derived from the OIDC issuer origin (no fabricated run URLs); audit page gets action icons, relative time, and a client-side filter. Gates: 989 tests pass, coverage 94.12%, ruff + mypy --strict clean. Stage D (service management) intentionally deferred.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<section class="card" id="cache-card" hx-get="/cache" hx-trigger="every 5s" hx-swap="outerHTML">
|
||||
<h2>Cargo cache</h2>
|
||||
<h2><svg class="icon" aria-hidden="true"><use href="#i-file"></use></svg>Cargo cache</h2>
|
||||
{% if cache %}
|
||||
<dl>
|
||||
<dt>Root</dt><dd><code>{{ cache.root }}</code></dd>
|
||||
<dt>Total size</dt><dd>{{ cache.total_bytes }} bytes</dd>
|
||||
<dt>Entries</dt><dd>{{ cache.entry_count }}</dd>
|
||||
<dt>Total size</dt><dd>{{ cache.total_bytes | humanbytes }}</dd>
|
||||
<dt>Entries</dt><dd>{{ cache.entry_count | thousands }}</dd>
|
||||
<dt>Oldest entry age</dt>
|
||||
<dd>{{ cache.oldest_age_days ~ " day(s)" if cache.oldest_age_days is not none else "-" }}</dd>
|
||||
<dt>Retention</dt><dd>{{ cache.retention_days }} day(s)</dd>
|
||||
@@ -12,7 +12,8 @@
|
||||
{% else %}
|
||||
<p class="notice notice-warn" role="alert">Cargo cache status unavailable.</p>
|
||||
{% endif %}
|
||||
<form method="post" action="/cache/purge" id="cache-purge-form" aria-label="Purge cargo cache">
|
||||
<form method="post" action="/cache/purge" id="cache-purge-form" aria-label="Purge cargo cache"
|
||||
hx-post="/cache/purge" hx-target="#action-slot" hx-swap="innerHTML">
|
||||
<input type="hidden" name="csrf" value="{{ csrf_token }}">
|
||||
<button type="submit" class="btn btn-danger" aria-label="Purge cargo cache">Purge cache</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user