ui tweaks/improvements including recent players and ip info lookup

This commit is contained in:
RaidMax
2022-04-21 12:39:09 -05:00
parent fd049edb3f
commit 284c2e9726
21 changed files with 422 additions and 325 deletions

View File

@ -1,11 +1,11 @@
function hideLoader() {
$('#mainLoadingBar').fadeOut();
$('#modalLoadingBar').fadeOut();
$('.modal-loading-bar').fadeOut();
}
function showLoader() {
$('#mainLoadingBar').fadeIn();
$('#modalLoadingBar').fadeIn();
$('.modal-loading-bar').fadeIn();
}
function errorLoader() {
@ -151,8 +151,13 @@ $(document).ready(function () {
catch{}
if (message instanceof Array)
{
message = message.join("<br/>");
}
halfmoon.initStickyAlert({
content: message.join("<br/>"),
content: message,
title: 'Error',
alertType: 'alert-danger',
fillType: 'filled'

View File

@ -55,36 +55,35 @@
/*
get ip geolocation info into modal
*/
$('.ip-locate-link').click(function (e) {
e.preventDefault();
$('.profile-ip-lookup').click(function (e) {
const ip = $(this).data("ip");
$.getJSON(`https://ipwhois.app/json/${ip}`)
.done(function (response) {
$('#mainModal .modal-title').text(ip);
$('#mainModal .modal-body').text('');
$('#contextModal .modal-title').text(ip);
const modalBody = $('#contextModal .modal-body');
modalBody.text('');
if (response.isp.length > 0) {
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ISP']} &mdash; ${response.isp}<br/>`);
modalBody.append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ISP']} &mdash; <span class="text-muted">${response.isp}</span><br/>`);
}
if (response.org.length > 0) {
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ORG']} &mdash; ${response.org}<br/>`);
modalBody.append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ORG']} &mdash; <span class="text-muted">${response.org}</span><br/>`);
}
if (response.region.length > 0 || response.city.length > 0 || response.country.length > 0 || response.timezone_gmt.length > 0) {
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_LOCATION']} &mdash; `);
modalBody.append(`${_localization['WEBFRONT_PROFILE_LOOKUP_LOCATION']} &mdash;`);
}
if (response.city.length > 0) {
$('#mainModal .modal-body').append(response.city);
modalBody.append(`<span class="text-muted">${response.city}</span>`);
}
if (response.region.length > 0) {
$('#mainModal .modal-body').append((response.region.length > 0 ? ', ' : '') + response.region);
modalBody.append(`<span class="text-muted">${(response.region.length > 0 ? ', ' : '') + response.region}</span>`);
}
if (response.country.length > 0) {
$('#mainModal .modal-body').append((response.country.length > 0 ? ', ' : '') + response.country);
modalBody.append(`<span class="text-muted">${(response.country.length > 0 ? ', ' : '') + response.country}</span>`);
}
if (response.timezone_gmt.length > 0) {
$('#mainModal .modal-body').append((response.timezone_gmt.length > 0 ? ', ' : '') + response.timezone_gmt);
modalBody.append(`<br/>Timezone &mdash; <span class="text-muted">UTC${response.timezone_gmt}</span>`);
}
$('#mainModal').modal();
modalBody.append('</span>');
})
.fail(function (jqxhr, textStatus, error) {
$('#mainModal .modal-title').text("Error");