mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-04 19:51:38 +02:00
0.8.94
* switched AsyncWebServer library * Ethernet version now uses same AsyncWebServer library as Wifi version * fix languange of `/history` * fix RSSI on `/history` #1463
This commit is contained in:
parent
3d2ed81adf
commit
0499d32c12
11 changed files with 99 additions and 205 deletions
|
@ -350,8 +350,9 @@ class RestApi {
|
|||
|
||||
void getGeneric(AsyncWebServerRequest *request, JsonObject obj) {
|
||||
mApp->resetLockTimeout();
|
||||
|
||||
#if !defined(ETHERNET)
|
||||
obj[F("wifi_rssi")] = (WiFi.status() != WL_CONNECTED) ? 0 : WiFi.RSSI();
|
||||
#endif
|
||||
obj[F("ts_uptime")] = mApp->getUptime();
|
||||
obj[F("ts_now")] = mApp->getTimestamp();
|
||||
obj[F("version")] = String(mApp->getVersion());
|
||||
|
@ -378,12 +379,13 @@ class RestApi {
|
|||
obj[F("ssid")] = mConfig->sys.stationSsid;
|
||||
obj[F("ap_pwd")] = mConfig->sys.apPwd;
|
||||
obj[F("hidd")] = mConfig->sys.isHidden;
|
||||
obj[F("mac")] = WiFi.macAddress();
|
||||
obj[F("wifi_channel")] = WiFi.channel();
|
||||
#endif /* !defined(ETHERNET) */
|
||||
obj[F("device_name")] = mConfig->sys.deviceName;
|
||||
obj[F("dark_mode")] = (bool)mConfig->sys.darkMode;
|
||||
obj[F("sched_reboot")] = (bool)mConfig->sys.schedReboot;
|
||||
|
||||
obj[F("mac")] = WiFi.macAddress();
|
||||
obj[F("hostname")] = mConfig->sys.deviceName;
|
||||
obj[F("pwd_set")] = (strlen(mConfig->sys.adminPwd) > 0);
|
||||
obj[F("prot_mask")] = mConfig->sys.protectionMask;
|
||||
|
@ -393,7 +395,6 @@ class RestApi {
|
|||
obj[F("heap_free")] = mHeapFree;
|
||||
obj[F("sketch_total")] = ESP.getFreeSketchSpace();
|
||||
obj[F("sketch_used")] = ESP.getSketchSize() / 1024; // in kb
|
||||
obj[F("wifi_channel")] = WiFi.channel();
|
||||
getGeneric(request, obj);
|
||||
|
||||
getRadioNrf(obj.createNestedObject(F("radioNrf")));
|
||||
|
@ -426,9 +427,9 @@ class RestApi {
|
|||
//obj[F("littlefs_total")] = LittleFS.totalBytes();
|
||||
//obj[F("littlefs_used")] = LittleFS.usedBytes();
|
||||
|
||||
uint8_t max;
|
||||
/*uint8_t max;
|
||||
mApp->getSchedulerInfo(&max);
|
||||
obj[F("schMax")] = max;
|
||||
obj[F("schMax")] = max;*/
|
||||
}
|
||||
|
||||
void getHtmlSystem(AsyncWebServerRequest *request, JsonObject obj) {
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
{#HTML_NAV}
|
||||
<div id="wrapper">
|
||||
<div id="content">
|
||||
<h3>Total Power</h3>
|
||||
<h3>{#TOTAL_POWER}</h3>
|
||||
<div class="chartDiv" id="pwrChart"></div>
|
||||
<h3>Total Power Today</h3>
|
||||
<h3>{#TOTAL_POWER_DAY}</h3>
|
||||
<div class="chartDiv" id="pwrDayChart"></div>
|
||||
<!--IF_ENABLE_HISTORY_YIELD_PER_DAY-->
|
||||
<h3>Total Yield per day</h3>
|
||||
<h3>{#TOTAL_YIELD_PER_DAY}</h3>
|
||||
<div class="chartDiv" id="ydChart"></div>
|
||||
<!--ENDIF_ENABLE_HISTORY_YIELD_PER_DAY-->
|
||||
<!--IF_ENABLE_HISTORY_LOAD_DATA-->
|
||||
|
@ -136,8 +136,8 @@
|
|||
return [
|
||||
mlNs("polyline", {stroke: "url(#gLine)", fill: "none", points: pts}),
|
||||
mlNs("polyline", {stroke: "none", fill: "url(#gFill)", points: pts2}),
|
||||
mlNs("text", {x: i*.8, y: 10}, "Maximum: " + String(obj.max) + "W"),
|
||||
mlNs("text", {x: i*.8, y: 25}, "Last: " + String(lastVal) + "W")
|
||||
mlNs("text", {x: i*.8, y: 10}, "{#MAX_DAY}: " + String(obj.max) + "W"),
|
||||
mlNs("text", {x: i*.8, y: 25}, "{#LAST_VALUE}: " + String(lastVal) + "W")
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,9 @@
|
|||
function parsePowerHistory(obj){
|
||||
if(once) {
|
||||
once = false
|
||||
parseNav(obj.generic);
|
||||
parseNav(obj.generic)
|
||||
parseESP(obj.generic)
|
||||
parseRssi(obj.generic)
|
||||
window.setInterval("getAjax('/api/powerHistory', parsePowerHistory)", obj.refresh * 1000)
|
||||
setTimeout(() => {
|
||||
window.setInterval("getAjax('/api/powerHistoryDay', parsePowerHistoryDay)", refresh * 1000)
|
||||
|
|
|
@ -1528,16 +1528,6 @@
|
|||
"en": "Total Power",
|
||||
"de": "Gesamtleistung"
|
||||
},
|
||||
{
|
||||
"token": "LAST",
|
||||
"en": "Last",
|
||||
"de": "Die letzten"
|
||||
},
|
||||
{
|
||||
"token": "VALUES",
|
||||
"en": "values",
|
||||
"de": "Werte"
|
||||
},
|
||||
{
|
||||
"token": "TOTAL_POWER_DAY",
|
||||
"en": "Total Power Today",
|
||||
|
@ -1557,21 +1547,6 @@
|
|||
"token": "LAST_VALUE",
|
||||
"en": "Last value",
|
||||
"de": "Letzter Wert"
|
||||
},
|
||||
{
|
||||
"token": "MAXIMUM",
|
||||
"en": "Maximum value",
|
||||
"de": "Maximalwert"
|
||||
},
|
||||
{
|
||||
"token": "UPDATED",
|
||||
"en": "Updated every",
|
||||
"de": "Aktualisiert alle"
|
||||
},
|
||||
{
|
||||
"token": "SECONDS",
|
||||
"en": "seconds",
|
||||
"de": "Sekunden"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue