Clickable local node info (#1299)

This commit is contained in:
Tim Wilkinson 2024-08-17 14:18:37 -07:00 committed by GitHub
parent a6a00cc432
commit 6fca9a176d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -102,9 +102,13 @@ if (tracker) {
} }
%} %}
<div class="dialog"> <div class="dialog">
{{_R("dialog-header", "Neighborhood Device")}} {% if (tracker && tracker.type === "DtD" && tracker.distance < 50) { %}
{{_R("dialog-header", "Local Node")}}
{% } else { %}
{{_R("dialog-header", "Neighborhood Node")}}
{% } %}
<div> <div>
{{_H("Provides more detailed information about the state of a link from this node to a neighbor. The current blocked {{_H("Provides more detailed information about the state of a link from this node to another. The current blocked
state is show in the top/right corner. This can be changed to either <b>always block</b> or <b>never block</b> to override state is show in the top/right corner. This can be changed to either <b>always block</b> or <b>never block</b> to override
the automatic management of the link's use.")}} the automatic management of the link's use.")}}
{% {%

View File

@ -76,7 +76,7 @@
return "-"; return "-";
} }
%} %}
<div class="noctrl"> <div class="noctrl" hx-target="#ctrl-modal">
<div class="section-title">Local Nodes</div> <div class="section-title">Local Nodes</div>
<div class="section" style="line-height:18px;margin-top:-16px"> <div class="section" style="line-height:18px;margin-top:-16px">
<div class="cols"> <div class="cols">
@ -106,7 +106,7 @@
for (let i = 0; i < length(llist); i++) { for (let i = 0; i < length(llist); i++) {
const tracker = trackers[llist[i].mac]; const tracker = trackers[llist[i].mac];
const status = calcColor(tracker); const status = calcColor(tracker);
print("<div class='cols " + status + "'>"); print(`<div class="ctrl cols status ${status}" hx-get="status/e/neighbor-device?m=${tracker.mac}">`);
const link = links[tracker.ip] || {}; const link = links[tracker.ip] || {};
const lq = link.lossMultiplier ? (min(100, int(100 * link.linkQuality * 65536 / link.lossMultiplier) + "%")) : "-"; const lq = link.lossMultiplier ? (min(100, int(100 * link.linkQuality * 65536 / link.lossMultiplier) + "%")) : "-";
const nlq = link.lossMultiplier ? (min(100, int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier)) + "%") : "-"; const nlq = link.lossMultiplier ? (min(100, int(100 * link.neighborLinkQuality * 65536 / link.lossMultiplier)) + "%") : "-";