mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 15:30:41 +09:00
Add a request to mark hosts and the controller as needing a restart
Not every plugin arrives through PluginInstallRequest. Plugins checked out into external_plugins or installed by hand on the machine never flag a restart, so the web UI shows nothing and tooling that acts on the flag never fires. HostMarkRestartRequiredRequest and ControllerMarkRestartRequiredRequest set config.restartRequired, guarded by the existing restart permissions. They are exposed as "Mark Restart Required" in the control dropdown of the host and controller pages, hidden once the flag is set, and as mark-restart-required ctl commands. The mark shows up on the next system metrics poll. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
e2817eba39
commit
bca681b5ea
12 files changed
+100
-1
No files matched your search
@@ -16,7 +16,7 @@ import ControlContext from "./ControlContext";
|
||||
import ControllerConfigTree from "./ControllerConfigTree";
|
||||
import PageHeader from "./PageHeader";
|
||||
import PageLayout from "./PageLayout";
|
||||
import { notifyErrorHandler } from "../util/notify";
|
||||
import notify, { notifyErrorHandler } from "../util/notify";
|
||||
import webUiPackage from "../../package.json";
|
||||
import { hasNpmButtonPermission, NpmButton } from "./NpmButton";
|
||||
import VariableDropdownButton, { VariableDropdownButtonProps } from "./VariableDropdownButton";
|
||||
@@ -47,6 +47,20 @@ function ControllerControlButton({ canRestart, restartRequired }: ControllerCont
|
||||
});
|
||||
}
|
||||
|
||||
if (account.hasPermission("core.controller.restart") && !restartRequired) {
|
||||
actions.push({
|
||||
key: "mark-restart-required",
|
||||
label: "Mark Restart Required",
|
||||
onClick: () => {
|
||||
control.send(
|
||||
new lib.ControllerMarkRestartRequiredRequest()
|
||||
).then(() => {
|
||||
notify("Controller marked as requiring a restart", "success");
|
||||
}).catch(notifyErrorHandler("Error marking controller"));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (account.hasPermission("core.controller.stop")) {
|
||||
actions.push({
|
||||
key: "stop",
|
||||
|
||||
@@ -52,6 +52,21 @@ function HostControlButton({ hostId, canRestart, restartRequired }: HostControlB
|
||||
});
|
||||
}
|
||||
|
||||
if (account.hasPermission("core.host.restart") && !restartRequired) {
|
||||
actions.push({
|
||||
key: "mark-restart-required",
|
||||
label: "Mark Restart Required",
|
||||
onClick: () => {
|
||||
control.sendTo(
|
||||
{ hostId },
|
||||
new lib.HostMarkRestartRequiredRequest()
|
||||
).then(() => {
|
||||
notify("Host marked as requiring a restart", "success");
|
||||
}).catch(notifyErrorHandler("Error marking host"));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
if (account.hasPermission("core.host.stop")) {
|
||||
actions.push({
|
||||
key: "stop",
|
||||
|
||||
Reference in new issue
Block a user