Add option to only show last state update in series of state updates

This commit is contained in:
redfast00 2020-09-09 23:32:42 +02:00
parent 11a9c1b3c8
commit 9a2f9f8ced
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
2 changed files with 16 additions and 3 deletions

View file

@ -53,6 +53,10 @@
display:none;
}
table.hide_consecutive_states .staterow + .staterow {
display: none;
}
tr:hover {
background-color: #aaa;
}
@ -92,8 +96,11 @@
<body>
<button onclick="toggle_logging()" id="toggle_button">Start</button>
<input type="checkbox" id="show_raw" name="show_raw" checked autocomplete="off" onchange="updateShow()">
<label for="show_raw">Show raw address and payload</label>
<input type="checkbox" id="show_raw" name="show_raw" checked autocomplete="off" onchange="updateShowRaw()">
<label for="show_raw">Show raw address and payload</label>
<input type="checkbox" id="show_consecutive_states" name="show_consecutive_states" checked autocomplete="off" onchange="updateShowStates()">
<label for="show_consecutive_states">Show consecutive state updates</label>
<table id="message_table">
<tr id="table_header">

View file

@ -16,10 +16,14 @@ let color_classes = {
"needy": "needy",
}
function updateShow() {
function updateShowRaw() {
document.getElementById("message_table").classList.toggle("hide_raw", !document.getElementById('show_raw').checked);
}
function updateShowStates() {
document.getElementById("message_table").classList.toggle("hide_consecutive_states", !document.getElementById('show_consecutive_states').checked);
}
function updateMessages() {
fetch(`/${newest_message_index}/api.json`)
.then(
@ -59,6 +63,8 @@ function updateMessages() {
let parsed = row.insertCell(-1)
if (current['parsed'].startsWith("PARSE ERROR")) {
parsed.classList.add("error");
} else if (current['parsed'].startsWith("STATE")) {
parsed.classList.add("staterow");
}
parsed.innerHTML = current['parsed'];
parsed.classList.add('parsed');