From 50a7c545a8740bf360bcf8642dad27cd32270995 Mon Sep 17 00:00:00 2001 From: Shobhit Pathak Date: Wed, 11 Oct 2023 23:34:51 +0530 Subject: [PATCH] Added RCON Response box --- public/js/console.js | 12 +++++++++++- views/manage.ejs | 4 ++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/public/js/console.js b/public/js/console.js index fd8dc21..15240aa 100644 --- a/public/js/console.js +++ b/public/js/console.js @@ -107,7 +107,17 @@ $(document).ready(function () { if (response.ok) { const data = await response.json(); console.log(data.message) - alert(data.message); + if(apiEndpoint == '/api/rcon') { + if (data.message.includes("Response received")) { + $('#rconResultBox').show(); + $('#rconResultText').text(data.message.split("Command sent! Response received:")[1]); + } else { + $('#rconResultBox').hide(); + alert(data.message); + } + } else { + alert(data.message); + } } else if (response.status == 401) { alert('Unauthorized, please reload and relogin.'); } diff --git a/views/manage.ejs b/views/manage.ejs index a1acfa2..6a74c9d 100644 --- a/views/manage.ejs +++ b/views/manage.ejs @@ -263,6 +263,10 @@ +