From c4ea27db8dcc75ceb978d1e1031a20068d7f068c Mon Sep 17 00:00:00 2001 From: Andrew Bauer Date: Mon, 12 Oct 2020 14:51:33 -0500 Subject: [PATCH] fix buttons in shutdown modal --- web/ajax/modals/shutdown.php | 12 +++-- web/skins/classic/js/skin.js | 10 ++++ web/skins/classic/views/shutdown.php | 79 ---------------------------- 3 files changed, 19 insertions(+), 82 deletions(-) delete mode 100644 web/skins/classic/views/shutdown.php diff --git a/web/ajax/modals/shutdown.php b/web/ajax/modals/shutdown.php index 0cfea0111..78c133a87 100644 --- a/web/ajax/modals/shutdown.php +++ b/web/ajax/modals/shutdown.php @@ -1,4 +1,6 @@ diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js index faef50c4f..c6171a47a 100644 --- a/web/skins/classic/js/skin.js +++ b/web/skins/classic/js/skin.js @@ -830,6 +830,16 @@ function getShutdownModal() { } // Manage the Shutdown modal $j('#shutdownModal').modal('show'); + // Redirect to the current view after the form is submitted - avoids a blank screen + $j('#shutdownForm').append(''); + $j('#restartBtn').click(function(evt) { + evt.preventDefault(); + $j('#shutdownForm').submit(); + }); + $j('#shutdownBtn').click(function(evt) { + evt.preventDefault(); + $j('#shutdownForm').submit(); + }); }) .fail(logAjaxFail); } diff --git a/web/skins/classic/views/shutdown.php b/web/skins/classic/views/shutdown.php deleted file mode 100644 index 25d5d3d34..000000000 --- a/web/skins/classic/views/shutdown.php +++ /dev/null @@ -1,79 +0,0 @@ - - -
- -
-ZM_PATH_SHUTDOWN is not defined. This is normally configured in /etc/zm/conf.d/01-system-paths.conf
'; - } else if ( !file_exists(ZM_PATH_SHUTDOWN) ) { - echo '
Path does not exist for ZM_PATH_SHUTDOWN. Current value is '.ZM_PATH_SHUTDOWN.'
'; - } else { -?> - -
- -'.implode('
', $output).'

'; - } - if ( isset($_POST['when']) and ($_POST['when'] != 'NOW') and ($action != 'cancel') ) { - echo '

You may cancel this shutdown by clicking '.translate('Cancel').'

'; - } -?> -

Warning

- This command will either shutdown or restart all ZoneMinder Servers
-

-

- - -

-
- - - - - - -
-
- -
- -