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