From c428a33aa9f298bdf4baab011f7aeb1eecf428d9 Mon Sep 17 00:00:00 2001 From: Hieromon Ikasamo Date: Wed, 23 Jan 2019 23:58:09 +0900 Subject: [PATCH] Improved code readability --- src/AutoConnect.cpp | 1 - src/AutoConnect.h | 1 - src/AutoConnectDefs.h | 5 - src/AutoConnectPage.cpp | 761 ++++++++++++++++++++-------------------- 4 files changed, 379 insertions(+), 389 deletions(-) diff --git a/src/AutoConnect.cpp b/src/AutoConnect.cpp index fe2aca6..de76fda 100644 --- a/src/AutoConnect.cpp +++ b/src/AutoConnect.cpp @@ -706,7 +706,6 @@ String AutoConnect::_induceConnect(PageArgument& args) { // Turn on the trigger to start WiFi.begin(). _rfConnect = true; - _menuTitle = String(F(AUTOCONNECT_CONNECTING_TITLE)); // Since v0.9.7, the redirect method changed from a 302 response to the // meta tag with refresh attribute. diff --git a/src/AutoConnect.h b/src/AutoConnect.h index 530a84d..a54b81f 100644 --- a/src/AutoConnect.h +++ b/src/AutoConnect.h @@ -336,7 +336,6 @@ class AutoConnect { String _token_UPTIME(PageArgument& args); String _token_BOOTURI(PageArgument& args); String _token_CURRENT_SSID(PageArgument& args); - String _token_RESULT_URI(PageArgument& args); #if defined(ARDUINO_ARCH_ESP8266) friend class ESP8266WebServer; diff --git a/src/AutoConnectDefs.h b/src/AutoConnectDefs.h index 16778f2..ad69bc8 100644 --- a/src/AutoConnectDefs.h +++ b/src/AutoConnectDefs.h @@ -76,11 +76,6 @@ #define AUTOCONNECT_MENU_TITLE "AutoConnect" #endif // !AUTOCONNECT_MENU_TITLE -// AutoConnect title for during a connection attempting -#ifndef AUTOCONNECT_CONNECTING_TITLE -#define AUTOCONNECT_CONNECTING_TITLE "Connecting" -#endif // !AUTOCONNECT_CONNECTING_TITLE - // URIs of AutoConnect menu collection #define AUTOCONNECT_URI_CONFIG AUTOCONNECT_URI "/config" #define AUTOCONNECT_URI_CONNECT AUTOCONNECT_URI "/connect" diff --git a/src/AutoConnectPage.cpp b/src/AutoConnectPage.cpp index 98e4bbd..01b509c 100644 --- a/src/AutoConnectPage.cpp +++ b/src/AutoConnectPage.cpp @@ -3,7 +3,7 @@ * @file AutoConnectPage.h * @author hieromon@gmail.com * @version 0.9.7 - * @date 2018-11-17 + * @date 2019-01-23 * @copyright MIT license. */ @@ -24,192 +24,192 @@ extern "C" { /**< Basic CSS common to all pages */ const char AutoConnect::_CSS_BASE[] PROGMEM = { "html{" - "font-family:Helvetica,Arial,sans-serif;" - "font-size:16px;" - "-ms-text-size-adjust:100%;" - "-webkit-text-size-adjust:100%;" - "-moz-osx-font-smoothing:grayscale;" - "-webkit-font-smoothing:antialiased;" + "font-family:Helvetica,Arial,sans-serif;" + "font-size:16px;" + "-ms-text-size-adjust:100%;" + "-webkit-text-size-adjust:100%;" + "-moz-osx-font-smoothing:grayscale;" + "-webkit-font-smoothing:antialiased;" "}" "body{" - "margin:0;" - "padding:0;" + "margin:0;" + "padding:0;" "}" ".base-panel{" - "margin:0 22px 0 22px;" + "margin:0 22px 0 22px;" "}" ".base-panel>*>label{" - "display:inline-block;" - "width:3.0em;" - "text-align:right;" + "display:inline-block;" + "width:3.0em;" + "text-align:right;" "}" "input{" - "-moz-appearance:none;" - "-webkit-appearance:none;" - "font-size:0.9em;" - "margin:8px 0 auto;" + "-moz-appearance:none;" + "-webkit-appearance:none;" + "font-size:0.9em;" + "margin:8px 0 auto;" "}" ".lap{" - "visibility:collapse;" + "visibility:collapse;" "}" ".lap:target{" - "visibility:visible;" + "visibility:visible;" "}" ".lap:target .overlap{" - "opacity:0.7;" - "transition:0.3s;" + "opacity:0.7;" + "transition:0.3s;" "}" ".lap:target .modal_button{" - "opacity:1;" - "transition:0.3s;" + "opacity:1;" + "transition:0.3s;" "}" ".overlap{" - "top:0;" - "left:0;" - "width:100%;" - "height:100%;" - "position:fixed;" - "opacity:0;" - "background:#000;" - "z-index:1000;" + "top:0;" + "left:0;" + "width:100%;" + "height:100%;" + "position:fixed;" + "opacity:0;" + "background:#000;" + "z-index:1000;" "}" ".modal_button{" - "border-radius:13px;" - "background:#660033;" - "color:#ffffcc;" - "padding:20px 30px;" - "text-align:center;" - "text-decoration:none;" - "letter-spacing:1px;" - "font-weight:bold;" - "display:inline-block;" - "top:40%;" - "left:40%;" - "width:20%;" - "position:fixed;" - "opacity:0;" - "z-index:1001;" + "border-radius:13px;" + "background:#660033;" + "color:#ffffcc;" + "padding:20px 30px;" + "text-align:center;" + "text-decoration:none;" + "letter-spacing:1px;" + "font-weight:bold;" + "display:inline-block;" + "top:40%;" + "left:40%;" + "width:20%;" + "position:fixed;" + "opacity:0;" + "z-index:1001;" "}" }; /**< non-marked list for UL */ const char AutoConnect::_CSS_UL[] PROGMEM = { "ul.noorder{" - "padding:0;" - "list-style:none;" + "padding:0;" + "list-style:none;" "}" "ul.noorder>*>label{" - "display:inline-block;" - "width:86px;" - "margin-right:10px;" - "text-align:right;" + "display:inline-block;" + "width:86px;" + "margin-right:10px;" + "text-align:right;" "}" "ul.noorder>input[type=\"checkbox\"]{" - "-moz-appearance:checkbox;" - "-webkit-appearance:checkbox;" + "-moz-appearance:checkbox;" + "-webkit-appearance:checkbox;" "}" "ul.noorder>input[type=\"radio\"]{" - "margin-right:0.5em;" - "-moz-appearance:radio;" - "-webkit-appearance:radio;" + "margin-right:0.5em;" + "-moz-appearance:radio;" + "-webkit-appearance:radio;" "}" }; /**< Image icon for inline expansion, the lock mark. */ const char AutoConnect::_CSS_ICON_LOCK[] PROGMEM = { ".img-lock{" - "display:inline-block;" - "width:24px;" - "height:24px;" - "margin-left:12px;" - "vertical-align:middle;" - "background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAB1ElEQVRIibWVu0scURTGf3d2drBQFAWbbRQVCwuVLIZdi2gnWIiF/4GtKyuJGAJh8mgTcU0T8T8ICC6kiIVu44gvtFEQQWwsbExQJGHXmZtiZsOyzCN3Vz+4cDjfvec7j7l3QAF95onRZ54YKmdE1IbnS0c9mnAyAjkBxDy3LRHrjtRyu7OD52HntTAyvbw/HxP2hkCearrRb2WSCSuTTGi60S+QpzFhbwznDl/VVMHw0sF7hEjFbW2qkB38lfp8nNDipWcATil+uDM3cDWyeNRSijnfkHJnezb5Vkkgvbg3IOXD2e1ts93S+icnkZOAVaalZK3YQMa4L+pC6L1WduhYSeCf0PLBdxzOjZ93Lwvm6APAiLmlF1ubPiHotmaS41ExQjH0ZbfNM1NAFpgD0lVcICIrANqAVaAd+AFIYAy4BqaBG+Wsq5AH3vgk8xpYrzf4KLAZwhe8PYEIvQe4vc6H8Hnc2dQs0AFchvAXQGdEDF8s4A5TZS34BQqqQNaS1WMI3KD4WUbNoBJfce9CO7BSr4BfBe8A21vmUwh0VdjdTyHwscL+UK+AHxoD7FDoAX6/Cnpxn4ay/egCjcCL/w1chkqLakLQ/6ABhT57uAd+Vzv/Ara3iY6fK4WxAAAAAElFTkSuQmCC) no-repeat;" + "display:inline-block;" + "width:24px;" + "height:24px;" + "margin-left:12px;" + "vertical-align:middle;" + "background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAB1ElEQVRIibWVu0scURTGf3d2drBQFAWbbRQVCwuVLIZdi2gnWIiF/4GtKyuJGAJh8mgTcU0T8T8ICC6kiIVu44gvtFEQQWwsbExQJGHXmZtiZsOyzCN3Vz+4cDjfvec7j7l3QAF95onRZ54YKmdE1IbnS0c9mnAyAjkBxDy3LRHrjtRyu7OD52HntTAyvbw/HxP2hkCearrRb2WSCSuTTGi60S+QpzFhbwznDl/VVMHw0sF7hEjFbW2qkB38lfp8nNDipWcATil+uDM3cDWyeNRSijnfkHJnezb5Vkkgvbg3IOXD2e1ts93S+icnkZOAVaalZK3YQMa4L+pC6L1WduhYSeCf0PLBdxzOjZ93Lwvm6APAiLmlF1ubPiHotmaS41ExQjH0ZbfNM1NAFpgD0lVcICIrANqAVaAd+AFIYAy4BqaBG+Wsq5AH3vgk8xpYrzf4KLAZwhe8PYEIvQe4vc6H8Hnc2dQs0AFchvAXQGdEDF8s4A5TZS34BQqqQNaS1WMI3KD4WUbNoBJfce9CO7BSr4BfBe8A21vmUwh0VdjdTyHwscL+UK+AHxoD7FDoAX6/Cnpxn4ay/egCjcCL/w1chkqLakLQ/6ABhT57uAd+Vzv/Ara3iY6fK4WxAAAAAElFTkSuQmCC) no-repeat;" "}" }; /**< INPUT button and submit style */ const char AutoConnect::_CSS_INPUT_BUTTON[] PROGMEM = { "input[type=\"button\"],input[type=\"submit\"]{" - "padding:8px 30px;" - "font-weight:bold;" - "letter-spacing:0.8px;" - "color:#fff;" - "border:1px solid;" - "border-radius:2px;" - "margin-top:12px;" + "padding:8px 30px;" + "font-weight:bold;" + "letter-spacing:0.8px;" + "color:#fff;" + "border:1px solid;" + "border-radius:2px;" + "margin-top:12px;" "}" "input[type=\"button\"]{" - "background-color:#1b5e20;" - "border-color:#1b5e20;" - "width:16em;" + "background-color:#1b5e20;" + "border-color:#1b5e20;" + "width:16em;" "}" ".aux-page input[type=\"button\"]{" - "font-weight:normal;" - "padding:8px 14px;" - "margin:12px;" - "width:auto;" + "font-weight:normal;" + "padding:8px 14px;" + "margin:12px;" + "width:auto;" "}" "input#sb[type=\"submit\"]{" - "width:16em;" + "width:16em;" "}" "input[type=\"submit\"]{" - "background-color:#006064;" - "border-color:#006064;" + "background-color:#006064;" + "border-color:#006064;" "}" "input[type=\"button\"], input[type=\"submit\"]:focus," "input[type=\"button\"], input[type=\"submit\"]:active{" - "outline:none;" - "text-decoration:none;" + "outline:none;" + "text-decoration:none;" "}" }; /**< INPUT text style */ const char AutoConnect::_CSS_INPUT_TEXT[] PROGMEM = { "input[type=\"text\"], input[type=\"password\"], .aux-page select{" - "background-color:#fff;" - "border:1px solid #ccc;" - "border-radius:2px;" - "color:#444;" - "margin:8px 0 8px 0;" - "padding:10px;" + "background-color:#fff;" + "border:1px solid #ccc;" + "border-radius:2px;" + "color:#444;" + "margin:8px 0 8px 0;" + "padding:10px;" "}" "input[type=\"text\"], input[type=\"password\"]{" - "font-weight:300;" - "width:calc(100% - 124px);" - "-webkit-transition:all 0.20s ease-in;" - "-moz-transition:all 0.20s ease-in;" - "-o-transition:all 0.20s ease-in;" - "-ms-transition:all 0.20s ease-in;" - "transition:all 0.20s ease-in;" + "font-weight:300;" + "width:calc(100% - 124px);" + "-webkit-transition:all 0.20s ease-in;" + "-moz-transition:all 0.20s ease-in;" + "-o-transition:all 0.20s ease-in;" + "-ms-transition:all 0.20s ease-in;" + "transition:all 0.20s ease-in;" "}" "input[type=\"text\"]:focus,input[type=\"password\"]:focus{" - "outline:none;" - "border-color:#5C9DED;" - "box-shadow:0 0 3px #4B8CDC;" + "outline:none;" + "border-color:#5C9DED;" + "box-shadow:0 0 3px #4B8CDC;" "}" "input.error, input.error:focus{" - "border-color:#ED5564;" - "color:#D9434E;" - "box-shadow:0 0 3px #D9434E;" + "border-color:#ED5564;" + "color:#D9434E;" + "box-shadow:0 0 3px #D9434E;" "}" "input:disabled{" - "opacity:0.6;" - "background-color:#f7f7f7;" + "opacity:0.6;" + "background-color:#f7f7f7;" "}" "input:disabled:hover{" - "cursor:not-allowed;" + "cursor:not-allowed;" "}" - "input.error::-webkit-input-placeholder{" - "color:#D9434E;" + "input.error::-webkit-input-placeholder{" + "color:#D9434E;" "}" "input.error:-moz-placeholder{" - "color:#D9434E;" + "color:#D9434E;" "}" "input.error::-moz-placeholder{" - "color:#D9434E;" + "color:#D9434E;" "}" "input.error:-ms-input-placeholder{" - "color:#D9434E;" + "color:#D9434E;" "}" ".aux-page label{" "padding:10px 0.5em;" @@ -219,54 +219,54 @@ const char AutoConnect::_CSS_INPUT_TEXT[] PROGMEM = { /**< TABLE style */ const char AutoConnect::_CSS_TABLE[] PROGMEM = { "table{" - "border-collapse:collapse;" - "border-spacing:0;" - "border:1px solid #ddd;" - "color:#444;" - "background-color:#fff;" - "margin-bottom:20px;" + "border-collapse:collapse;" + "border-spacing:0;" + "border:1px solid #ddd;" + "color:#444;" + "background-color:#fff;" + "margin-bottom:20px;" "}" "table.info," "table.info>tfoot," "table.info>thead{" - "width:100%;" - "border-color:#5C9DED;" + "width:100%;" + "border-color:#5C9DED;" "}" "table.info>thead{" - "background-color:#5C9DED;" + "background-color:#5C9DED;" "}" "table.info>thead>tr>th{" - "color:#fff;" + "color:#fff;" "}" "td," "th{" - "padding:10px 22px;" + "padding:10px 22px;" "}" "thead{" - "background-color:#f3f3f3;" - "border-bottom:1px solid #ddd;" + "background-color:#f3f3f3;" + "border-bottom:1px solid #ddd;" "}" "thead>tr>th{" - "font-weight:400;" - "text-align:left;" + "font-weight:400;" + "text-align:left;" "}" "tfoot{" - "border-top:1px solid #ddd;" + "border-top:1px solid #ddd;" "}" "tbody," "tbody>tr:nth-child(odd){" - "background-color:#fff;" + "background-color:#fff;" "}" "tbody>tr>td," "tfoot>tr>td{" - "font-weight:300;" - "font-size:.88em;" + "font-weight:300;" + "font-size:.88em;" "}" "tbody>tr:nth-child(even){" - "background-color:#f7f7f7;" + "background-color:#f7f7f7;" "}" - "table.info tbody>tr:nth-child(even){" - "background-color:#EFF5FD;" + "table.info tbody>tr:nth-child(even){" + "background-color:#EFF5FD;" "}" }; @@ -291,18 +291,18 @@ const char AutoConnect::_CSS_SPINNER[] PROGMEM = { "animation:sk-bounce 2.0s infinite ease-in-out;" "}" ".double-bounce2{" - "-webkit-animation-delay: -1.0s;" - "animation-delay: -1.0s;" + "-webkit-animation-delay:-1.0s;" + "animation-delay:-1.0s;" "}" "@-webkit-keyframes sk-bounce{" - "0%, 100% {-webkit-transform:scale(0.0)}" - "50% {-webkit-transform:scale(1.0)}" + "0%, 100%{-webkit-transform:scale(0.0)}" + "50%{-webkit-transform:scale(1.0)}" "}" "@keyframes sk-bounce{" - "0%, 100% {" + "0%,100%{" "transform:scale(0.0);" "-webkit-transform:scale(0.0);" - "} 50% {" + "}50%{" "transform:scale(1.0);" "-webkit-transform:scale(1.0);" "}" @@ -503,46 +503,46 @@ const char AutoConnect::_ELM_HTML_HEAD[] PROGMEM = { "" "" "" - "" + "" }; /**< LuxBar menu element. */ const char AutoConnect::_ELM_MENU_PRE[] PROGMEM = { "
" - "" - "
" - "" + "
" + "
" + "" + "
" "
" }; /**< The 404 page content. */ const char AutoConnect::_PAGE_404[] PROGMEM = { "{{HEAD}}" - "Page not found" + "Page not found" "" "" - "404 Not found" + "404 Not found" "" "" }; @@ -550,11 +550,11 @@ const char AutoConnect::_PAGE_404[] PROGMEM = { /**< The page that started the reset. */ const char AutoConnect::_PAGE_RESETTING[] PROGMEM = { "{{HEAD}}" - "" - "AutoConnect resetting" + "" + "AutoConnect resetting" "" "" - "

{{RESET}}

" + "

{{RESET}}

" "" "" }; @@ -562,81 +562,81 @@ const char AutoConnect::_PAGE_RESETTING[] PROGMEM = { /**< AutoConnect portal page. */ const char AutoConnect::_PAGE_STAT[] PROGMEM = { "{{HEAD}}" - "AutoConnect statistics" - "" + "AutoConnect statistics" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_AUX}}" - "{{MENU_POST}}" - "
" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "
Established connection{{ESTAB_SSID}}
Mode{{WIFI_MODE}}({{WIFI_STATUS}})
IP{{LOCAL_IP}}
GW{{GATEWAY}}
Subnet mask{{NETMASK}}
SoftAP IP{{SOFTAP_IP}}
AP MAC{{AP_MAC}}
STA MAC{{STA_MAC}}
Channel{{CHANNEL}}
dBm{{DBM}}
Chip ID{{CHIP_ID}}
CPU Freq.{{CPU_FREQ}}MHz
Flash size{{FLASH_SIZE}}
Free memory{{FREE_HEAP}}
" - "
" - "
" + "
" + "{{MENU_PRE}}" + "{{MENU_AUX}}" + "{{MENU_POST}}" + "
" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
Established connection{{ESTAB_SSID}}
Mode{{WIFI_MODE}}({{WIFI_STATUS}})
IP{{LOCAL_IP}}
GW{{GATEWAY}}
Subnet mask{{NETMASK}}
SoftAP IP{{SOFTAP_IP}}
AP MAC{{AP_MAC}}
STA MAC{{STA_MAC}}
Channel{{CHANNEL}}
dBm{{DBM}}
Chip ID{{CHIP_ID}}
CPU Freq.{{CPU_FREQ}}MHz
Flash size{{FLASH_SIZE}}
Free memory{{FREE_HEAP}}
" + "
" + "
" "" "" }; @@ -644,39 +644,39 @@ const char AutoConnect::_PAGE_STAT[] PROGMEM = { /**< A page that specifies the new configuration. */ const char AutoConnect::_PAGE_CONFIGNEW[] PROGMEM = { "{{HEAD}}" - "AutoConnect config" - "" + "AutoConnect config" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_AUX}}" - "{{MENU_POST}}" - "
" - "
" - "{{LIST_SSID}}" - "
Hidden:{{HIDDEN_COUNT}}
" - "
    " - "
  • " - "" - "" - "
  • " - "
  • " - "" - "" - "
  • " - "
  • " - "
" - "
" - "
" - "
" + "
" + "{{MENU_PRE}}" + "{{MENU_AUX}}" + "{{MENU_POST}}" + "
" + "
" + "{{LIST_SSID}}" + "
Hidden:{{HIDDEN_COUNT}}
" + "
    " + "
  • " + "" + "" + "
  • " + "
  • " + "" + "" + "
  • " + "
  • " + "
" + "
" + "
" + "
" "" "" }; @@ -684,25 +684,25 @@ const char AutoConnect::_PAGE_CONFIGNEW[] PROGMEM = { /**< A page that reads stored authentication information and starts connection. */ const char AutoConnect::_PAGE_OPENCREDT[] PROGMEM = { "{{HEAD}}" - "AutoConnect credentials" - "" + "AutoConnect credentials" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_AUX}}" - "{{MENU_POST}}" - "
" - "
" - "{{OPEN_SSID}}" - "
" - "
" - "
" + "
" + "{{MENU_PRE}}" + "{{MENU_AUX}}" + "{{MENU_POST}}" + "
" + "
" + "{{OPEN_SSID}}" + "
" + "
" + "
" "" "" }; @@ -711,27 +711,29 @@ const char AutoConnect::_PAGE_OPENCREDT[] PROGMEM = { const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = { "{{REQ}}" "{{HEAD}}" - "" - "AutoConnect connecting" - "" - "" + "" + "AutoConnect connecting" + "" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_POST}}" - "
" - "
{{CUR_SSID}}
" - "
" - "
" + "
" + "{{MENU_PRE}}" + "{{MENU_POST}}" + "
" + "
{{CUR_SSID}}
" + "
" + "
" + "
" + "
" "" "" }; @@ -739,52 +741,52 @@ const char AutoConnect::_PAGE_CONNECTING[] PROGMEM = { /**< A page announcing that a connection has been established. */ const char AutoConnect::_PAGE_SUCCESS[] PROGMEM = { "{{HEAD}}" - "AutoConnect statistics" - "" + "AutoConnect statistics" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_AUX}}" - "{{MENU_POST}}" - "
" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "
Established connection{{ESTAB_SSID}}
Mode{{WIFI_MODE}}({{WIFI_STATUS}})
IP{{LOCAL_IP}}
GW{{GATEWAY}}
Subnet mask{{NETMASK}}
Channel{{CHANNEL}}
dBm{{DBM}}
" - "
" - "
" + "
" + "{{MENU_PRE}}" + "{{MENU_AUX}}" + "{{MENU_POST}}" + "
" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "
Established connection{{ESTAB_SSID}}
Mode{{WIFI_MODE}}({{WIFI_STATUS}})
IP{{LOCAL_IP}}
GW{{GATEWAY}}
Subnet mask{{NETMASK}}
Channel{{CHANNEL}}
dBm{{DBM}}
" + "
" + "
" "" "" }; @@ -792,29 +794,29 @@ const char AutoConnect::_PAGE_SUCCESS[] PROGMEM = { /**< A response page for connection failed. */ const char AutoConnect::_PAGE_FAIL[] PROGMEM = { "{{HEAD}}" - "AutoConnect statistics" - "" + "AutoConnect statistics" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_AUX}}" - "{{MENU_POST}}" - "
" - "" - "" - "" - "" - "" - "" - "" - "
Connection Failed{{STATION_STATUS}}
" - "
" - "
" + "
" + "{{MENU_PRE}}" + "{{MENU_AUX}}" + "{{MENU_POST}}" + "
" + "" + "" + "" + "" + "" + "" + "" + "
Connection Failed{{STATION_STATUS}}
" + "
" + "
" "" "" }; @@ -823,17 +825,17 @@ const char AutoConnect::_PAGE_FAIL[] PROGMEM = { const char AutoConnect::_PAGE_DISCONN[] PROGMEM = { "{{DISCONNECT}}" "{{HEAD}}" - "AutoConnect disconnected" - "" + "AutoConnect disconnected" + "" "" "" - "
" - "{{MENU_PRE}}" - "{{MENU_AUX}}" - "{{MENU_POST}}" + "
" + "{{MENU_PRE}}" + "{{MENU_POST}}" + "
" "" "" }; @@ -1172,11 +1174,6 @@ String AutoConnect::_token_CURRENT_SSID(PageArgument& args) { return String(reinterpret_cast(_credential.ssid)); } -String AutoConnect::_token_RESULT_URI(PageArgument& args) { - AC_UNUSED(args); - return _webServer->client().localIP().toString() + String(AUTOCONNECT_URI_RESULT); -} - /** * This function dynamically build up the response pages that conform to * the requested URI. A PageBuilder instance is stored in _rensponsePage @@ -1239,10 +1236,10 @@ PageElement* AutoConnect::_setupPage(String uri) { else if (uri == String(AUTOCONNECT_URI_CONNECT)) { // Setup /auto/connect + _menuTitle = FPSTR("Connecting"); elm->setMold(_PAGE_CONNECTING); elm->addToken(String(FPSTR("REQ")), std::bind(&AutoConnect::_induceConnect, this, std::placeholders::_1)); elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); - elm->addToken(String(FPSTR("URI_RESULT")), std::bind(&AutoConnect::_token_RESULT_URI, this, std::placeholders::_1)); elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); elm->addToken(String(FPSTR("CSS_SPINNER")), std::bind(&AutoConnect::_token_CSS_SPINNER, this, std::placeholders::_1)); elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); @@ -1274,7 +1271,6 @@ PageElement* AutoConnect::_setupPage(String uri) { elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1)); elm->addToken(String(FPSTR("CSS_LUXBAR")), std::bind(&AutoConnect::_token_CSS_LUXBAR, this, std::placeholders::_1)); elm->addToken(String(FPSTR("MENU_PRE")), std::bind(&AutoConnect::_token_MENU_PRE, this, std::placeholders::_1)); - elm->addToken(String(FPSTR("MENU_AUX")), std::bind(&AutoConnect::_token_MENU_AUX, this, std::placeholders::_1)); elm->addToken(String(FPSTR("MENU_POST")), std::bind(&AutoConnect::_token_MENU_POST, this, std::placeholders::_1)); } else if (uri == String(AUTOCONNECT_URI_RESET)) { @@ -1315,6 +1311,7 @@ PageElement* AutoConnect::_setupPage(String uri) { else if (uri == String(AUTOCONNECT_URI_FAIL)) { // Setup /auto/fail + _menuTitle = FPSTR("Failed"); elm->setMold(_PAGE_FAIL); elm->addToken(String(FPSTR("HEAD")), std::bind(&AutoConnect::_token_HEAD, this, std::placeholders::_1)); elm->addToken(String(FPSTR("CSS_BASE")), std::bind(&AutoConnect::_token_CSS_BASE, this, std::placeholders::_1));