forked from Rockachopa/Timmy-time-dashboard
polish: extract inline CSS, add connection status, panel macro, favicon, ollama cache, toast system (#164)
Major:
- Extract all inline <style> blocks from 22 Jinja2 templates into
static/css/mission-control.css — single cacheable stylesheet
- Add tox lint check that fails on inline <style> in templates
Minor:
1. Connection status indicator in topbar (green/amber/red dot) reflecting
WebSocket + Ollama reachability, with auto-reconnect
2. Jinja2 {% macro panel(title) %} in macros.html — eliminates repeated
.card.mc-panel markup; index.html converted as example
3. SVG favicon (purple T + orange dot)
4. 30-second TTL cache on _check_ollama() to avoid blocking the event loop
on every health poll (asyncio.to_thread was already in place)
5. Toast notification system (McToast.show) for transient status messages —
wired into connection status for Ollama/WebSocket state changes
Enforcement:
- CLAUDE.md updated with conventions 11-14 (no inline CSS, use panel macro,
use toasts, never block the event loop)
- tox lint + pre-push environments now fail on inline <style> blocks
https://claude.ai/code/session_014FQ785MQdyJQ4BAXrRSo9w
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
07f2c1b41e
commit
622a6a9204
@@ -1,4 +1,5 @@
|
||||
{% extends "base.html" %}
|
||||
{% from "macros.html" import panel %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
@@ -9,30 +10,16 @@
|
||||
<div class="col-12 col-md-3 d-flex flex-column gap-3 mc-sidebar">
|
||||
|
||||
<!-- Agents (HTMX-polled from registry) -->
|
||||
<div class="card mc-panel"
|
||||
hx-get="/swarm/agents/sidebar"
|
||||
hx-trigger="every 10s"
|
||||
hx-target="this"
|
||||
hx-swap="innerHTML">
|
||||
<div class="card-header mc-panel-header">// AGENTS</div>
|
||||
<div class="card-body p-3">
|
||||
<div style="font-size:11px; color:var(--text-dim); letter-spacing:.08em;">LOADING...</div>
|
||||
</div>
|
||||
</div>
|
||||
{% call panel("AGENTS", hx_get="/swarm/agents/sidebar", hx_trigger="every 10s") %}
|
||||
<div style="font-size:11px; color:var(--text-dim); letter-spacing:.08em;">LOADING...</div>
|
||||
{% endcall %}
|
||||
|
||||
<!-- System Health (HTMX polled) -->
|
||||
<div class="card mc-panel"
|
||||
hx-get="/health/status"
|
||||
hx-trigger="every 30s"
|
||||
hx-target="this"
|
||||
hx-swap="innerHTML">
|
||||
<div class="card-header mc-panel-header">// SYSTEM HEALTH</div>
|
||||
<div class="card-body p-3">
|
||||
<div class="health-row">
|
||||
<span class="health-label">LOADING...</span>
|
||||
</div>
|
||||
{% call panel("SYSTEM HEALTH", hx_get="/health/status", hx_trigger="every 30s") %}
|
||||
<div class="health-row">
|
||||
<span class="health-label">LOADING...</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endcall %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user