From a32a5b8abb97ce8486c47ff19fbd26e0972d902a Mon Sep 17 00:00:00 2001 From: Marco Locatelli Date: Fri, 19 Mar 2021 15:25:37 +0100 Subject: [PATCH] Aggiunte pagine per navigazione --- logger/PyLog.txt | 3 +- server/FlythisServer.py | 44 +++++- server/templates/FlythisTrap.html | 2 +- server/templates/home.html | 226 ++++++++++++++++++++++++++++++ server/templates/layout.html | 226 ++++++++++++++++++++++++++++++ server/templates/logger.html | 226 ++++++++++++++++++++++++++++++ server/templates/setup.html | 226 ++++++++++++++++++++++++++++++ 7 files changed, 949 insertions(+), 4 deletions(-) create mode 100644 server/templates/home.html create mode 100644 server/templates/layout.html create mode 100644 server/templates/logger.html create mode 100644 server/templates/setup.html diff --git a/logger/PyLog.txt b/logger/PyLog.txt index a60cdc1..7e1c6aa 100644 --- a/logger/PyLog.txt +++ b/logger/PyLog.txt @@ -40,4 +40,5 @@ Caught error: 'NoneType' object has no attribute 'decode' at time: 2021-03-19 11 Program end. Ctrl+C from user at time: 2021-03-19 12:48:01.838556 Program end. Ctrl+C from user at time: 2021-03-19 12:49:41.004201 Program end. Ctrl+C from user at time: 2021-03-19 12:53:27.063207 -Program end. Ctrl+C from user at time: 2021-03-19 15:00:27.908197 \ No newline at end of file +Program end. Ctrl+C from user at time: 2021-03-19 15:00:27.908197 +Program end. Ctrl+C from user at time: 2021-03-19 15:24:20.079220 \ No newline at end of file diff --git a/server/FlythisServer.py b/server/FlythisServer.py index 68d5903..6a3da39 100644 --- a/server/FlythisServer.py +++ b/server/FlythisServer.py @@ -34,7 +34,7 @@ flaskApp = Flask(__name__) #funzione main: passa al template html i primi dati che dovranno popolarlo. legge direttamente da redis. edit: passa anche indirizzo ip del server def main(): channelsData = { - 'title' : 'Flythis', + 'title' : 'Home', 'timeSrv' : redSrv0.get('RTDATA:CH:SRVTIME').decode('utf-8'), 'timeLog' : redSrv0.get('RTDATA:CH:RECTIME').decode('utf-8'), 'Ch0' : redSrv0.get('RTDATA:CH:0').decode('utf-8'), @@ -47,7 +47,47 @@ def main(): 'Ch7' : redSrv0.get('RTDATA:CH:7').decode('utf-8') } #assegno il template html di riferimento - return render_template('FlythisTrap.html', **channelsData) + return render_template('home.html', **channelsData) + + +@flaskApp.route("/logger") +#funzione main: passa al template html i primi dati che dovranno popolarlo. legge direttamente da redis. edit: passa anche indirizzo ip del server +def logger(): + channelsData = { + 'title' : 'logger', + 'timeSrv' : redSrv0.get('RTDATA:CH:SRVTIME').decode('utf-8'), + 'timeLog' : redSrv0.get('RTDATA:CH:RECTIME').decode('utf-8'), + 'Ch0' : redSrv0.get('RTDATA:CH:0').decode('utf-8'), + 'Ch1' : redSrv0.get('RTDATA:CH:1').decode('utf-8'), + 'Ch2' : redSrv0.get('RTDATA:CH:2').decode('utf-8'), + 'Ch3' : redSrv0.get('RTDATA:CH:3').decode('utf-8'), + 'Ch4' : redSrv0.get('RTDATA:CH:4').decode('utf-8'), + 'Ch5' : redSrv0.get('RTDATA:CH:5').decode('utf-8'), + 'Ch6' : redSrv0.get('RTDATA:CH:6').decode('utf-8'), + 'Ch7' : redSrv0.get('RTDATA:CH:7').decode('utf-8') + } + #assegno il template html di riferimento + return render_template('logger.html', **channelsData) + + +@flaskApp.route("/setup") +#funzione main: passa al template html i primi dati che dovranno popolarlo. legge direttamente da redis. edit: passa anche indirizzo ip del server +def setup(): + channelsData = { + 'title' : 'setup', + 'timeSrv' : redSrv0.get('RTDATA:CH:SRVTIME').decode('utf-8'), + 'timeLog' : redSrv0.get('RTDATA:CH:RECTIME').decode('utf-8'), + 'Ch0' : redSrv0.get('RTDATA:CH:0').decode('utf-8'), + 'Ch1' : redSrv0.get('RTDATA:CH:1').decode('utf-8'), + 'Ch2' : redSrv0.get('RTDATA:CH:2').decode('utf-8'), + 'Ch3' : redSrv0.get('RTDATA:CH:3').decode('utf-8'), + 'Ch4' : redSrv0.get('RTDATA:CH:4').decode('utf-8'), + 'Ch5' : redSrv0.get('RTDATA:CH:5').decode('utf-8'), + 'Ch6' : redSrv0.get('RTDATA:CH:6').decode('utf-8'), + 'Ch7' : redSrv0.get('RTDATA:CH:7').decode('utf-8') + } + #assegno il template html di riferimento + return render_template('setup.html', **channelsData) # definisco una NUOVA route a cui rispondere su chiamta in metodo GET x restituire dati aggiornati @flaskApp.route("/api/v1/channels/all", methods=['GET']) diff --git a/server/templates/FlythisTrap.html b/server/templates/FlythisTrap.html index 93ea45f..69ddc70 100644 --- a/server/templates/FlythisTrap.html +++ b/server/templates/FlythisTrap.html @@ -14,7 +14,7 @@ + + + + + +
+
+ +
+ +
+
+
+
+
+
+
+ + Server time +
+

