Graceful degradation before partnership/SSH is set up

Fix 1 — Monitor partner card (common.php + monitor.php):
  vv_remote_hosts_stats() no longer skips hosts with no API key.
  Returns no_api_key:true entry instead. Monitor JS renders
  "API key not configured — complete Onboard to enable" instead
  of a blank space.

Fix 2 — rawconf push not alarming pre-onboard (config.php + scheduler.php):
  Probe failures (Tailscale not found, plugin not installed) now carry
  ready:false. JS treats ready:false results silently — button shows
  "✓ Saved" not "push failed: HOST2" before SSH is set up.
  Only genuine post-onboard failures (ready not false) show as errors.

Fix 3 — Partnership Onboard button (partnership.php):
  Disabled with tooltip when no partner hostname is in master.conf.
  When partner configured but not onboarded, adds explanation note:
  "Onboard will generate your SSH key, exchange it with the partner..."
  No partner configured: "Edit master.conf and set HOST2."
This commit is contained in:
Gmer4Lfe
2026-05-30 16:01:44 -04:00
parent 974e3cf2cf
commit 0121462576
5 changed files with 36 additions and 11 deletions
+18 -2
View File
@@ -207,11 +207,15 @@ function _renderActions(nodes, cfg) {
const remoteOpts = remotes.map(n =>
`<option value="${n.slot}">${n.id} — ${n.hostname}</option>`).join('');
const hasPartner = remotes.length > 0 && remotes.some(n => n.hostname);
let html = '<div class="vv-pt-actions">';
// Onboard
// Onboard — disabled until a partner hostname is configured in master.conf
html += `<button class="vv-pt-action-btn run" onclick="vvPtOnboard(this)"
title="Run partnership_onboard.sh — auto-detects role (run on mirror first, then owner)">
${!hasPartner ? 'disabled title="Add partner hostname to master.conf first (Scheduler → master.conf)"' :
'title="Run partnership_onboard.sh — auto-detects role (run on mirror first, then owner)"'}
${!hasPartner ? 'style="opacity:.35;cursor:default;"' : ''}>
▶ Onboard
</button>`;
@@ -223,6 +227,18 @@ function _renderActions(nodes, cfg) {
html += '</div>';
// Contextual note under actions
if (!hasPartner) {
html += `<div style="font-size:11px;color:#444;margin-top:8px;">
No partner hostname configured. Edit master.conf (Scheduler tab) and set HOST2.
</div>`;
} else if (!cfg.enabled) {
html += `<div style="font-size:11px;color:#555;margin-top:8px;">
Onboard will generate your SSH key, exchange it with the partner, and establish the partnership.
Run on the mirror (HOST2) first, then on the owner (HOST1).
</div>`;
}
// Transfer — show manual command, too destructive to one-click
if (cfg.enabled && isOwner) {
const confirmStr = 'i-understand-this-transfers-ownership';