mirror of
https://github.com/s00500/ESPUI.git
synced 2025-06-14 02:30:41 +00:00
Add captive portal functionality, update examples and documentation.
This commit is contained in:
@ -1351,7 +1351,16 @@ void ESPUIClass::beginLITTLEFS(const char* _title, const char* username, const c
|
||||
request->send(200, "text/plain", String(ESP.getFreeHeap()) + " In LITTLEFS mode");
|
||||
});
|
||||
|
||||
server->onNotFound([](AsyncWebServerRequest* request) { request->send(404); });
|
||||
server->onNotFound([this](AsyncWebServerRequest* request) {
|
||||
if(captivePortal == true)
|
||||
{
|
||||
request->redirect("/");
|
||||
}
|
||||
else
|
||||
{
|
||||
request->send(404);
|
||||
}
|
||||
});
|
||||
|
||||
server->begin();
|
||||
|
||||
@ -1496,7 +1505,16 @@ void ESPUIClass::begin(const char* _title, const char* username, const char* pas
|
||||
request->send(200, "text/plain", String(ESP.getFreeHeap()) + " In Memorymode");
|
||||
});
|
||||
|
||||
server->onNotFound([](AsyncWebServerRequest* request) { request->send(404); });
|
||||
server->onNotFound([this](AsyncWebServerRequest* request) {
|
||||
if(captivePortal == true)
|
||||
{
|
||||
request->redirect("/");
|
||||
}
|
||||
else
|
||||
{
|
||||
request->send(404);
|
||||
}
|
||||
});
|
||||
|
||||
server->begin();
|
||||
|
||||
|
@ -236,6 +236,7 @@ public:
|
||||
unsigned int jsonUpdateDocumentSize;
|
||||
unsigned int jsonInitialDocumentSize;
|
||||
bool sliderContinuous;
|
||||
bool captivePortal = false;
|
||||
|
||||
void setVerbosity(Verbosity verbosity);
|
||||
void begin(const char* _title, const char* username = nullptr, const char* password = nullptr,
|
||||
|
Reference in New Issue
Block a user