mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
added console page back
This commit is contained in:
25
WebfrontCore/wwwroot/js/console.js
Normal file
25
WebfrontCore/wwwroot/js/console.js
Normal file
@ -0,0 +1,25 @@
|
||||
function executeCommand() {
|
||||
const serverId = $('#console_server_select').val();
|
||||
const command = $('#console_command_value').val();
|
||||
$.get('/Console/ExecuteAsync', { serverId: serverId, command: command })
|
||||
.done(function (response) {
|
||||
$('#console_command_response').html(response);
|
||||
$('#console_command_value').val("");
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
$('#console_command_response').text('Could not execute command: ' + error).addClass('text-danger');
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#console_command_button').click(function (e) {
|
||||
executeCommand();
|
||||
});
|
||||
|
||||
$(document).keydown(function (event) {
|
||||
const keyCode = (event.keyCode ? event.keyCode : event.which);
|
||||
if (keyCode === 13) {
|
||||
executeCommand();
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user