From 9566f7dd1bab1a3bf5ef2fc1342a22a0a132adc7 Mon Sep 17 00:00:00 2001 From: Dmitrii Iurco Date: Mon, 25 May 2026 14:03:56 -0400 Subject: [PATCH] wizard: skip cell-name and domain steps when installer pre-configured them MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the bash installer collects cell name and domain mode, the first-run wizard's /setup should only ask for a password, service selection, and timezone. Previously the wizard pre-filled those fields but still showed all 7 steps. - useEffect fetches /api/setup/status on mount; if preconfigured.cell_name and preconfigured.domain_mode are both set, sets installerConfigured=true and jumps to step 2 (password) - handleStep2Next → step 5 when installerConfigured (skips domain steps 3+4) - handleStep2Back → step 1 when installerConfigured (review cell name) - handleStep5Back returns to step 2 when installerConfigured Co-Authored-By: Claude Sonnet 4.6 --- webui/src/pages/Setup.jsx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/webui/src/pages/Setup.jsx b/webui/src/pages/Setup.jsx index a6bbdda..494e4c5 100644 --- a/webui/src/pages/Setup.jsx +++ b/webui/src/pages/Setup.jsx @@ -789,13 +789,16 @@ export default function Setup() { const [submitting, setSubmitting] = useState(false); const [submitError, setSubmitError] = useState(''); - // Pre-fill from installer config if present + // True when the bash installer already configured cell identity + const [installerConfigured, setInstallerConfigured] = useState(false); + + // Pre-fill from installer config; if cell + domain already set, jump to password step useEffect(() => { setupAPI.getStatus() .then(res => { const pre = res.data?.preconfigured; if (!pre) return; - if (pre.cell_name) setCellName(pre.cell_name); + if (pre.cell_name) setCellName(pre.cell_name); if (pre.domain_mode) { if (pre.domain_mode === 'pic_ngo') setDomainType('pic_ngo'); else if (pre.domain_mode === 'lan') setDomainType('lan'); @@ -804,6 +807,10 @@ export default function Setup() { if (pre.domain_name) setCustomDomain(pre.domain_name); if (pre.cloudflare_api_token) setCloudflareToken(pre.cloudflare_api_token); if (pre.duckdns_token) setDuckdnsToken(pre.duckdns_token); + if (pre.cell_name && pre.domain_mode) { + setInstallerConfigured(true); + setStep(2); // skip cell name + domain steps — already done by installer + } }) .catch(() => {}); // fail silently — wizard works from scratch }, []); @@ -813,9 +820,13 @@ export default function Setup() { const goNext = () => setStep(s => Math.min(s + 1, TOTAL_STEPS)); const goBack = () => setStep(s => Math.max(s - 1, 1)); + // When installer pre-configured identity: step 2 → step 5 (skip domain steps) + const handleStep2Next = () => installerConfigured ? setStep(5) : goNext(); + const handleStep2Back = () => installerConfigured ? setStep(1) : goBack(); + const handleStep3Next = () => skipStep4 ? setStep(5) : setStep(4); const handleStep4Back = () => setStep(3); - const handleStep5Back = () => skipStep4 ? setStep(3) : setStep(4); + const handleStep5Back = () => installerConfigured ? setStep(2) : skipStep4 ? setStep(3) : setStep(4); const handleSubmit = async () => { setSubmitError(''); @@ -896,8 +907,8 @@ export default function Setup() { confirm={passwordConfirm} onChangePassword={setPassword} onChangeConfirm={setPasswordConfirm} - onNext={goNext} - onBack={goBack} + onNext={handleStep2Next} + onBack={handleStep2Back} /> )} {step === 3 && (