* fix MDNS #1538
* improved Wizard
* improved MqTT on devcontrol e.g. set power limit
This commit is contained in:
lumapu 2024-04-01 17:02:43 +02:00
parent bcc52c793c
commit 4d5ae72cb6
15 changed files with 86 additions and 77 deletions

View file

@ -57,7 +57,8 @@ class Web {
mConfig = config;
DPRINTLN(DBG_VERBOSE, F("app::setup-on"));
mWeb.on("/", HTTP_GET, std::bind(&Web::onIndex, this, std::placeholders::_1));
mWeb.on("/", HTTP_GET, std::bind(&Web::onIndex, this, std::placeholders::_1, true));
mWeb.on("/index", HTTP_GET, std::bind(&Web::onIndex, this, std::placeholders::_1, false));
mWeb.on("/login", HTTP_ANY, std::bind(&Web::onLogin, this, std::placeholders::_1));
mWeb.on("/logout", HTTP_GET, std::bind(&Web::onLogout, this, std::placeholders::_1));
mWeb.on("/colors.css", HTTP_GET, std::bind(&Web::onColor, this, std::placeholders::_1));
@ -319,7 +320,11 @@ class Web {
client->send("hello!", NULL, millis(), 1000);
}
void onIndex(AsyncWebServerRequest *request) {
void onIndex(AsyncWebServerRequest *request, bool checkAp = true) {
if(mApp->isApActive() && checkAp) {
onWizard(request);
return;
}
getPage(request, PROT_MASK_INDEX, index_html, index_html_len);
}