Skip to content

Commit

Permalink
Show number of nodes with a seen User packet
Browse files Browse the repository at this point in the history
  • Loading branch information
mskvortsov committed Apr 17, 2024
1 parent c72dc43 commit 053cd0c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
<td>
<input id="filter-expr-input" type="text"/>
</td>
<td>
<div id="nodes-seen" title="Nodes with a seen User packet">000</div>
</td>
<td>
<div class="theme-switch-wrapper">
<label class="theme-switch">
Expand Down
18 changes: 17 additions & 1 deletion meshmon.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
--selected-decoded: #f9f978;

--tooltip-bg-color: #bababa;
--nodes-seen-bg-color: #76c2fc;
}

[data-theme="dark"] {
Expand All @@ -37,6 +38,7 @@
--selected-decoded: #56563c;

--tooltip-bg-color: #111111;
--nodes-seen-bg-color: #005596;
}

body {
Expand Down Expand Up @@ -83,6 +85,9 @@ body {
.table-main tbody tr {
text-align: right;
}
.table-main tfoot tr td {
border: none;
}

.packet-header-row {
background: var(--packet-header-bg-color)
Expand Down Expand Up @@ -127,6 +132,17 @@ body {
border: 0;
}

#nodes-seen {
font-family: var(--font-family-verbatim);
background-color: var(--nodes-seen-bg-color);
margin-left: 30px;
width: 32px;
height: 20px;
align-content: center;
padding-right: 8px;
border-radius: 5px;
}

/* Row selection */

.selected.packet-header-row {
Expand All @@ -142,7 +158,7 @@ body {
/* Source code link logo */

.logo {
height: 22px;
height: 16px;
}
.logo-light {
display: var(--logo-light-mode);
Expand Down
2 changes: 2 additions & 0 deletions meshmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ function mqttOnMessage(topic, message) {
se.parsed.status == ParseResult.Ok) {
const user = se.parsed.value.value;
users.set(user.id, user);
document.getElementById('nodes-seen').innerHTML =
users.size.toString().padStart(3, '0');;
}

const scrollDown = window.scrollY + window.innerHeight + 42 > document.body.scrollHeight;
Expand Down

0 comments on commit 053cd0c

Please sign in to comment.