diff --git a/internal/web/ui.go b/internal/web/ui.go index a5f207d..1dba4b6 100644 --- a/internal/web/ui.go +++ b/internal/web/ui.go @@ -907,15 +907,15 @@ func (u *UI) ensureDevicesLoaded() { } devices := u.registry.GetDevices() if len(devices) > 0 { - // Check if any device is online; if not, try discovery to refresh - hasOnline := false + // Check if any device is offline; trigger discovery to refresh + hasOffline := false for _, d := range devices { - if d.Online { - hasOnline = true + if !d.Online { + hasOffline = true break } } - if hasOnline { + if !hasOffline { return } } @@ -1361,10 +1361,6 @@ func (u *UI) actionConsoleSave(w http.ResponseWriter, r *http.Request) { func (u *UI) pageWizard(w http.ResponseWriter, r *http.Request) { u.ensureDevicesLoaded() - // Force a fresh discovery to pick up all devices reliably. - if u.discovery != nil { - u.discovery.SearchDefault() - } data := PageData{Title: "部署向导"} data.Devices = u.registry.GetDevices() if u.preview != nil {