Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions network.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 8 additions & 0 deletions ui/src/routes/devices.$id.settings.network.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down