Trackers: section ratio/envoi/réception sous le NAS (c411, extensible)
Nouveau module integrations/trackers.py : pour chaque tracker configuré (env MONITORINK_TRACKERS + bloc par clé), récupère ratio/uploaded/downloaded. Type unit3d_nuxt (c411) : login session (CSRF meta + /api/auth/login) car le ratio n'est pas lisible au token API ; session réutilisée, résultat caché (TTL 30 min). Section dashboard sous le NAS, style instrument 1-bit. Architecture par type pour ajouter d'autres trackers ensuite.
This commit is contained in:
@@ -65,6 +65,14 @@
|
||||
.rows.grid2 .k { font-size: 28px; } .rows.grid2 .v { font-size: 32px; }
|
||||
.ko { display: inline-block; padding: 0 8px; background: var(--ink); color: var(--paper); }
|
||||
|
||||
/* ---- Trackers (ratio + envoi/réception du compte, sous le NAS) ---- */
|
||||
.trk { padding: 13px 0; border-bottom: 2px solid var(--ink); }
|
||||
.trk:last-child { border-bottom: 0; }
|
||||
.trk .top { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
|
||||
.trk .name { font-weight: 700; font-size: 31px; }
|
||||
.trk .ratio { font-size: 46px; font-weight: 800; line-height: .9; }
|
||||
.trk .io { font-size: 25px; font-weight: 500; margin-top: 5px; }
|
||||
|
||||
/* ============================ JAUGE (signature) ============================
|
||||
Barre de progression intuitive : le noir se REMPLIT de gauche à droite avec la
|
||||
consommation ; le blanc à droite = budget restant. Repère ▼ = ligne d'alerte
|
||||
@@ -196,6 +204,23 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if trackers %}
|
||||
<hr class="div">
|
||||
<div class="label"><span class="t">Trackers</span></div>
|
||||
<div class="rows">
|
||||
{% for t in trackers %}
|
||||
<div class="trk">
|
||||
<div class="top">
|
||||
<span class="name">{{ t.label }}</span>
|
||||
{% if t.ok %}<span class="ratio num">{{ t.ratio_h }}</span>
|
||||
{% else %}<span class="io"><span class="ko">{{ t.error }}</span></span>{% endif %}
|
||||
</div>
|
||||
{% if t.ok %}<div class="io num">envoyé {{ t.up_h }} · reçu {{ t.down_h }}</div>{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if ha_states %}
|
||||
<hr class="div">
|
||||
<div class="label"><span class="t">Maison</span></div>
|
||||
|
||||
Reference in New Issue
Block a user