ajax test

This commit is contained in:
Shawn A
2018-02-02 14:38:40 -06:00
parent 2e08e7de32
commit b1b34a3c97
3 changed files with 34 additions and 0 deletions
+10
View File
@@ -250,6 +250,7 @@ void WiFiManager::setupConfigPortal() {
server->on("/r", std::bind(&WiFiManager::handleReset, this));
server->on("/exit", std::bind(&WiFiManager::handleExit, this));
server->on("/erase", std::bind(&WiFiManager::handleErase, this));
server->on("/status", std::bind(&WiFiManager::handleWiFiStatus, this));
//server->on("/fwlink", std::bind(&WiFiManager::handleRoot, this)); //Microsoft captive portal. Maybe not needed. Might be handled by notFound handler.
server->onNotFound (std::bind(&WiFiManager::handleNotFound, this));
@@ -827,6 +828,15 @@ String WiFiManager::getParamOut(){
return page;
}
void WiFiManager::handleWiFiStatus(){
DEBUG_WM(F("<- HTTP WiFi status "));
String page;
// String page = "{\"result\":true,\"count\":1}";
page = FPSTR(HTTP_JS);
server->sendHeader("Content-Length", String(page.length()));
server->send(200, "text/html", page);
}
/**
* HTTPD CALLBACK save form and redirect to WLAN config page again
*/