reaorganize home header

This commit is contained in:
2026-11-03 15:04:19 +01:00
parent 66cd63a181
commit b29e0a5505
3 changed files with 41 additions and 27 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

+4 -7
View File
@@ -105,6 +105,9 @@ function openNodeFocus(clientId) {
document.getElementById('tab-aprs').classList.remove('active'); document.getElementById('tab-aprs').classList.remove('active');
document.getElementById('view-focus').style.display = 'block'; document.getElementById('view-focus').style.display = 'block';
window.scrollTo({ top: 0, behavior: 'smooth' }); window.scrollTo({ top: 0, behavior: 'smooth' });
const role = me.role || ''; const role = me.role || '';
@@ -1369,13 +1372,7 @@ function urlB64ToUint8Array(base64String) { const padding = '='.repeat((4 - base
async function checkServerUpdate() { async function checkServerUpdate() {
if (!isAuthenticated || me.role !== 'admin') return; if (!isAuthenticated || me.role !== 'admin') return;
try { try { const res = await fetch('/api/server_update/check'); const data = await res.json(); const btn = document.getElementById('server-update-btn'); if (btn) { btn.style.display = data.update_available ? 'inline-block' : 'none'; } } catch (e) { console.error(e); }
// Modifica: la dashboard chiede solo al backend senza innescare comandi git
const res = await fetch('/api/server_update/status');
const data = await res.json();
const btn = document.getElementById('server-update-btn');
if (btn) { btn.style.display = data.update_available ? 'inline-block' : 'none'; }
} catch (e) { console.error(e); }
} }
function confirmServerUpdate() { function confirmServerUpdate() {
+37 -20
View File
@@ -25,31 +25,45 @@
</head> </head>
<body> <body>
<div id="top-bar-container"> <div id="top-bar-container" style="border-bottom: 2px solid var(--border-main); background: var(--bg-main, #04102e);">
<div id="top-bar"> <div id="top-bar" style="display: flex; justify-content: space-between; align-items: stretch; padding: 0; min-height: 90px; flex-wrap: wrap;">
<div class="brand-container" style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start;">
<div class="title-brand" style="line-height: 1.1; padding-bottom: 2px;">SCHEMATIC // FLEET C2</div> <!-- HEADER SX: BANNER CON RIEMPIMENTO ASSOLUTO A FILO -->
<div id="live-clock" style="font-family: 'JetBrains Mono', monospace; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 1px; padding-left: 2px;">SYS_TIME: --:--:--</div> <div id="master-banner-container" style="display: none; flex: 0 0 45%; max-width: 45%; border-right: 2px solid var(--border-main); background: #020b1e; align-items: stretch; justify-content: stretch; padding: 0; box-sizing: border-box; overflow: hidden;">
<img src="/static/banners/banner.png" style="width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;"
onload="this.parentElement.style.display='flex';"
onerror="this.parentElement.style.display='none';">
</div> </div>
<div class="nav-tabs"> <!-- HEADER DX: STRUTTURA FLUIDA A 3 RIGHE -->
<button class="nav-tab active" onclick="switchView('home')" id="tab-home">HOME</button> <div id="header-right-controls" style="flex: 1; display: flex; flex-direction: column; gap: 10px; justify-content: center; padding: 12px 20px; box-sizing: border-box; background: rgba(0, 15, 45, 0.25); min-width: 350px;">
<button class="nav-tab" onclick="switchView('nodes')" id="tab-nodes">NODES</button>
<button class="nav-tab" onclick="switchView('map')" id="tab-map">MAP</button> <!-- RIGA 1: BRAND E OROLOGIO -->
<button class="nav-tab" onclick="switchView('aprs')" id="tab-aprs">APRS</button> <div style="display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px; border-bottom: 1px dashed var(--border-light, rgba(255,255,255,0.15)); padding-bottom: 4px;">
</div> <span class="title-brand" style="font-size: 1.15rem; font-weight: 700; letter-spacing: 2px; color: var(--text-main);">SCHEMATIC // FLEET C2</span>
<span id="live-clock" style="font-family: 'JetBrains Mono', monospace; font-size: 0.8rem; color: var(--primary); letter-spacing: 1px;">SYS_TIME: --:--:--</span>
</div>
<!-- RIGA 2: TASTI DI NAVIGAZIONE -->
<div class="nav-tabs" style="display: flex; flex-wrap: wrap; gap: 8px; border: none; margin: 0; padding: 0; width: 100%;">
<button class="nav-tab active" onclick="switchView('home')" id="tab-home" style="flex: 1; min-width: 80px; padding: 6px 0; font-size: 0.85rem; font-weight: bold; letter-spacing: 1.5px; text-align: center; border-radius: 4px;">HOME</button>
<button class="nav-tab" onclick="switchView('nodes')" id="tab-nodes" style="flex: 1; min-width: 80px; padding: 6px 0; font-size: 0.85rem; font-weight: bold; letter-spacing: 1.5px; text-align: center; border-radius: 4px;">NODES</button>
<button class="nav-tab" onclick="switchView('map')" id="tab-map" style="flex: 1; min-width: 80px; padding: 6px 0; font-size: 0.85rem; font-weight: bold; letter-spacing: 1.5px; text-align: center; border-radius: 4px;">MAP</button>
<button class="nav-tab" onclick="switchView('aprs')" id="tab-aprs" style="flex: 1; min-width: 80px; padding: 6px 0; font-size: 0.85rem; font-weight: bold; letter-spacing: 1.5px; text-align: center; border-radius: 4px;">APRS</button>
</div>
<!-- RIGA 3: BADGES E TASTI ADMIN -->
<div class="top-bar-right" style="display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; border: none; margin: 0; padding: 0; width: 100%;">
<span id="mqtt-badge" class="mqtt-badge mqtt-offline" style="padding: 4px 10px; font-size: 0.75rem; font-weight: bold; letter-spacing: 1px;">MQTT: CHK</span>
<button class="theme-switch" id="layout-btn" onclick="cycleLayout()" title="Cambia Layout" style="padding: 4px 10px; font-size: 0.75rem;">[ L: BLU ]</button>
<button class="theme-switch" id="lang-btn" onclick="toggleLang()" data-i18n-title="ttLang" style="padding: 4px 10px; font-size: 0.75rem;">ITA</button>
<button class="theme-switch" id="push-btn" onclick="subscribeToPush()" style="padding: 4px 10px; font-size: 0.75rem;">PUSH</button>
<div id="auth-container" style="display: flex; flex-wrap: wrap; align-items: center; gap: 6px; justify-content: flex-end;"></div>
</div>
<div class="top-bar-right">
<span id="mqtt-badge" class="mqtt-badge mqtt-offline">MQTT: CHK</span>
<button class="theme-switch" id="layout-btn" onclick="cycleLayout()" title="Cambia Layout">[ L: BLU ]</button>
<button class="theme-switch" id="lang-btn" onclick="toggleLang()" data-i18n-title="ttLang">ITA</button>
<button class="theme-switch" id="push-btn" onclick="subscribeToPush()">PUSH</button>
<div id="auth-container" style="display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end;"></div>
</div> </div>
</div> </div>
</div> </div><!-- VISTA FLEET MAP -->
<!-- VISTA FLEET MAP -->
<div id="view-map" style="display: none; padding: 0 20px;"> <div id="view-map" style="display: none; padding: 0 20px;">
<div id="map-container"></div> <div id="map-container"></div>
</div> </div>
@@ -91,6 +105,7 @@
</div> </div>
</div> </div>
<!-- BANNER PERSONALIZZATO -->
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));"> <div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));">
<!-- COLONNA SX: HARDWARE E RF --> <!-- COLONNA SX: HARDWARE E RF -->
<div style="display: flex; flex-direction: column; gap: 20px;"> <div style="display: flex; flex-direction: column; gap: 20px;">
@@ -199,6 +214,8 @@
<!-- VISTA HOME --> <!-- VISTA HOME -->
<div id="view-home"> <div id="view-home">
<div style="max-width: 1400px; margin: 0 auto 20px auto; padding: 0 20px;"> <div style="max-width: 1400px; margin: 0 auto 20px auto; padding: 0 20px;">
<h3 style="margin: 0 0 15px 0; font-weight: 300; letter-spacing: 2px; color: var(--text-main); border-bottom: 1px dashed var(--border-main); padding-bottom: 5px;"> <h3 style="margin: 0 0 15px 0; font-weight: 300; letter-spacing: 2px; color: var(--text-main); border-bottom: 1px dashed var(--border-main); padding-bottom: 5px;">
[ FLEET_STATUS ] [ FLEET_STATUS ]
</h3> </h3>