From 951396563abe980b90d656b95664537c2e2560a0 Mon Sep 17 00:00:00 2001 From: Roby Date: Sat, 24 Oct 2026 12:25:27 +0200 Subject: [PATCH] Release 3.0: Nuovo design Soft UI, Fleet Status centrato e fix vari --- app.py | 3 + sw.js | 10 +- templates/index.html | 819 +++++++++++++++++++------------------------ 3 files changed, 369 insertions(+), 463 deletions(-) diff --git a/app.py b/app.py index 6ab5bbf..dc5d207 100644 --- a/app.py +++ b/app.py @@ -1,3 +1,6 @@ +import gevent.monkey +gevent.monkey.patch_all() + from flask import Flask, render_template, request, session, jsonify, send_from_directory from paho.mqtt import client as mqtt_client from werkzeug.security import generate_password_hash, check_password_hash diff --git a/sw.js b/sw.js index 59e93d1..dc539ac 100644 --- a/sw.js +++ b/sw.js @@ -1,4 +1,4 @@ -const CACHE_NAME = 'fleet-c2-v3'; // incrementare a ogni modifica degli asset precaricati +const CACHE_NAME = 'fleet-c2-v5'; const PRECACHE_URLS = [ '/', '/manifest.json', @@ -6,8 +6,6 @@ const PRECACHE_URLS = [ ]; // --- 1. INSTALL: precache "best effort" ------------------------------------- -// Se un file manca (es. icona non ancora caricata) l'installazione NON fallisce: -// un SW che non si installa significa niente notifiche push. self.addEventListener('install', event => { event.waitUntil( caches.open(CACHE_NAME) @@ -26,8 +24,6 @@ self.addEventListener('activate', event => { }); // --- 3. FETCH: network-first, cache come ripiego offline --------------------- -// Gestiamo solo le GET della nostra origine. API e WebSocket (socket.io) passano -// sempre direttamente dalla rete: i dati della flotta non vanno mai serviti "vecchi". self.addEventListener('fetch', event => { const req = event.request; if (req.method !== 'GET') return; @@ -80,8 +76,6 @@ self.addEventListener('push', event => { icon: '/icon-512.png', badge: '/icon-512.png', vibrate: [200, 100, 200], - // Stesso tag = la nuova notifica dello stesso nodo sostituisce la precedente - // (invece di accumulare 10 notifiche) e rifΓ  vibrare/suonare. tag: data.tag || 'fleet-alert', renotify: true, data: { @@ -100,8 +94,6 @@ self.addEventListener('push', event => { }); // --- 5. CLICK SULLA NOTIFICA ------------------------------------------------- -// Click sul corpo O su "Apri Dashboard": porta in primo piano la finestra giΓ  aperta, -// altrimenti ne apre una nuova. "Chiudi" chiude soltanto. self.addEventListener('notificationclick', event => { event.notification.close(); if (event.action === 'close') return; diff --git a/templates/index.html b/templates/index.html index 55e73ed..fbe4973 100644 --- a/templates/index.html +++ b/templates/index.html @@ -13,154 +13,170 @@ @@ -170,7 +186,6 @@
FLEET CONTROL CONSOLE
-
- -
-
-

- πŸ“Š DAILY STATISTICS + +
+

+ 🟒 FLEET STATUS

- +
-
-
-

🎯 TOP TALKGROUPS

-
Loading...
+ +
+
+

+ πŸ“‘ Lastheard +

+
- -
-

πŸ—£οΈ TOP CALLSIGNS

-
Loading...
-
- -
-
-
--s
-
⏱️ AVERAGE DURATION
-
-
-
-
--
-
πŸ“‘ TRANSITS TODAY
-
-
-
- -
-

- πŸ“‘ Lastheard -

-
+
@@ -250,6 +244,36 @@
+ + +
+

+ πŸ“Š DAILY STATISTICS +

+
+
+

🎯 TOP TALKGROUPS

+
Loading...
+
+ +
+

πŸ—£οΈ TOP CALLSIGNS

+
Loading...
+
+ +
+
+
--s
+
⏱️ AVERAGE DURATION
+
+
+
+
--
+
πŸ“‘ TRANSITS TODAY
+
+
+
+
+