Skip to content

Commit

Permalink
Added subtitle to update pages as well
Browse files Browse the repository at this point in the history
  • Loading branch information
Fruchtzwerg94 committed Jan 1, 2024
1 parent 3367f6e commit 9482061
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ void WiFiManager::handleRoot() {
String page = getHTTPHead(_title); // @token options @todo replace options with title
String str = FPSTR(HTTP_ROOT_MAIN); // @todo custom title
str.replace(FPSTR(T_t),_title);
str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, use AP name or ip
str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, AP name or ip
configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString())));
page += str;
page += FPSTR(HTTP_PORTAL_OPTIONS);
Expand Down Expand Up @@ -3878,8 +3878,9 @@ void WiFiManager::handleUpdate() {
if (captivePortal()) return; // If captive portal redirect instead of displaying the page
String page = getHTTPHead(_title); // @token options
String str = FPSTR(HTTP_ROOT_MAIN);
str.replace(FPSTR(T_t), _title);
str.replace(FPSTR(T_v), configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString())); // use ip if ap is not active for heading
str.replace(FPSTR(T_t), _title);
str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, AP name or ip
configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString())));
page += str;

page += FPSTR(HTTP_UPDATE);
Expand Down Expand Up @@ -3988,8 +3989,9 @@ void WiFiManager::handleUpdateDone() {

String page = getHTTPHead(FPSTR(S_options)); // @token options
String str = FPSTR(HTTP_ROOT_MAIN);
str.replace(FPSTR(T_t),_title);
str.replace(FPSTR(T_v), configPortalActive ? _apName : WiFi.localIP().toString()); // use ip if ap is not active for heading
str.replace(FPSTR(T_t),_title);

Check failure on line 3992 in WiFiManager.cpp

View workflow job for this annotation

GitHub Actions / build

[cpplint] reported by reviewdog 🐶 Missing space after , [whitespace/comma] [3] Raw Output: WiFiManager.cpp:3992: Missing space after , [whitespace/comma] [3]
str.replace(FPSTR(T_v), _subtitle.length() ? _subtitle : ( // Use subtitle, AP name or ip
configPortalActive ? _apName : (getWiFiHostname() + " - " + WiFi.localIP().toString())));
page += str;

if (Update.hasError()) {
Expand Down

0 comments on commit 9482061

Please sign in to comment.