From e8f77723207aea6888f8c253ccdeeb97b0d72ed3 Mon Sep 17 00:00:00 2001 From: Randalix Date: Tue, 15 Sep 2026 14:38:24 +0200 Subject: [PATCH] fix(remote): offer the WoL config dialog after a failed wake too A configured-but-broken target (host replaced NIC, command removed) had no way out: the dialog hung off the 'no target configured' branch only, so the banner would keep offering a Wake button that keeps failing. --- src/web/public/host-wake-ui.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/web/public/host-wake-ui.js b/src/web/public/host-wake-ui.js index f70dd7e5..03611285 100644 --- a/src/web/public/host-wake-ui.js +++ b/src/web/public/host-wake-ui.js @@ -135,7 +135,11 @@ Object.assign(CodemanApp.prototype, { ? `ssh ${state.host}` : 'no wake-on-LAN configured'; } - action.textContent = state.waking ? 'Waking …' : hasTarget ? 'Wake' : 'Configure WoL'; + // After a FAILED wake the only useful next step is fixing the target (wrong MAC, + // host moved NIC, command gone) — otherwise a configured-but-broken host would be + // stuck behind a button that keeps failing with no way to edit it. + const offerConfig = !hasTarget || Boolean(state.error); + action.textContent = state.waking ? 'Waking …' : offerConfig ? 'Configure WoL' : 'Wake'; action.disabled = state.waking; }, @@ -143,7 +147,7 @@ Object.assign(CodemanApp.prototype, { hostWakeAction() { const state = this._hostWake; if (!state || !state.sessionId || state.waking) return; - if (state.wakeConfigured === 'none') { + if (state.wakeConfigured === 'none' || state.error) { this.openWakeConfigDialog(); return; }