From a7c9bb1eaec3cfd54191056ed77b0ef03e68dd21 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sun, 10 May 2026 23:18:16 +0200 Subject: [PATCH] feat(web): visible pre-flight panel runs the same checks the Test buttons run MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the silent confirm()-dialog pre-flight with an inline panel that pops up the moment Apply is clicked, walks through each applicable check live, and surfaces the result before any backend operation touches the speaker. Three checks run in order: 1. Backend summary re-check (always) β€” the existing runPreflightCheck logic, repackaged as the first row in the panel. Catches transport/resolve_ip drift since the cached summary loaded. 2. HTTPS connection from the device (when SSH is reachable) β€” reuses /setup/test-connection with use_explicit_ca=true so the test exercises the trust path even when CA install is part of the plan. Identical to the manual "Test with Explicit CA.crt" button under HTTPS Connection Test, but runs without requiring the user to click it. SSH-less devices show a "skip" row with a note pointing at the future telnet round-trip probe. 3. DNS redirection from the device (only when resolv is in the plan and SSH is reachable) β€” reuses /setup/test-dns. Same parity as #2 with the manual "Test DNS Redirection" button. UX: - Each check renders with πŸ• pending β†’ ⟳ running β†’ βœ… ok / ❌ fail / β€” skipped, so the user sees feedback while the backend works. - On all green: a 700ms hold lets the success state register, then Apply auto-proceeds. - On any red: a "Proceed Anyway" / "Cancel" pair appears; default is to abort, but the user can override on a known false-positive. Both Apply paths (applySuggestedPlan and applyCustomPlan) now share runApplyPreflight and awaitPreflightDecision; the unused confirmPreflightIssues helper is removed. Co-Authored-By: Claude Opus 4.7 (1M context) --- pkg/service/handlers/web/index.html | 16 ++ pkg/service/handlers/web/js/script.js | 240 +++++++++++++++++++++++--- 2 files changed, 233 insertions(+), 23 deletions(-) diff --git a/pkg/service/handlers/web/index.html b/pkg/service/handlers/web/index.html index 2fcbc7f..7c9fc1a 100644 --- a/pkg/service/handlers/web/index.html +++ b/pkg/service/handlers/web/index.html @@ -590,6 +590,22 @@ + + +