From 673a895d44fc0c019edcbff52c351a92211bb58a Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 8 Nov 2023 11:15:14 -0600 Subject: [PATCH] [WEBUI] Do not display gateway password if using WifiManualSetup (#1793) --- main/ZwebUI.ino | 4 ++++ main/config_WebContent.h | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/main/ZwebUI.ino b/main/ZwebUI.ino index efa5303..3ba8fad 100644 --- a/main/ZwebUI.ino +++ b/main/ZwebUI.ino @@ -814,6 +814,7 @@ void handleMQ() { server.send(200, "text/html", response); } +# ifndef ESPWifiManualSetup /** * @brief /CG - Configure Gateway Page * T: handleCG: uri: /gw, args: 2, method: 1 @@ -882,6 +883,7 @@ void handleCG() { response += String(buffer); server.send(200, "text/html", response); } +# endif /** * @brief /LO - Configure Logging Page @@ -1486,7 +1488,9 @@ void WebUISetup() { server.on("/cn", handleCN); // Configuration server.on("/wi", handleWI); // Configure Wifi server.on("/mq", handleMQ); // Configure MQTT +# ifndef ESPWifiManualSetup server.on("/cg", handleCG); // Configure Gateway" +# endif server.on("/wu", handleWU); // Configure WebUI # ifdef ZgatewayLORA server.on("/la", handleLA); // Configure LORA diff --git a/main/config_WebContent.h b/main/config_WebContent.h index c114cb9..82b70fd 100644 --- a/main/config_WebContent.h +++ b/main/config_WebContent.h @@ -48,7 +48,11 @@ #else # define configure_3 #endif*/ -#define configure_3 "

" +#ifndef ESPWifiManualSetup +# define configure_3 "

" +#else +# define configure_3 +#endif #define configure_4 "

" #define configure_5 "

" #ifdef ZgatewayLORA @@ -99,8 +103,9 @@ const char config_wifi_body[] = body_header "%s
S const char config_mqtt_body[] = body_header "
MQTT Parameters

MQTT Server

MQTT Port

MQTT Username


MQTT Secure Connection

Gateway Name

MQTT Base Topic


" body_footer_config_menu; +#ifndef ESPWifiManualSetup const char config_gateway_body[] = body_header "
Gateway Configuration

Gateway Password (8 characters min)


" body_footer_config_menu; - +#endif const char config_logging_body[] = body_header "
OpenMQTTGateway Logging

Log Level


" body_footer_config_menu; const char config_webui_body[] = body_header "
Configure WebUI

Display Metric

Secure WebUI


" body_footer_config_menu;