mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Add separate web datalayer
This commit is contained in:
parent
742f51c658
commit
d096caf9bb
6 changed files with 74 additions and 20 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "advanced_battery_html.h"
|
||||
#include <Arduino.h>
|
||||
#include "../../datalayer/datalayer.h"
|
||||
#include "../../datalayer/datalayer_web.h"
|
||||
|
||||
String advanced_battery_processor(const String& var) {
|
||||
if (var == "X") {
|
||||
|
@ -15,7 +16,19 @@ String advanced_battery_processor(const String& var) {
|
|||
// Start a new block with a specific background color
|
||||
content += "<div style='background-color: #303E47; padding: 10px; margin-bottom: 10px;border-radius: 50px'>";
|
||||
|
||||
#ifdef TESLA_BATTERY
|
||||
content += "<h4>Contactor Status: " + String(datalayer_web.tesla.status_contactor) + "</h4>";
|
||||
content += "<h4>HVIL: " + String(datalayer_web.tesla.hvil_status) + "</h4>";
|
||||
content += "<h4>Negative contactor: " + String(datalayer_web.tesla.packContNegativeState) + "</h4>";
|
||||
content += "<h4>Positive contactor: " + String(datalayer_web.tesla.packContPositiveState) + "</h4>";
|
||||
content += "<h4>Contactor set state: " + String(datalayer_web.tesla.packContactorSetState) + "</h4>";
|
||||
content += "<h4>Closing allowed?: " + String(datalayer_web.tesla.packCtrsClosingAllowed) + "</h4>";
|
||||
content += "<h4>Pyrotest: " + String(datalayer_web.tesla.pyroTestInProgress) + "</h4>";
|
||||
#endif
|
||||
|
||||
#ifndef TESLA_BATTERY //Only the listed types have extra info
|
||||
content += "No extra information available for this battery type";
|
||||
#endif
|
||||
|
||||
content += "</div>";
|
||||
|
||||
|
|
|
@ -432,14 +432,6 @@ String processor(const String& var) {
|
|||
content += "body { background-color: black; color: white; }";
|
||||
content += "</style>";
|
||||
|
||||
// Draw buttons
|
||||
content += "<button onclick='OTA()'>Perform OTA update</button> ";
|
||||
content += "<button onclick='Settings()'>Change Settings</button> ";
|
||||
content += "<button onclick='Advanced()'>Advanced Battery Insights</button> ";
|
||||
content += "<button onclick='Cellmon()'>Cellmonitor</button> ";
|
||||
content += "<button onclick='Events()'>Events</button> ";
|
||||
content += "<button onclick='askReboot()'>Reboot Emulator</button>";
|
||||
|
||||
// Start a new block with a specific background color
|
||||
content += "<div style='background-color: #303E47; padding: 10px; margin-bottom: 10px;border-radius: 50px'>";
|
||||
|
||||
|
@ -879,21 +871,18 @@ String processor(const String& var) {
|
|||
#endif // defined CHEVYVOLT_CHARGER || defined NISSANLEAF_CHARGER
|
||||
|
||||
if (emulator_pause_request_ON)
|
||||
content += "<button onclick='PauseBattery(false)'>Resume charge/discharge</button>";
|
||||
content += "<button onclick='PauseBattery(false)'>Resume charge/discharge</button> ";
|
||||
else
|
||||
content +=
|
||||
"<button onclick=\"if(confirm('Are you sure you want to pause charging and discharging? This will set the "
|
||||
"maximum charge and discharge values to zero, preventing any further power flow.')) { PauseBattery(true); "
|
||||
"}\">Pause charge/discharge</button>";
|
||||
content += " ";
|
||||
content += "<button onclick='OTA()'>Perform OTA update</button>";
|
||||
content += " ";
|
||||
content += "<button onclick='Settings()'>Change Settings</button>";
|
||||
content += " ";
|
||||
content += "<button onclick='Cellmon()'>Cellmonitor</button>";
|
||||
content += " ";
|
||||
content += "<button onclick='Events()'>Events</button>";
|
||||
content += " ";
|
||||
"}\">Pause charge/discharge</button> ";
|
||||
|
||||
content += "<button onclick='OTA()'>Perform OTA update</button> ";
|
||||
content += "<button onclick='Settings()'>Change Settings</button> ";
|
||||
content += "<button onclick='Advanced()'>Advanced Battery Insights</button> ";
|
||||
content += "<button onclick='Cellmon()'>Cellmonitor</button> ";
|
||||
content += "<button onclick='Events()'>Events</button> ";
|
||||
content += "<button onclick='askReboot()'>Reboot Emulator</button>";
|
||||
if (WEBSERVER_AUTH_REQUIRED)
|
||||
content += "<button onclick='logout()'>Logout</button>";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue