fix info page and adds esp32 aphostname

This commit is contained in:
Shawn A
2018-02-18 10:39:35 -06:00
parent 1d6a7275e7
commit f3db838ae1
2 changed files with 11 additions and 3 deletions
+9 -2
View File
@@ -963,7 +963,7 @@ void WiFiManager::handleInfo() {
F("autoconx")
};
for(int i=0; i<25;i++){
for(int i=0; i<27;i++){
if(infoids[i] != NULL) page += getInfoData(infoids[i]);
}
page += F("</dl>");
@@ -988,6 +988,7 @@ void WiFiManager::handleInfo() {
F("wifihead"),
F("apip"),
F("apmac"),
F("aphost"),
F("apssid"),
F("apbssid"),
F("staip"),
@@ -1000,7 +1001,7 @@ void WiFiManager::handleInfo() {
F("autoconx")
};
for(int i=0; i<19;i++){
for(int i=0; i<23;i++){
if(infoids[i] != NULL) page += getInfoData(infoids[i]);
}
page += F("</dl>");
@@ -1137,6 +1138,12 @@ String WiFiManager::getInfoData(String id){
p = FPSTR(HTTP_INFO_apmac);
p.replace(FPSTR(T_1),(String)WiFi.softAPmacAddress());
}
#ifdef ESP32
else if(id==F("aphost")){
p = FPSTR(HTTP_INFO_aphost);
p.replace(FPSTR(T_1),WiFi.softAPgetHostname());
}
#endif
else if(id==F("apssid")){
p = FPSTR(HTTP_INFO_apssid);
p.replace(FPSTR(T_1),(String)WiFi_SSID());
+2 -1
View File
@@ -114,7 +114,8 @@ const char HTTP_JS[] PROGMEM =
#ifdef ESP32
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp32</h3><hr><dl>";
const char HTTP_INFO_chiprev[] PROGMEM = "<dt>Chip Rev</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_aphost[] PROGMEM = "<dt>Acccess Point Hostname</dt><dd>{1}</dd>";
#else
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp8266</h3><hr><dl>";
const char HTTP_INFO_flashsize[] PROGMEM = "<dt>Real Flash Size</dt><dd>{1} bytes</dd>";