mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-13 14:51:21 +10:00
add esp model and wifi mode status to info page headers
This commit is contained in:
+9
-4
@@ -2052,9 +2052,14 @@ void WiFiManager::handleInfo() {
|
||||
String WiFiManager::getInfoData(String id){
|
||||
|
||||
String p;
|
||||
// @todo add WM versioning
|
||||
if(id==F("esphead"))p = FPSTR(HTTP_INFO_esphead);
|
||||
else if(id==F("wifihead"))p = FPSTR(HTTP_INFO_wifihead);
|
||||
if(id==F("esphead")){
|
||||
p = FPSTR(HTTP_INFO_esphead);
|
||||
p.replace(FPSTR(T_1),(String)ESP.getChipModel());
|
||||
}
|
||||
else if(id==F("wifihead")){
|
||||
p = FPSTR(HTTP_INFO_wifihead);
|
||||
p.replace(FPSTR(T_1),getModeString(WiFi.getMode()));
|
||||
}
|
||||
else if(id==F("uptime")){
|
||||
// subject to rollover!
|
||||
p = FPSTR(HTTP_INFO_uptime);
|
||||
@@ -2107,7 +2112,7 @@ String WiFiManager::getInfoData(String id){
|
||||
p = FPSTR(HTTP_INFO_bootver);
|
||||
p.replace(FPSTR(T_1),(String)system_get_boot_version());
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
else if(id==F("cpufreq")){
|
||||
p = FPSTR(HTTP_INFO_cpufreq);
|
||||
p.replace(FPSTR(T_1),(String)ESP.getCpuFreqMHz());
|
||||
|
||||
+2
-2
@@ -173,7 +173,7 @@ const char HTTP_JS[] PROGMEM =
|
||||
// Info html
|
||||
// @todo remove html elements from progmem, repetetive strings
|
||||
#ifdef ESP32
|
||||
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp32</h3><hr><dl>";
|
||||
const char HTTP_INFO_esphead[] PROGMEM = "<h3>{1}</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_aphost[] PROGMEM = "<dt>Access Point Hostname</dt><dd>{1}</dd>";
|
||||
@@ -192,7 +192,7 @@ const char HTTP_JS[] PROGMEM =
|
||||
const char HTTP_INFO_memsmeter[] PROGMEM = "<br/><progress value='{1}' max='{2}'></progress></dd>";
|
||||
const char HTTP_INFO_memsketch[] PROGMEM = "<dt>Memory - Sketch Size</dt><dd>Used / Total bytes<br/>{1} / {2}";
|
||||
const char HTTP_INFO_freeheap[] PROGMEM = "<dt>Memory - Free Heap</dt><dd>{1} bytes available</dd>";
|
||||
const char HTTP_INFO_wifihead[] PROGMEM = "<br/><h3>WiFi</h3><hr>";
|
||||
const char HTTP_INFO_wifihead[] PROGMEM = "<br/><h3>WiFi <small><em>({1})</em></small></h3><hr>";
|
||||
const char HTTP_INFO_uptime[] PROGMEM = "<dt>Uptime</dt><dd>{1} Mins {2} Secs</dd>";
|
||||
const char HTTP_INFO_chipid[] PROGMEM = "<dt>Chip ID</dt><dd>{1}</dd>";
|
||||
const char HTTP_INFO_idesize[] PROGMEM = "<dt>Flash Size</dt><dd>{1} bytes</dd>";
|
||||
|
||||
Reference in New Issue
Block a user