From 2e1c62e43b64c1ce45f4aebc8037a559787a9542 Mon Sep 17 00:00:00 2001 From: Adam Shiervani Date: Thu, 20 Nov 2025 16:19:49 +0100 Subject: [PATCH] feat: add hostname change detection and reboot requirement in network settings --- network.go | 5 +++++ ui/src/routes/devices.$id.settings.network.tsx | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/network.go b/network.go index ab6e3ee7d..eb14c70d6 100644 --- a/network.go +++ b/network.go @@ -284,6 +284,11 @@ func shouldRebootForNetworkChange(oldConfig, newConfig *types.NetworkConfig) (re l.Info().Msg("IPv6 mode changed with udhcpc, reboot required") } + if newConfig.Hostname.String != oldConfig.Hostname.String { + rebootRequired = true + l.Info().Msg("Hostname changed, reboot required") + } + return rebootRequired, postRebootAction } diff --git a/ui/src/routes/devices.$id.settings.network.tsx b/ui/src/routes/devices.$id.settings.network.tsx index d4dd0bd7f..8fdece8b5 100644 --- a/ui/src/routes/devices.$id.settings.network.tsx +++ b/ui/src/routes/devices.$id.settings.network.tsx @@ -278,6 +278,14 @@ export default function SettingsNetworkRoute() { }); } + if (dirty.hostname) { + changes.push({ + label: m.network_hostname_title(), + from: initialSettingsRef.current?.hostname?.toString() ?? "", + to: data.hostname?.toString() ?? "", + }); + } + // If no critical fields are changed, save immediately if (changes.length === 0) return onSubmit(settings);