RCon error handling is clearer
Show chat on mobile view of server overview basic authentication switched to extreme-ip-lookup for ip lookups (SSL)
This commit is contained in:
46
WebfrontCore/wwwroot/js/global.js
Normal file
46
WebfrontCore/wwwroot/js/global.js
Normal file
@ -0,0 +1,46 @@
|
||||
$(document).ready(function () {
|
||||
/*
|
||||
* handle action modal
|
||||
*/
|
||||
$('.profile-action').click(function (e) {
|
||||
const actionType = $(this).data('action');
|
||||
$.get('/Action/' + actionType + 'Form')
|
||||
.done(function (response) {
|
||||
$('#actionModal .modal-body').html(response);
|
||||
$('#actionModal').modal();
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
$('#actionModal .modal-body').html('<span class="text-danger">' + error + '</span>');
|
||||
$('#actionModal').modal();
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* handle action submit
|
||||
*/
|
||||
$(document).on('submit', '.action-form', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).append($('#target_id input'));
|
||||
const data = $(this).serialize();
|
||||
$.get($(this).attr('action') + '/?' + data)
|
||||
.done(function (response) {
|
||||
// success without content
|
||||
if (response.length === 0) {
|
||||
location.reload();
|
||||
}
|
||||
else {
|
||||
$('#actionModal .modal-body').html(response);
|
||||
$('#actionModal').modal();
|
||||
}
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
if (jqxhr.status == 401) {
|
||||
$('#actionModal .modal-body').removeClass('text-danger');
|
||||
$('#actionModal .modal-body').prepend('<div class="text-danger mb-3">Invalid login credentials</div>');
|
||||
}
|
||||
else {
|
||||
$('#actionModal .modal-body').html('<span class="text-danger">Error — ' + error + '</span>');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
@ -56,14 +56,41 @@ $(document).ready(function () {
|
||||
$('.ip-locate-link').click(function (e) {
|
||||
e.preventDefault();
|
||||
const ip = $(this).data("ip");
|
||||
$.getJSON("http://ip-api.com/json/" + ip)
|
||||
$.getJSON('https://extreme-ip-lookup.com/json/' + ip)
|
||||
.done(function (response) {
|
||||
$('#mainModal .modal-title').text(ip);
|
||||
$('#mainModal .modal-body').text("");
|
||||
$('#mainModal .modal-body').append("ASN — " + response["as"] + "<br/>");
|
||||
$('#mainModal .modal-body').append("ISP — " + response["isp"] + "<br/>");
|
||||
$('#mainModal .modal-body').append("Organization — " + response["org"] + "<br/>");
|
||||
$('#mainModal .modal-body').append("Location — " + response["city"] + ", " + response["regionName"] + ", " + response["country"] + "<br/>");
|
||||
if (response.ipName.length > 0) {
|
||||
$('#mainModal .modal-body').append("Hostname — " + response.ipName + '<br/>');
|
||||
}
|
||||
if (response.isp.length > 0) {
|
||||
$('#mainModal .modal-body').append("ISP — " + response.isp + '<br/>');
|
||||
}
|
||||
if (response.ipType.length > 0) {
|
||||
$('#mainModal .modal-body').append("Type — " + response.ipType + '<br/>');
|
||||
}
|
||||
if (response.org.length > 0) {
|
||||
$('#mainModal .modal-body').append("Organization — " + response.org + '<br/>');
|
||||
}
|
||||
if (response['businessName'].length > 0) {
|
||||
$('#mainModal .modal-body').append("Business — " + response.businessName + '<br/>');
|
||||
}
|
||||
if (response['businessWebsite'].length > 0) {
|
||||
$('#mainModal .modal-body').append("Website — " + response.businessWebsite + '<br/>');
|
||||
}
|
||||
if (response.city.length > 0 || response.region.length > 0 || response.country.length > 0) {
|
||||
$('#mainModal .modal-body').append("Location — ");
|
||||
}
|
||||
if (response.city.length > 0) {
|
||||
$('#mainModal .modal-body').append(response.city);
|
||||
}
|
||||
if (response.region.length > 0) {
|
||||
$('#mainModal .modal-body').append(', ' + response.region);
|
||||
}
|
||||
if (response.country.length > 0) {
|
||||
$('#mainModal .modal-body').append(', ' + response.country);
|
||||
}
|
||||
|
||||
$('#mainModal').modal();
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
@ -72,39 +99,6 @@ $(document).ready(function () {
|
||||
$('#mainModal').modal();
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* handle action modal
|
||||
*/
|
||||
$('.profile-action').click(function (e) {
|
||||
const actionType = $(this).data('action');
|
||||
$.get('/Action/' + actionType + 'Form')
|
||||
.done(function (response) {
|
||||
$('#actionModal .modal-body').html(response);
|
||||
$('#actionModal').modal();
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
$('#actionModal .modal-body').html('<span class="text-danger">' + error + '</span>');
|
||||
$('#actionModal').modal();
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
* handle action submit
|
||||
*/
|
||||
$(document).on('submit', '.action-form', function (e) {
|
||||
e.preventDefault();
|
||||
$(this).append($('#target_id input'));
|
||||
const data = $(this).serialize();
|
||||
$.get($(this).attr('action') + '/?' + data)
|
||||
.done(function (response) {
|
||||
$('#actionModal .modal-body').html(response);
|
||||
$('#actionModal').modal();
|
||||
})
|
||||
.fail(function (jqxhr, textStatus, error) {
|
||||
$('#actionModal .modal-body').html('<span class="text-danger">Error' + error + '</span>');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function penaltyToName(penaltyName) {
|
||||
@ -179,7 +173,7 @@ function loadMeta(meta) {
|
||||
}
|
||||
}
|
||||
else if (meta.key.includes("Alias")) {
|
||||
eventString = `<div><span class="text-primary">${meta.value}</span></div>`;
|
||||
eventString = `<div><span class="text-success">${meta.value}</span></div>`;
|
||||
}
|
||||
// it's a message
|
||||
else if (meta.key.includes("Event")) {
|
||||
|
Reference in New Issue
Block a user