From 13b31246177fb7a0ae7f1d9379994587a450ced7 Mon Sep 17 00:00:00 2001 From: Wasabules <39313803+Wasabules@users.noreply.github.com> Date: Mon, 13 Jul 2026 01:31:39 +0200 Subject: [PATCH 1/9] feat(ui): interface dropdown for bind address + version next to check-for-updates - Bind address is now a dropdown listing the machine's network interfaces (name + IPv4) plus "All interfaces", backed by a new GetNetworkInterfaces binding. A persisted address no longer present is kept as an option so the current selection is never lost. - The Settings "check for updates" button now shows the current version next to it. --- app.go | 28 ++++++++++++++++ frontend/src/components/ServerControls.svelte | 33 +++++++++++++++---- frontend/src/components/Settings.svelte | 5 ++- frontend/src/lib/api.ts | 2 ++ frontend/wailsjs/go/main/App.d.ts | 2 ++ frontend/wailsjs/go/main/App.js | 4 +++ frontend/wailsjs/go/models.ts | 14 ++++++++ internal/models/models.go | 7 ++++ 8 files changed, 88 insertions(+), 7 deletions(-) diff --git a/app.go b/app.go index c4195c5..220f129 100644 --- a/app.go +++ b/app.go @@ -363,6 +363,34 @@ func (a *App) GetLocalIPs() []string { return ips } +// GetNetworkInterfaces lists bindable local IPv4 addresses with their +// interface name, for the bind-address selector. Interfaces that are down are +// skipped; loopback is included so the server can be restricted to localhost. +func (a *App) GetNetworkInterfaces() []models.NetworkInterface { + var out []models.NetworkInterface + ifaces, err := net.Interfaces() + if err != nil { + return out + } + for _, iface := range ifaces { + if iface.Flags&net.FlagUp == 0 { + continue + } + addrs, err := iface.Addrs() + if err != nil { + continue + } + for _, addr := range addrs { + if ipnet, ok := addr.(*net.IPNet); ok { + if ip4 := ipnet.IP.To4(); ip4 != nil { + out = append(out, models.NetworkInterface{Name: iface.Name, IP: ip4.String()}) + } + } + } + } + return out +} + // --- Alert Methods --- func (a *App) GetAlertRules() []models.AlertRule { diff --git a/frontend/src/components/ServerControls.svelte b/frontend/src/components/ServerControls.svelte index 32bf7dd..7a142fd 100644 --- a/frontend/src/components/ServerControls.svelte +++ b/frontend/src/components/ServerControls.svelte @@ -1,7 +1,8 @@ + + {#if visible}