Green mesh banner on each remote card, naming the failing leg when it is not green
This commit is contained in:
@@ -548,6 +548,15 @@ function vv_pt_nodes(): array {
|
||||
'api_key_preview' => $apiKeyPreview,
|
||||
'metrics' => $metrics,
|
||||
'media_seed' => $isMe ? [] : vv_pt_media_seed($setupDb, $nodeIdUpper),
|
||||
// Every condition that has to hold for this partner to actually be usable, each
|
||||
// reported separately. One rolled-up boolean would have said "not ok" for the last
|
||||
// hour without saying that the only failing part was a name lookup.
|
||||
'mesh' => $isMe ? null : [
|
||||
'tailscale' => $ts['online'] === true,
|
||||
'ssh' => !empty($system['unraid_version']) || !empty($system['uptime_sec']),
|
||||
'partnership' => ($ptDb['state'] ?? '') === 'ACTIVE',
|
||||
'onboarded' => $onboardPhase >= 2,
|
||||
],
|
||||
];
|
||||
}
|
||||
return $nodes;
|
||||
|
||||
@@ -1311,6 +1311,30 @@ function _renderActions(nodes, cfg) {
|
||||
}
|
||||
}
|
||||
|
||||
// ── Mesh health banner ─────────────────────────────────────────────────
|
||||
// Green only when every leg holds. When one does not, the banner names which — "mesh
|
||||
// degraded" on its own sends someone hunting through four subsystems, and the answer is
|
||||
// already known here.
|
||||
const mesh = remote.mesh;
|
||||
if (mesh) {
|
||||
const legs = [
|
||||
['Tailscale', mesh.tailscale],
|
||||
['SSH', mesh.ssh],
|
||||
['Partnership', mesh.partnership],
|
||||
['Onboarded', mesh.onboarded],
|
||||
];
|
||||
const bad = legs.filter(l => !l[1]).map(l => l[0]);
|
||||
const ok = bad.length === 0;
|
||||
html += `<div style="margin-top:9px;padding:7px 10px;border-radius:3px;
|
||||
background:${ok ? '#0a1a0a' : '#1a1200'};border:1px solid ${ok ? '#1a4a1a' : '#3a2800'};
|
||||
display:flex;align-items:center;gap:8px;flex-wrap:wrap;">
|
||||
<span style="font-size:11px;color:${ok ? '#4caf50' : '#ff9800'};font-weight:600;">
|
||||
${ok ? '✓ Mesh connected — all systems good' : '⚠ Mesh degraded'}</span>
|
||||
<span style="font-size:9px;color:${ok ? '#2e6b2e' : '#8a6a2a'};font-family:monospace;">
|
||||
${ok ? legs.map(l => l[0]).join(' · ') : 'failing: ' + bad.join(', ')}</span>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
// ── Delete Keys panel ──────────────────────────────────────────────────
|
||||
if (isDeleting) {
|
||||
html += `<div style="margin-top:10px;padding:10px;background:#0a0a0a;border:1px solid #2a1515;
|
||||
|
||||
Reference in New Issue
Block a user