fix issue with restarting via web

replace some hard coded string in javascript with localization
break things to fix things
This commit is contained in:
RaidMax
2019-05-17 09:02:09 -05:00
parent 5f588bb0f7
commit 0b0290a871
17 changed files with 134 additions and 129 deletions

View File

@ -7,7 +7,7 @@
}
if (command[0] !== '!') {
$('#console_command_response').text('All commands must start with !').addClass('text-danger');
$('#console_command_response').text(_localization['WEBFRONT_CONSOLE_COMMAND']).addClass('text-danger');
return false;
}
showLoader();
@ -20,7 +20,7 @@
.fail(function (jqxhr, textStatus, error) {
errorLoader();
hideLoader();
$('#console_command_response').text('Could not execute command: ' + error).addClass('text-danger');
$('#console_command_response').text(_localization['WEBFRONT_CONSOLE_ERROR'] + error).addClass('text-danger');
});
}

View File

@ -29,10 +29,10 @@ if ($('#penalty_table').length === 1) {
$('#penalty_filter_selection').change(function() {
location = location.href.split('?')[0] + "?showOnly=" + $('#penalty_filter_selection').val();
});
/*
https://stackoverflow.com/questions/19731730/jquery-js-detect-users-scroll-attempt-without-any-window-overflow-to-scroll
*/
$('html').bind('mousewheel DOMMouseScroll', function (e) {
var delta = (e.originalEvent.wheelDelta || -e.originalEvent.detail);
@ -44,7 +44,6 @@ if ($('#penalty_table').length === 1) {
/*
https://stackoverflow.com/questions/3898130/check-if-a-user-has-scrolled-to-the-bottom
*/
var _throttleTimer = null;
var _throttleDelay = 100;
var $window = $(window);

View File

@ -60,33 +60,33 @@
$.getJSON('https://extreme-ip-lookup.com/json/' + ip)
.done(function (response) {
$('#mainModal .modal-title').text(ip);
$('#mainModal .modal-body').text("");
$('#mainModal .modal-body').text('');
if (response.ipName.length > 0) {
$('#mainModal .modal-body').append("Hostname &mdash; " + response.ipName + '<br/>');
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_HOSTNAME']} &mdash; ${response.ipName}<br/>`);
}
if (response.isp.length > 0) {
$('#mainModal .modal-body').append("ISP &mdash; " + response.isp + '<br/>');
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ISP']} &mdash; ${response.isp}<br/>`);
}
if (response.org.length > 0) {
$('#mainModal .modal-body').append("Organization &mdash; " + response.org + '<br/>');
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_ORG']} &mdash; ${response.org}<br/>`);
}
if (response['businessName'].length > 0) {
$('#mainModal .modal-body').append("Business &mdash; " + response.businessName + '<br/>');
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_BUSINESS']} &mdash; ${response.businessName}<br/>`);
}
if (response['businessWebsite'].length > 0) {
$('#mainModal .modal-body').append("Website &mdash; " + response.businessWebsite + '<br/>');
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_WEBSITE']} &mdash; ${response.businessWebsite}<br/>`);
}
if (response.city.length > 0 || response.region.length > 0 || response.country.length > 0) {
$('#mainModal .modal-body').append("Location &mdash; ");
$('#mainModal .modal-body').append(`${_localization['WEBFRONT_PROFILE_LOOKUP_LOCATION']} &mdash; `);
}
if (response.city.length > 0) {
$('#mainModal .modal-body').append(response.city);
}
if (response.region.length > 0) {
$('#mainModal .modal-body').append(', ' + response.region);
$('#mainModal .modal-body').append((response.city.length > 0 ? ', ' : '') + response.region);
}
if (response.country.length > 0) {
$('#mainModal .modal-body').append(', ' + response.country);
$('#mainModal .modal-body').append((response.country.length > 0 ? ', ' : '') + response.country);
}
$('#mainModal').modal();

View File

@ -84,7 +84,7 @@ function refreshClientActivity() {
$('#server_clientactivity_' + serverId).html(response);
})
.fail(function (jqxhr, textStatus, error) {
$('#server_clientactivity_' + serverId).html(" Could not load client activity - " + error);
$('#server_clientactivity_' + serverId).html('');
});
});
}

View File

@ -31,7 +31,7 @@
}
},
title: {
text: "Performance History",
text: _localization['WEBFRONT_STATS_PERFORMANCE_HISTORY'],
fontSize: 14
},
axisX: {
@ -39,14 +39,14 @@
lineThickness: 0,
tickThickness: 0,
margin: 0,
valueFormatString: " ",
valueFormatString: ' ',
},
axisY: {
labelFontSize: 12,
interval: interval,
gridThickness: 0,
lineThickness: 0.5,
valueFormatString: "#,##0",
valueFormatString: '#,##0',
minimum: min,
maximum: max
},
@ -54,7 +54,7 @@
dockInsidePlotArea: true
},
data: [{
type: "splineArea",
type: 'splineArea',
color: 'rgba(0, 122, 204, 0.25)',
markerSize: 3.5,
dataPoints: fixedData