diff options
Diffstat (limited to 'src/api/dashboard')
| -rw-r--r-- | src/api/dashboard/dashboard.html | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/api/dashboard/dashboard.html b/src/api/dashboard/dashboard.html index 7be738c..5d49311 100644 --- a/src/api/dashboard/dashboard.html +++ b/src/api/dashboard/dashboard.html @@ -31,7 +31,7 @@ border-bottom: 1px solid var(--line); flex-wrap: wrap; } header h1 { font-size: 16px; margin: 0; } #connection { margin-left: auto; color: var(--muted); } - #clock-warning, #peers .clock-off { color: var(--warn); } + #clock-warning, #peers .clock-off, #peers .epoch-off { color: var(--warn); } /* A minute's bar each, the last 15: a link's trend at a glance. */ #peers .spark { font-family: ui-monospace, monospace; letter-spacing: 0; opacity: 0.7; } #connection.live { color: var(--ok); } @@ -240,7 +240,7 @@ #peers tr.focused td { background: var(--line); } .id { font-family: ui-monospace, monospace; font-size: 12px; } /* Where messages go: the start of the address, the rest in its tooltip. */ - #peers td.via { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + #peers td.via { max-width: 0; min-width: 8em; width: 100%; overflow: hidden; text-overflow: ellipsis; } /* A peer's status (not the legend's "dormant"). */ #peers .active { color: var(--ok); } #peers .dormant { color: var(--bad); } #peers .unknown { color: var(--muted); } @@ -500,7 +500,7 @@ function renderPeers() { "this node's (its offset taken off): this minute's mean, and the last 15 minutes' as " + "a line; good to half the round trip, but the trend exactly" }; const rows = [el("tr", {}, ...["peer", "status", "seen", "via", "rtt", "hop", "clock", - "neighbour", "reaches", "same epoch"] + "neighbour", "reaches", "epoch"] .map(h => el("th", { title: headers[h] || "" }, h)))]; // Whom this node reaches, to tell those a peer reaches and it doesn't. const ours = new Set(state.peers.localReaches || []); @@ -526,8 +526,7 @@ function renderPeers() { peer.clock.withinMs + " ms" : "" }, peer.clock ? seconds(peer.clock.offsetMs) : ""), el("td", {}, peer.neighbour ? "yes" : ""), reachesCell(peer.reaches, ours, id), - el("td", {}, peer.sameEpoch === null || peer.sameEpoch === undefined - ? "" : peer.sameEpoch ? "yes" : "no")); + epochCell(peer.epoch, peer.sameEpoch)); rows.push(row); } morphChildren(table, rows); @@ -537,6 +536,14 @@ function renderPeers() { ? (rows[8].offsetTop + rows[8].offsetHeight) + "px" : ""; } +// The epoch a peer last said it is on: its generation, flagged where it isn't this +// node's (they don't sync then); its ID in the tooltip. +function epochCell(epoch, same) { + if (!epoch) return el("td", { title: "it hasn't said yet" }, ""); + return el("td", { class: same === false ? "epoch-off" : "", + title: "epoch " + epoch.id + (same === false ? ": not this node's, so they don't sync" : "") }, + String(epoch.generation)); +} // How long a peer's sync messages take to come (`hopDelay`): the latest minute's mean, // and the last 15 minutes' as a line of bars (a minute without messages blank), each // figure in the tooltip. |
