From 178131945ea379327bd2785926b341060451ca60 Mon Sep 17 00:00:00 2001 From: ntoff Date: Fri, 6 Oct 2017 09:32:49 +1000 Subject: [PATCH] Add possible print distruption warning to shutdown dialog --- docs/api/system.rst | 12 ++++++------ .../plugins/pluginmanager/static/js/pluginmanager.js | 2 +- src/octoprint/server/api/system.py | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/api/system.rst b/docs/api/system.rst index 78ea128ff..439373a2b 100644 --- a/docs/api/system.rst +++ b/docs/api/system.rst @@ -39,7 +39,7 @@ List all registered system commands "action": "shutdown", "name": "Shutdown", "command": "sudo shutdown -h now", - "confirm": "You are about to shutdown the system.", + "confirm": "You are about to shutdown the system.

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).", "async": true, "ignore": true, "source": "core", @@ -49,7 +49,7 @@ List all registered system commands "action": "reboot", "name": "Reboot", "command": "sudo reboot", - "confirm": "You are about to reboot the system.", + "confirm": "You are about to reboot the system.

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).", "async": true, "ignore": true, "source": "core", @@ -59,7 +59,7 @@ List all registered system commands "action": "restart", "name": "Restart OctoPrint", "command": "sudo service octoprint restart", - "confirm": "You are about to restart the OctoPrint server.", + "confirm": "You are about to restart the OctoPrint server.

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).", "async": true, "ignore": true, "source": "core", @@ -100,7 +100,7 @@ List all registered system commands for a source "action": "shutdown", "name": "Shutdown", "command": "sudo shutdown -h now", - "confirm": "You are about to shutdown the system.", + "confirm": "You are about to shutdown the system.

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).", "async": true, "ignore": true, "source": "core", @@ -110,7 +110,7 @@ List all registered system commands for a source "action": "reboot", "name": "Reboot", "command": "sudo reboot", - "confirm": "You are about to reboot the system.", + "confirm": "You are about to reboot the system.

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).", "async": true, "ignore": true, "source": "core", @@ -120,7 +120,7 @@ List all registered system commands for a source "action": "restart", "name": "Restart OctoPrint", "command": "sudo service octoprint restart", - "confirm": "You are about to restart the OctoPrint server.", + "confirm": "You are about to restart the OctoPrint server.

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).", "async": true, "ignore": true, "source": "core", diff --git a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js index 9663cc619..6984644fe 100644 --- a/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js +++ b/src/octoprint/plugins/pluginmanager/static/js/pluginmanager.js @@ -731,7 +731,7 @@ $(function() { if (restartClicked) return; restartClicked = true; showConfirmationDialog({ - message: gettext("This will restart your OctoPrint server."), + message: gettext("This will restart your OctoPrint server.

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() { diff --git a/src/octoprint/server/api/system.py b/src/octoprint/server/api/system.py index e17bdb781..8be2fec25 100644 --- a/src/octoprint/server/api/system.py +++ b/src/octoprint/server/api/system.py @@ -167,19 +167,19 @@ def _get_core_command_specs(): shutdown=dict( command=s().get(["server", "commands", "systemShutdownCommand"]), name=gettext("Shutdown system"), - confirm=gettext("You are about to shutdown the system.")), + confirm=gettext("You are about to shutdown the system.

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).")), reboot=dict( command=s().get(["server", "commands", "systemRestartCommand"]), name=gettext("Reboot system"), - confirm=gettext("You are about to reboot the system.")), + confirm=gettext("You are about to reboot the system.

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).")), restart=dict( command=s().get(["server", "commands", "serverRestartCommand"]), name=gettext("Restart OctoPrint"), - confirm=gettext("You are about to restart the OctoPrint server.")), + confirm=gettext("You are about to restart the OctoPrint server.

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).")), restart_safe=dict( command=s().get(["server", "commands", "serverRestartCommand"]), name=gettext("Restart OctoPrint in safe mode"), - confirm=gettext("You are about to restart the OctoPrint server in safe mode."), + confirm=gettext("You are about to restart the OctoPrint server in safe mode.

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)."), before=enable_safe_mode) )