some Bugfixes in WebUI and debugger
This commit is contained in:
parent
25f05ed832
commit
2fea8cfdd6
@ -71,7 +71,7 @@
|
||||
<p>
|
||||
<h4>Akkuladestand</h4>
|
||||
<div class="progress">
|
||||
<div id="battery_level" class="data-battery_level progress-bar text-light" role="progressbar" aria-valuenow="0"
|
||||
<div id="batterylevel" class="data-batterylevel progress-bar text-light" role="progressbar" aria-valuenow="0"
|
||||
aria-valuemin="0" aria-valuemax="100" style="width: 0%">
|
||||
0
|
||||
</div>
|
||||
@ -111,6 +111,11 @@
|
||||
<div id="time_faction2" class="data-time_faction2 col text-center bg-secondary text-white p-3 format-time">0</div>
|
||||
<div id="time_faction3" class="data-time_faction3 col text-center bg-secondary text-white p-3 format-time">0</div>
|
||||
</div>
|
||||
<div class="row mt-3">
|
||||
<div class="col text-center"><button id="faction1" class="btn-wsevent btn btn-outline-primary">Aktivieren</button></div>
|
||||
<div class="col text-center"><button id="faction2" class="btn-wsevent btn btn-outline-primary">Aktivieren</button></div>
|
||||
<div class="col text-center"><button id="faction3" class="btn-wsevent btn btn-outline-primary">Aktivieren</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</p>
|
||||
<!-- Div GroupFaction Points -->
|
||||
|
@ -216,18 +216,12 @@ function formatTime(seconds) {
|
||||
|
||||
function updateFactionLogo(element, faction) {
|
||||
const glowClass = "glow-active-faction";
|
||||
const factionClasses = ["faction1", "faction2", "faction3"];
|
||||
|
||||
factionClasses.forEach((factionClass) => {
|
||||
if (
|
||||
factionClass === "faction" + faction &&
|
||||
element.classList.contains(factionClass)
|
||||
) {
|
||||
element.classList.add(glowClass);
|
||||
} else {
|
||||
element.classList.remove(glowClass);
|
||||
}
|
||||
});
|
||||
var factionClass = "faction" + faction;
|
||||
if (element.classList.contains(factionClass)) {
|
||||
element.classList.add(glowClass);
|
||||
} else {
|
||||
element.classList.remove(glowClass);
|
||||
}
|
||||
}
|
||||
|
||||
// Funktion zum Setzen des ausgewählten Werts für Dropdowns
|
||||
|
@ -12,6 +12,8 @@
|
||||
*/
|
||||
|
||||
#include "debugger.h"
|
||||
#include "utilities.h"
|
||||
#include <pgmspace.h>
|
||||
|
||||
DebugStatus_t DebuggerStatus[dbg_cntElements];
|
||||
|
||||
@ -117,8 +119,7 @@ const char helpText[][64] PROGMEM = {
|
||||
"notify_error - Send error notification",
|
||||
"notify_warning - Send warning notification",
|
||||
"notify_success - Send success notification",
|
||||
"notify_info - Send info notification"
|
||||
};
|
||||
"notify_info - Send info notification"};
|
||||
|
||||
const size_t NUM_HELP_LINES = sizeof(helpText) / sizeof(helpText[0]);
|
||||
|
||||
@ -326,7 +327,7 @@ void Debug_formatPersistence()
|
||||
*/
|
||||
void Debug_printSystemInfo()
|
||||
{
|
||||
Debug_pushMessage("Hostname: %s\n", globals.DeviceName);
|
||||
Debug_pushMessage("Hostname: %s\n", globals.DeviceNameId);
|
||||
|
||||
FlashMode_t ideMode = ESP.getFlashChipMode();
|
||||
Debug_pushMessage("Sdk version: %s\n", ESP.getSdkVersion());
|
||||
@ -508,10 +509,9 @@ void Debug_printHelp()
|
||||
char buffer[64];
|
||||
for (size_t i = 0; i < NUM_HELP_LINES; ++i)
|
||||
{
|
||||
strcpy_P(buffer, (PGM_P)pgm_read_word(&(helpText[i])));
|
||||
|
||||
// Display the help command
|
||||
Debug_pushMessage(buffer);
|
||||
strncpy_P(buffer, helpText[i], sizeof(buffer));
|
||||
buffer[sizeof(buffer) - 1] = '\0'; // Sicherstellen, dass der String nullterminiert ist
|
||||
Serial.println(buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -472,6 +472,18 @@ void Websocket_HandleButtons(uint8_t *data)
|
||||
{
|
||||
globals.systemStatus = sysStat_Shutdown;
|
||||
}
|
||||
else if (strcmp(identifier, "set-faction1") == 0)
|
||||
{
|
||||
PersistenceData.activeFaction = FACTION_1;
|
||||
}
|
||||
else if (strcmp(identifier, "set-faction2") == 0)
|
||||
{
|
||||
PersistenceData.activeFaction = FACTION_2;
|
||||
}
|
||||
else if (strcmp(identifier, "set-faction3") == 0)
|
||||
{
|
||||
PersistenceData.activeFaction = FACTION_3;
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug_pushMessage("Got unknown Button-id '%s' from ws-client\n", identifier);
|
||||
@ -660,7 +672,7 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
|
||||
"wifi-pass;"
|
||||
"fw-version;"
|
||||
"flash-version;"
|
||||
"git-revison;";
|
||||
"git-revision;";
|
||||
|
||||
if (client_id > 0)
|
||||
webSocket.text(client_id, mapping);
|
||||
|
Loading…
x
Reference in New Issue
Block a user