mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
update template styles, add versionng to info
This commit is contained in:
+39
-13
@@ -1887,7 +1887,7 @@ void WiFiManager::handleInfo() {
|
||||
//@todo convert to enum or refactor to strings
|
||||
//@todo wrap in build flag to remove all info code for memory saving
|
||||
#ifdef ESP8266
|
||||
infos = 29;
|
||||
infos = 28;
|
||||
String infoids[] = {
|
||||
F("esphead"),
|
||||
F("uptime"),
|
||||
@@ -1895,7 +1895,6 @@ void WiFiManager::handleInfo() {
|
||||
F("fchipid"),
|
||||
F("idesize"),
|
||||
F("flashsize"),
|
||||
F("sdkver"),
|
||||
F("corever"),
|
||||
F("bootver"),
|
||||
F("cpufreq"),
|
||||
@@ -1922,7 +1921,7 @@ void WiFiManager::handleInfo() {
|
||||
|
||||
#elif defined(ESP32)
|
||||
// add esp_chip_info ?
|
||||
infos = 27;
|
||||
infos = 26;
|
||||
String infoids[] = {
|
||||
F("esphead"),
|
||||
F("uptime"),
|
||||
@@ -1930,7 +1929,6 @@ void WiFiManager::handleInfo() {
|
||||
F("chiprev"),
|
||||
F("idesize"),
|
||||
F("flashsize"),
|
||||
F("sdkver"),
|
||||
F("cpufreq"),
|
||||
F("freeheap"),
|
||||
F("memsketch"),
|
||||
@@ -1959,6 +1957,14 @@ void WiFiManager::handleInfo() {
|
||||
if(infoids[i] != NULL) page += getInfoData(infoids[i]);
|
||||
}
|
||||
page += F("</dl>");
|
||||
|
||||
page += F("<h3>About</h3><hr><dl>");
|
||||
page += getInfoData("aboutver");
|
||||
page += getInfoData("aboutarduinover");
|
||||
page += getInfoData("aboutidfver");
|
||||
page += getInfoData("aboutdate");
|
||||
page += F("</dl>");
|
||||
|
||||
if(_showInfoUpdate){
|
||||
page += HTTP_PORTAL_MENU[8];
|
||||
page += HTTP_PORTAL_MENU[9];
|
||||
@@ -2022,15 +2028,6 @@ String WiFiManager::getInfoData(String id){
|
||||
p.replace(FPSTR(T_1),(String)ESP.getPsramSize());
|
||||
#endif
|
||||
}
|
||||
else if(id==F("sdkver")){
|
||||
p = FPSTR(HTTP_INFO_sdkver);
|
||||
#ifdef ESP32
|
||||
p.replace(FPSTR(T_1),(String)esp_get_idf_version());
|
||||
// p.replace(FPSTR(T_1),(String)system_get_sdk_version()); // deprecated
|
||||
#else
|
||||
p.replace(FPSTR(T_1),(String)system_get_sdk_version());
|
||||
#endif
|
||||
}
|
||||
else if(id==F("corever")){
|
||||
#ifdef ESP8266
|
||||
p = FPSTR(HTTP_INFO_corever);
|
||||
@@ -2177,6 +2174,35 @@ String WiFiManager::getInfoData(String id){
|
||||
p.replace(FPSTR(T_3),"NA");
|
||||
}
|
||||
#endif
|
||||
else if(id==F("aboutver")){
|
||||
p = FPSTR(HTTP_INFO_aboutver);
|
||||
p.replace(FPSTR(T_1),FPSTR(WM_VERSION_STR));
|
||||
}
|
||||
else if(id==F("aboutarduinover")){
|
||||
#ifdef VER_ARDUINO_STR
|
||||
p = FPSTR(HTTP_INFO_aboutarduino);
|
||||
p.replace(FPSTR(T_1),String(VER_ARDUINO_STR));
|
||||
#endif
|
||||
}
|
||||
// else if(id==F("aboutidfver")){
|
||||
// #ifdef VER_IDF_STR
|
||||
// p = FPSTR(HTTP_INFO_aboutidf);
|
||||
// p.replace(FPSTR(T_1),String(VER_IDF_STR));
|
||||
// #endif
|
||||
// }
|
||||
else if(id==F("aboutsdkver")){
|
||||
p = FPSTR(HTTP_INFO_sdkver);
|
||||
#ifdef ESP32
|
||||
p.replace(FPSTR(T_1),(String)esp_get_idf_version());
|
||||
// p.replace(FPSTR(T_1),(String)system_get_sdk_version()); // deprecated
|
||||
#else
|
||||
p.replace(FPSTR(T_1),(String)system_get_sdk_version());
|
||||
#endif
|
||||
}
|
||||
else if(id==F("aboutdate")){
|
||||
p = FPSTR(HTTP_INFO_aboutdate);
|
||||
p.replace(FPSTR(T_1),String(__DATE__) + " " + String(__TIME__));
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
+25
-22
@@ -48,6 +48,31 @@
|
||||
|
||||
#define G(string_literal) (String(FPSTR(string_literal)).c_str())
|
||||
|
||||
#define STRING2(x) #x
|
||||
#define STRING(x) STRING2(x)
|
||||
|
||||
// #include <esp_idf_version.h>
|
||||
#ifdef ESP_IDF_VERSION
|
||||
// #pragma message "ESP_IDF_VERSION_MAJOR = " STRING(ESP_IDF_VERSION_MAJOR)
|
||||
// #pragma message "ESP_IDF_VERSION_MINOR = " STRING(ESP_IDF_VERSION_MINOR)
|
||||
// #pragma message "ESP_IDF_VERSION_PATCH = " STRING(ESP_IDF_VERSION_PATCH)
|
||||
#define VER_IDF_STR STRING(ESP_IDF_VERSION_MAJOR) "." STRING(ESP_IDF_VERSION_MINOR) "." STRING(ESP_IDF_VERSION_PATCH)
|
||||
#endif
|
||||
|
||||
// #include "esp_arduino_version.h"
|
||||
#ifdef ESP_ARDUINO_VERSION
|
||||
// #pragma message "ESP_ARDUINO_VERSION_MAJOR = " STRING(ESP_ARDUINO_VERSION_MAJOR)
|
||||
// #pragma message "ESP_ARDUINO_VERSION_MINOR = " STRING(ESP_ARDUINO_VERSION_MINOR)
|
||||
// #pragma message "ESP_ARDUINO_VERSION_PATCH = " STRING(ESP_ARDUINO_VERSION_PATCH)
|
||||
#define VER_ARDUINO_STR STRING(ESP_ARDUINO_VERSION_MAJOR) "." STRING(ESP_ARDUINO_VERSION_MINOR) "." STRING(ESP_ARDUINO_VERSION_PATCH)
|
||||
#else
|
||||
#include <core_version.h>
|
||||
// #pragma message "ESP_ARDUINO_VERSION_GIT = " STRING(ARDUINO_ESP32_GIT_VER)// 0x46d5afb1
|
||||
// #pragma message "ESP_ARDUINO_VERSION_DESC = " STRING(ARDUINO_ESP32_GIT_DESC) // 1.0.6
|
||||
#define VER_ARDUINO_STR STRING(ARDUINO_ESP32_GIT_DESC)
|
||||
// #pragma message "ESP_ARDUINO_VERSION_REL = " STRING(ARDUINO_ESP32_RELEASE) //"1_0_6"
|
||||
#endif
|
||||
|
||||
#ifdef ESP8266
|
||||
|
||||
extern "C" {
|
||||
@@ -65,28 +90,6 @@
|
||||
|
||||
#elif defined(ESP32)
|
||||
|
||||
// #define STRING2(x) #x
|
||||
// #define STRING(x) STRING2(x)
|
||||
|
||||
// // #include <esp_idf_version.h>
|
||||
// #ifdef ESP_IDF_VERSION
|
||||
// #pragma message "ESP_IDF_VERSION_MAJOR = " STRING(ESP_IDF_VERSION_MAJOR)
|
||||
// #pragma message "ESP_IDF_VERSION_MINOR = " STRING(ESP_IDF_VERSION_MINOR)
|
||||
// #pragma message "ESP_IDF_VERSION_PATCH = " STRING(ESP_IDF_VERSION_PATCH)
|
||||
// #endif
|
||||
|
||||
// // #include "esp_arduino_version.h"
|
||||
// #ifdef ESP_ARDUINO_VERSION
|
||||
// #pragma message "ESP_ARDUINO_VERSION_MAJOR = " STRING(ESP_ARDUINO_VERSION_MAJOR)
|
||||
// #pragma message "ESP_ARDUINO_VERSION_MINOR = " STRING(ESP_ARDUINO_VERSION_MINOR)
|
||||
// #pragma message "ESP_ARDUINO_VERSION_PATCH = " STRING(ESP_ARDUINO_VERSION_PATCH)
|
||||
// #else
|
||||
// #include <core_version.h>
|
||||
// #pragma message "ESP_ARDUINO_VERSION_GIT = " STRING(ARDUINO_ESP32_GIT_VER)// 0x46d5afb1
|
||||
// #pragma message "ESP_ARDUINO_VERSION_DESC = " STRING(ARDUINO_ESP32_GIT_DESC) // 1.0.6
|
||||
// // #pragma message "ESP_ARDUINO_VERSION_REL = " STRING(ARDUINO_ESP32_RELEASE) //"1_0_6"
|
||||
// #endif
|
||||
|
||||
#include <WiFi.h>
|
||||
#include <esp_wifi.h>
|
||||
#include <Update.h>
|
||||
|
||||
@@ -173,10 +173,29 @@ button.D{
|
||||
background-color:#dc3630;
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
opacity: 0.5;
|
||||
button{
|
||||
/*transition: 0s filter;*/
|
||||
transition: 0s opacity;
|
||||
transition-delay: 3s;
|
||||
transition-duration: 0s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:active{
|
||||
opacity: 50% !important;
|
||||
/*filter: brightness(50%);*/
|
||||
cursor: wait;
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
button:hover{
|
||||
/*opacity: 80%;*/
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
opacity: 0.5;
|
||||
/* not working in cp ?? */
|
||||
}
|
||||
</style>
|
||||
<!-- /HTTP_STYLE -->
|
||||
<!-- HTTP_SCRIPT -->
|
||||
@@ -318,7 +337,12 @@ input:disabled {
|
||||
<tr><td><a href='/erase'>/erase</a></td>
|
||||
<td>Erase WiFi configuration and reboot Device. Device will not reconnect to a network until new WiFi configuration data is entered.</td></tr>
|
||||
</table>
|
||||
<p/>More information about WiFiManager at <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>
|
||||
<h3>About</h3><hr>
|
||||
Version v1.x.x-xxxxx<Br/>
|
||||
Build_date<br/>
|
||||
Build_file<br/>
|
||||
Arduino_version<br/>
|
||||
<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>
|
||||
<!-- /HTTP_HELP -->
|
||||
<!-- FORM_UPLOAD -->
|
||||
<Br/><br/>Form UPLOAD<br/>
|
||||
|
||||
+9
-1
@@ -13,9 +13,12 @@
|
||||
#ifndef _WM_STRINGS_H_
|
||||
#define _WM_STRINGS_H_
|
||||
|
||||
|
||||
#ifndef WIFI_MANAGER_OVERRIDE_STRINGS
|
||||
// !!! ABOVE WILL NOT WORK if you define in your sketch, must be build flag, if anyone one knows how to order includes to be able to do this it would be neat.. I have seen it done..
|
||||
|
||||
const char WM_VERSION_STR[] PROGMEM = "v1.0.10-beta";
|
||||
|
||||
const char HTTP_HEAD_START[] PROGMEM = "<!DOCTYPE html>"
|
||||
"<html lang='en'><head>"
|
||||
"<meta name='format-detection' content='telephone=no'>"
|
||||
@@ -136,7 +139,7 @@ const char HTTP_HELP[] PROGMEM =
|
||||
"<tr><td>/erase</td>"
|
||||
"<td>Erase WiFi configuration and reboot Device. Device will not reconnect to a network until new WiFi configuration data is entered.</td></tr>"
|
||||
"</table>"
|
||||
"<p/>More information about WiFiManager at <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
|
||||
"<p/>Github <a href='https://github.com/tzapu/WiFiManager'>https://github.com/tzapu/WiFiManager</a>.";
|
||||
#else
|
||||
const char HTTP_HELP[] PROGMEM = "";
|
||||
#endif
|
||||
@@ -166,6 +169,7 @@ const char HTTP_JS[] PROGMEM =
|
||||
#endif
|
||||
|
||||
// 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_chiprev[] PROGMEM = "<dt>Chip Rev</dt><dd>{1}</dd>";
|
||||
@@ -205,6 +209,10 @@ const char HTTP_INFO_stamac[] PROGMEM = "<dt>Station MAC</dt><dd>{1}</dd>";
|
||||
const char HTTP_INFO_conx[] PROGMEM = "<dt>Connected</dt><dd>{1}</dd>";
|
||||
const char HTTP_INFO_autoconx[] PROGMEM = "<dt>Autoconnect</dt><dd>{1}</dd>";
|
||||
|
||||
const char HTTP_INFO_aboutver[] PROGMEM = "<dt>WiFiManager</dt><dd>{1}</dd>";
|
||||
const char HTTP_INFO_aboutarduino[] PROGMEM = "<dt>Arduino</dt><dd>{1}</dd>";
|
||||
const char HTTP_INFO_aboutsdk[] PROGMEM = "<dt>ESP-SDK/IDF</dt><dd>{1}</dd>";
|
||||
const char HTTP_INFO_aboutdate[] PROGMEM = "<dt>Build Date</dt><dd>{1}</dd>";
|
||||
|
||||
const char S_brand[] PROGMEM = "WiFiManager";
|
||||
const char S_debugPrefix[] PROGMEM = "*wm:";
|
||||
|
||||
Reference in New Issue
Block a user