mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 01:39:30 +02:00
Merge pull request #1514 from dalathegreat/bugfix/AP-password
Bugfix: Add AP password to settings page
This commit is contained in:
commit
edb69472c3
3 changed files with 10 additions and 1 deletions
|
@ -163,7 +163,7 @@ void init_stored_settings() {
|
|||
|
||||
// WIFI AP is enabled by default unless disabled in the settings
|
||||
wifiap_enabled = settings.getBool("WIFIAPENABLED", true);
|
||||
wifi_channel = settings.getUInt("WIFICHANNEL", 2000);
|
||||
wifi_channel = settings.getUInt("WIFICHANNEL", 0);
|
||||
passwordAP = settings.getString("APPASSWORD", "123456789").c_str();
|
||||
mqtt_enabled = settings.getBool("MQTTENABLED", false);
|
||||
mqtt_timeout_ms = settings.getUInt("MQTTTIMEOUT", 2000);
|
||||
|
|
|
@ -291,6 +291,10 @@ String settings_processor(const String& var, BatteryEmulatorSettingsStore& setti
|
|||
return settings.getBool("WIFIAPENABLED", wifiap_enabled) ? "checked" : "";
|
||||
}
|
||||
|
||||
if (var == "APPASSWORD") {
|
||||
return settings.getString("APPASSWORD", "123456789");
|
||||
}
|
||||
|
||||
if (var == "STATICIP") {
|
||||
return settings.getBool("STATICIP") ? "checked" : "";
|
||||
}
|
||||
|
@ -1148,6 +1152,9 @@ const char* getCANInterfaceName(CAN_Interface interface) {
|
|||
<label>Broadcast Wifi access point: </label>
|
||||
<input type='checkbox' name='WIFIAPENABLED' value='on' %WIFIAPENABLED% />
|
||||
|
||||
<label>Access point password: </label>
|
||||
<input type='text' name='APPASSWORD' value="%APPASSWORD%" />
|
||||
|
||||
<label>Wifi channel 0-14: </label>
|
||||
<input name='WIFICHANNEL' type='text' value="%WIFICHANNEL%" pattern="^[0-9]+$" />
|
||||
|
||||
|
|
|
@ -509,6 +509,8 @@ void init_webserver() {
|
|||
} else if (p->name() == "SUBNET4") {
|
||||
auto type = atoi(p->value().c_str());
|
||||
settings.saveUInt("SUBNET4", type);
|
||||
} else if (p->name() == "APPASSWORD") {
|
||||
settings.saveString("APPASSWORD", p->value().c_str());
|
||||
} else if (p->name() == "HOSTNAME") {
|
||||
settings.saveString("HOSTNAME", p->value().c_str());
|
||||
} else if (p->name() == "MQTTSERVER") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue