mirror of https://github.com/jetkvm/kvm.git
feat: add hostname change detection and reboot requirement in network settings
This commit is contained in:
parent
85eb4babdf
commit
2e1c62e43b
|
|
@ -284,6 +284,11 @@ func shouldRebootForNetworkChange(oldConfig, newConfig *types.NetworkConfig) (re
|
||||||
l.Info().Msg("IPv6 mode changed with udhcpc, reboot required")
|
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
|
return rebootRequired, postRebootAction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 no critical fields are changed, save immediately
|
||||||
if (changes.length === 0) return onSubmit(settings);
|
if (changes.length === 0) return onSubmit(settings);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue