Fix Wifi reconfigure
This commit is contained in:
@@ -4041,10 +4041,11 @@ esp_err_t WebCfgServer::buildConfigureWifiHtml(PsychicRequest *request)
|
|||||||
PsychicStreamResponse response(request, "text/plain");
|
PsychicStreamResponse response(request, "text/plain");
|
||||||
response.beginSend();
|
response.beginSend();
|
||||||
buildHtmlHeader(&response);
|
buildHtmlHeader(&response);
|
||||||
|
response.print("<form method=\"get\" action=\"wifimanager\">");
|
||||||
response.print("<h3>Wi-Fi</h3>");
|
response.print("<h3>Wi-Fi</h3>");
|
||||||
response.print("Click confirm to remove saved WiFi settings and restart ESP into Wi-Fi configuration mode. After restart, connect to ESP access point to reconfigure Wi-Fi.<br><br>");
|
response.print("Click confirm to remove saved WiFi settings and restart ESP into Wi-Fi configuration mode. After restart, connect to ESP access point to reconfigure Wi-Fi.<br><br><br>");
|
||||||
String wifiMgrUrl = "/wifimanager?CONFIRMTOKEN=" + _confirmCode;
|
response.print("<input type=\"hidden\" name=\"CONFIRMTOKEN\" value=\"" + _confirmCode + "\" /><input type=\"submit\" value=\"Reboot\" /></form>");
|
||||||
buildNavigationButton(&response, "Confirm", wifiMgrUrl.c_str());
|
response.print("</form>");
|
||||||
response.print("</body></html>");
|
response.print("</body></html>");
|
||||||
return response.endSend();
|
return response.endSend();
|
||||||
}
|
}
|
||||||
@@ -4896,18 +4897,6 @@ void WebCfgServer::printDropDown(PsychicStreamResponse *response, const char *to
|
|||||||
response->print("</td></tr>");
|
response->print("</td></tr>");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebCfgServer::buildNavigationButton(PsychicStreamResponse *response, const char *caption, const char *targetPath, const char* labelText)
|
|
||||||
{
|
|
||||||
response->print("<form method=\"get\" action=\"");
|
|
||||||
response->print(targetPath);
|
|
||||||
response->print("\">");
|
|
||||||
response->print("<button type=\"submit\">");
|
|
||||||
response->print(caption);
|
|
||||||
response->print("</button> ");
|
|
||||||
response->print(labelText);
|
|
||||||
response->print("</form>");
|
|
||||||
}
|
|
||||||
|
|
||||||
void WebCfgServer::buildNavigationMenuEntry(PsychicStreamResponse *response, const char *title, const char *targetPath, const char* warningMessage)
|
void WebCfgServer::buildNavigationMenuEntry(PsychicStreamResponse *response, const char *title, const char *targetPath, const char* warningMessage)
|
||||||
{
|
{
|
||||||
response->print("<a href=\"");
|
response->print("<a href=\"");
|
||||||
|
|||||||
@@ -72,7 +72,6 @@ private:
|
|||||||
esp_err_t processFactoryReset(PsychicRequest *request);
|
esp_err_t processFactoryReset(PsychicRequest *request);
|
||||||
void printTextarea(PsychicStreamResponse *response, const char *token, const char *description, const char *value, const size_t& maxLength, const bool& enabled = true, const bool& showLengthRestriction = false);
|
void printTextarea(PsychicStreamResponse *response, const char *token, const char *description, const char *value, const size_t& maxLength, const bool& enabled = true, const bool& showLengthRestriction = false);
|
||||||
void printDropDown(PsychicStreamResponse *response, const char *token, const char *description, const String preselectedValue, std::vector<std::pair<String, String>> options, const String className);
|
void printDropDown(PsychicStreamResponse *response, const char *token, const char *description, const String preselectedValue, std::vector<std::pair<String, String>> options, const String className);
|
||||||
void buildNavigationButton(PsychicStreamResponse *response, const char* caption, const char* targetPath, const char* labelText = "");
|
|
||||||
void buildNavigationMenuEntry(PsychicStreamResponse *response, const char *title, const char *targetPath, const char* warningMessage = "");
|
void buildNavigationMenuEntry(PsychicStreamResponse *response, const char *title, const char *targetPath, const char* warningMessage = "");
|
||||||
|
|
||||||
const std::vector<std::pair<String, String>> getNetworkDetectionOptions() const;
|
const std::vector<std::pair<String, String>> getNetworkDetectionOptions() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user