feat: add hostname change detection and reboot requirement in network settings (#989)

This commit is contained in:
Adam Shiervani 2025-11-20 16:36:02 +01:00 committed by GitHub
parent 0952c6abf2
commit 0a09d9e8bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -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
}

View File

@ -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);