+
+
+
+
+
+ + Last log time +
+

+
+
+
+
+
+ + Channels Reading +
+
+
+
+ Canale 1: +
+
+ Canale 2: +
+
+ Canale 3: +
+
+ Canale 4: +
+
+
+
+ Canale 5: +
+
+ Canale 6: +
+
+ Canale 7: +
+
+ Canale 8: +
+
+
+
+ +
+ + +
+
+
+
+
+
+ + Record Log +
+
+ +
+
+
+
+
+
+
+ Nuova sessione + +
+ +
+
+
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
+
+
+ +
+
+
+
Copyright © Steamware srl 2021
+
+
+
+
+
+ + diff --git a/server/templates/layout.html b/server/templates/layout.html new file mode 100644 index 0000000..93ea45f --- /dev/null +++ b/server/templates/layout.html @@ -0,0 +1,226 @@ + + + + + + + + + {{ title }} + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+
+
+ + Server time +
+

+
+
+
+
+
+ + Last log time +
+

+
+
+
+
+
+ + Channels Reading +
+
+
+
+ Canale 1: +
+
+ Canale 2: +
+
+ Canale 3: +
+
+ Canale 4: +
+
+
+
+ Canale 5: +
+
+ Canale 6: +
+
+ Canale 7: +
+
+ Canale 8: +
+
+
+
+ +
+ + +
+
+
+
+
+
+ + Record Log +
+
+ +
+
+
+
+
+
+
+ Nuova sessione + +
+ +
+
+
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
+
+
+ +
+
+
+
Copyright © Steamware srl 2021
+
+
+
+
+
+ + diff --git a/server/templates/logger.html b/server/templates/logger.html new file mode 100644 index 0000000..93ea45f --- /dev/null +++ b/server/templates/logger.html @@ -0,0 +1,226 @@ + + + + + + + + + {{ title }} + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+
+
+ + Server time +
+

+
+
+
+
+
+ + Last log time +
+

+
+
+
+
+
+ + Channels Reading +
+
+
+
+ Canale 1: +
+
+ Canale 2: +
+
+ Canale 3: +
+
+ Canale 4: +
+
+
+
+ Canale 5: +
+
+ Canale 6: +
+
+ Canale 7: +
+
+ Canale 8: +
+
+
+
+ +
+ + +
+
+
+
+
+
+ + Record Log +
+
+ +
+
+
+
+
+
+
+ Nuova sessione + +
+ +
+
+
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
+
+
+ +
+
+
+
Copyright © Steamware srl 2021
+
+
+
+
+
+ + diff --git a/server/templates/setup.html b/server/templates/setup.html new file mode 100644 index 0000000..93ea45f --- /dev/null +++ b/server/templates/setup.html @@ -0,0 +1,226 @@ + + + + + + + + + {{ title }} + + + + + + + + + +
+
+ +
+ +
+
+
+
+
+
+
+ + Server time +
+

+
+
+
+
+
+ + Last log time +
+

+
+
+
+
+
+ + Channels Reading +
+
+
+
+ Canale 1: +
+
+ Canale 2: +
+
+ Canale 3: +
+
+ Canale 4: +
+
+
+
+ Canale 5: +
+
+ Canale 6: +
+
+ Canale 7: +
+
+ Canale 8: +
+
+
+
+ +
+ + +
+
+
+
+
+
+ + Record Log +
+
+ +
+
+
+
+
+
+
+ Nuova sessione + +
+ +
+
+
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
check
+
Inizio
+
Durata
+
Nome
+
Copy
+
+
+
+
+
+ + +
+
+ +