Nils
February 25, 2022, 7:44am
1
Hi,
did not find anything in the documentation and also failed searching in the code.... is it possible to trigger the restart required command also from the plugin itself? I need it to request a restart if a configuration is changed...
Cheers,
Nils
OctoPrint.system.executeCommand("core", "restart");
will do the command, an example of it being called from plugin manager (which is a plugin).
showConfirmationDialog({
message: gettext(
"<strong>This will restart your OctoPrint server.</strong></p><p>This action may disrupt any ongoing print jobs (depending on your printer's controller and general setup that might also apply to prints run directly from your printer's internal storage)."
),
onproceed: function () {
OctoPrint.system
.executeCommand("core", "restart")
.done(function () {
notice.remove();
new PNotify({
title: gettext(
"Restart in progress"
),
text: gettext(
"The server is now being restarted in the background"
)
});
})
.fail(function () {
new PNotify({
This file has been truncated. show original