From b8676a685d5568bb50050a235114e991f5b87156 Mon Sep 17 00:00:00 2001 From: ZanSara Date: Fri, 16 Apr 2021 09:47:32 +0200 Subject: [PATCH] Moving the \r\n fix into the overlays rendering code to avoid duplicating efforts. Other minor refinements to the web-ui. --- zanzocam/web_ui/templates/home.html | 16 ++++++++-------- zanzocam/web_ui/templates/server.html | 6 +++--- zanzocam/web_ui/templates/webcam.html | 3 +-- zanzocam/webcam/main.py | 4 ++-- zanzocam/webcam/overlays.py | 4 ++++ 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/zanzocam/web_ui/templates/home.html b/zanzocam/web_ui/templates/home.html index b1e9388c..e6c9bc56 100644 --- a/zanzocam/web_ui/templates/home.html +++ b/zanzocam/web_ui/templates/home.html @@ -20,7 +20,7 @@

WiFi:

Configura il WiFi

- Nome della rete (SSID): {{ wifi_data.ssid }}
+ Nome della rete (SSID): {{ wifi_data.ssid or "[non configurato]"}}
Password: Mostra

@@ -31,18 +31,18 @@

Server:

Configura Dati Server

- Protocollo: {{ server_data.protocol }}
+ Protocollo: {{ server_data.protocol or "[non configurato]"}}
{% if server_data.protocol=="HTTP" %} - URL: {{ server_data.url }}
+ URL: {{ server_data.url or "[non configurato]"}}
{% elif server_data.protocol=="FTP" %} - Hostname: {{ server_data.hostname }}
- Sottocartella: {{ server_data.subfolder }}
+ Hostname: {{ server_data.hostname or "[non configurato]"}}
+ Sottocartella: {{ server_data.subfolder or "[non configurato]"}}
Usa TLS: {%if server_data.tls %}Si'{% else %}No{% endif %}
{% endif %} - Username: {{ server_data.username }}
+ Username: {{ server_data.username or "[non configurato]" }}
Password: Mostra

@@ -95,7 +95,7 @@

Riavvia ZANZOCAM:

const button_wifi = document.getElementById("wifi_pwd_button"); if( button_wifi.innerHTML == 'Mostra' ) { button_wifi.innerHTML = 'Nascondi'; - field_wifi.innerHTML="{{ wifi_data.password }}"; + field_wifi.innerHTML="{{ wifi_data.password or '[non configurato]' }}"; } else { button_wifi.innerHTML = 'Mostra'; field_wifi.innerHTML=""; @@ -107,7 +107,7 @@

Riavvia ZANZOCAM:

const button = document.getElementById("server_pwd_button"); if( button.innerHTML == 'Mostra' ) { button.innerHTML = 'Nascondi'; - field.innerHTML="{{ server_data.password }}"; + field.innerHTML="{{ server_data.password or '[non configurato]'}}"; } else { button.innerHTML = 'Mostra'; field.innerHTML=""; diff --git a/zanzocam/web_ui/templates/server.html b/zanzocam/web_ui/templates/server.html index c11196bc..4611a206 100644 --- a/zanzocam/web_ui/templates/server.html +++ b/zanzocam/web_ui/templates/server.html @@ -23,17 +23,17 @@