From a391a2d854695269606269bc0a2fad39ed7c063c Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Thu, 31 Dec 2015 18:01:42 -0500 Subject: [PATCH] Hide console commands when server is off/stopping --- resources/views/server/index.blade.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/resources/views/server/index.blade.php b/resources/views/server/index.blade.php index 499a8a878..f4d8f880f 100644 --- a/resources/views/server/index.blade.php +++ b/resources/views/server/index.blade.php @@ -88,7 +88,7 @@

-
+
@@ -265,11 +265,18 @@ $(window).load(function () { var can_run = true; function updateServerPowerControls (data) { + // Reset Console Data + if (data === 2) { + $("#live_console").val(''); + } + // Server is On or Starting - if(data == 1 || data == 3) { + if(data == 1 || data == 2) { + $("#console_command").slideDown(); $('[data-attr="power"][data-action="start"]').addClass('disabled'); $('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').removeClass('disabled'); } else { + $("#console_command").slideUp(); $('[data-attr="power"][data-action="start"]').removeClass('disabled'); $('[data-attr="power"][data-action="stop"], [data-attr="power"][data-action="restart"]').addClass('disabled'); } @@ -290,9 +297,6 @@ $(window).load(function () { } else { var killConfirm = true; } if(killConfirm) { - if (action === 'start') { - $("#live_console").val(''); - } $.ajax({ type: 'PUT', headers: {