Added RCON Response box

This commit is contained in:
Shobhit Pathak committed 2023-10-11 23:34:51 +05:30
1 parent 41c0a69add
commit 50a7c545a8
2 files changed
+15 -1

No files matched your search

+11 -1
View File
@@ -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.');
}