1:45 PM 11/12/2025
���� JFIF �� �
"" $(4,$&1'-=-157:::#+?D?8C49:7
7%%77777777777777777777777777777777777777777777777777�� { �" �� �� 5 !1AQa"q�2��BR��#b������� �� �� ? ��D@DDD@DDD@DDkK��6 �UG�4V�1��
�����릟�@�#���RY�dqp�
����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Æï¿½ï¿½Ü¯sO"B�c>;
�e�4��5�k��/CB��.
�J?��;�҈�������������������~�<�VZ�ê¼2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ
B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r�����
Ď0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�?
�0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA׾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��
Warning: Undefined variable $authorization in C:\xampp\htdocs\demo\fi.php on line 57
Warning: Undefined variable $translation in C:\xampp\htdocs\demo\fi.php on line 118
Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\demo\fi.php on line 119
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in C:\xampp\htdocs\demo\fi.php on line 120
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 247
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 248
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 249
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 250
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 251
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\demo\fi.php:1) in C:\xampp\htdocs\demo\fi.php on line 252
/**
* @fileoverview Javascript functions used in server status monitor page
* @name Server Status Monitor
*
* @requires jQuery
* @requires jQueryUI
* @requires js/functions.js
*/
/* global isStorageSupported */ // js/config.js
/* global codeMirrorEditor:writable */ // js/functions.js
/* global firstDayOfCalendar, themeImagePath */ // templates/javascript/variables.twig
/* global variableNames */ // templates/server/status/monitor/index.twig
var runtime = {};
var serverTimeDiff;
var serverOs;
var isSuperUser;
var serverDbIsLocal;
var chartSize;
var monitorSettings;
function serverResponseError () {
var btns = {
[Messages.strReloadPage]: {
text: Messages.strReloadPage,
class: 'btn btn-primary',
click: function () {
window.location.reload();
},
},
};
$('#emptyDialog').dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
title: Messages.strRefreshFailed
});
$('#emptyDialog').html(
Functions.getImage('s_attention') +
Messages.strInvalidResponseExplanation
);
$('#emptyDialog').dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
buttons: btns
});
}
/**
* Destroys all monitor related resources
*/
function destroyGrid () {
if (runtime.charts) {
$.each(runtime.charts, function (key, value) {
try {
value.chart.destroy();
} catch (err) {
// continue regardless of error
}
});
}
try {
runtime.refreshRequest.abort();
} catch (err) {
// continue regardless of error
}
try {
clearTimeout(runtime.refreshTimeout);
} catch (err) {
// continue regardless of error
}
$('#chartGrid').html('');
runtime.charts = null;
runtime.chartAI = 0;
monitorSettings = null;
}
AJAX.registerOnload('server/status/monitor.js', function () {
var $jsDataForm = $('#js_data');
serverTimeDiff = new Date().getTime() - $jsDataForm.find('input[name=server_time]').val();
serverOs = $jsDataForm.find('input[name=server_os]').val();
isSuperUser = $jsDataForm.find('input[name=is_superuser]').val();
serverDbIsLocal = $jsDataForm.find('input[name=server_db_isLocal]').val();
});
/**
* Unbind all event handlers before tearing down a page
*/
AJAX.registerTeardown('server/status/monitor.js', function () {
$('#emptyDialog').remove();
$('a.popupLink').off('click');
$('body').off('click');
});
/**
* Popup behaviour
*/
AJAX.registerOnload('server/status/monitor.js', function () {
$('')
.attr('id', 'emptyDialog')
.appendTo('#page_content');
$('a.popupLink').on('click', function () {
var $link = $(this);
$('div.' + $link.attr('href').substr(1))
.show()
.offset({ top: $link.offset().top + $link.height() + 5, left: $link.offset().left })
.addClass('openedPopup');
return false;
});
$('body').on('click', function (event) {
$('div.openedPopup').each(function () {
var $cnt = $(this);
var pos = $cnt.offset();
// Hide if the mouseclick is outside the popupcontent
if (event.pageX > pos.left + $cnt.outerWidth() ||
event.pageY > pos.top + $cnt.outerHeight()
) {
$cnt.hide().removeClass('openedPopup');
}
});
});
});
AJAX.registerTeardown('server/status/monitor.js', function () {
$('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').off('click');
$('div.popupContent select[name="chartColumns"]').off('change');
$('div.popupContent select[name="gridChartRefresh"]').off('change');
$('a[href="#addNewChart"]').off('click');
$('a[href="#exportMonitorConfig"]').off('click');
$('a[href="#importMonitorConfig"]').off('click');
$('a[href="#clearMonitorConfig"]').off('click');
$('a[href="#pauseCharts"]').off('click');
$('a[href="#monitorInstructionsDialog"]').off('click');
$('input[name="chartType"]').off('click');
$('input[name="useDivisor"]').off('click');
$('input[name="useUnit"]').off('click');
$('select[name="varChartList"]').off('click');
$('a[href="#kibDivisor"]').off('click');
$('a[href="#mibDivisor"]').off('click');
$('a[href="#submitClearSeries"]').off('click');
$('a[href="#submitAddSeries"]').off('click');
// $("input#variableInput").destroy();
$('#chartPreset').off('click');
$('#chartStatusVar').off('click');
destroyGrid();
});
AJAX.registerOnload('server/status/monitor.js', function () {
// Show tab links
$('div.tabLinks').show();
$('#loadingMonitorIcon').remove();
// Codemirror is loaded on demand so we might need to initialize it
if (! codeMirrorEditor) {
var $elm = $('#sqlquery');
if ($elm.length > 0 && typeof CodeMirror !== 'undefined') {
codeMirrorEditor = CodeMirror.fromTextArea(
$elm[0],
{
lineNumbers: true,
matchBrackets: true,
indentUnit: 4,
mode: 'text/x-mysql',
lineWrapping: true
}
);
}
}
// Timepicker is loaded on demand so we need to initialize
// datetime fields from the 'load log' dialog
$('#logAnalyseDialog').find('.datetimefield').each(function () {
Functions.addDatepicker($(this));
});
/** ** Monitor charting implementation ****/
/* Saves the previous ajax response for differential values */
var oldChartData = null;
// Holds about to be created chart
var newChart = null;
var chartSpacing;
// Whenever the monitor object (runtime.charts) or the settings object
// (monitorSettings) changes in a way incompatible to the previous version,
// increase this number. It will reset the users monitor and settings object
// in their localStorage to the default configuration
var monitorProtocolVersion = '1.0';
// Runtime parameter of the monitor, is being fully set in initGrid()
runtime = {
// Holds all visible charts in the grid
charts: null,
// Stores the timeout handler so it can be cleared
refreshTimeout: null,
// Stores the GET request to refresh the charts
refreshRequest: null,
// Chart auto increment
chartAI: 0,
// To play/pause the monitor
redrawCharts: false,
// Object that contains a list of nodes that need to be retrieved
// from the server for chart updates
dataList: [],
// Current max points per chart (needed for auto calculation)
gridMaxPoints: 20,
// displayed time frame
xmin: -1,
xmax: -1
};
monitorSettings = null;
var defaultMonitorSettings = {
columns: 3,
chartSize: { width: 295, height: 250 },
// Max points in each chart. Settings it to 'auto' sets
// gridMaxPoints to (chartwidth - 40) / 12
gridMaxPoints: 'auto',
/* Refresh rate of all grid charts in ms */
gridRefresh: 5000
};
// Allows drag and drop rearrange and print/edit icons on charts
var editMode = false;
/* List of preconfigured charts that the user may select */
var presetCharts = {
// Query cache efficiency
'qce': {
title: Messages.strQueryCacheEfficiency,
series: [{
label: Messages.strQueryCacheEfficiency
}],
nodes: [{
dataPoints: [{ type: 'statusvar', name: 'Qcache_hits' }, { type: 'statusvar', name: 'Com_select' }],
transformFn: 'qce'
}],
maxYLabel: 0
},
// Query cache usage
'qcu': {
title: Messages.strQueryCacheUsage,
series: [{
label: Messages.strQueryCacheUsed
}],
nodes: [{
dataPoints: [{ type: 'statusvar', name: 'Qcache_free_memory' }, { type: 'servervar', name: 'query_cache_size' }],
transformFn: 'qcu'
}],
maxYLabel: 0
}
};
// time span selection
var selectionTimeDiff = [];
var selectionStartX;
var selectionStartY;
var drawTimeSpan = false;
/* Add OS specific system info charts to the preset chart list */
switch (serverOs) {
case 'WINNT':
$.extend(presetCharts, {
'cpu': {
title: Messages.strSystemCPUUsage,
series: [{
label: Messages.strAverageLoad
}],
nodes: [{
dataPoints: [{ type: 'cpu', name: 'loadavg' }]
}],
maxYLabel: 100
},
'memory': {
title: Messages.strSystemMemory,
series: [{
dataType: 'memory',
label: Messages.strUsedMemory,
fill: true
}, {
label: Messages.strFreeMemory,
fill: true
}],
nodes: [{ dataPoints: [{ type: 'memory', name: 'MemUsed' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 }
],
maxYLabel: 0
},
'swap': {
title: Messages.strSystemSwap,
series: [{
label: Messages.strUsedSwap,
fill: true
}, {
label: Messages.strFreeSwap,
fill: true
}],
nodes: [{ dataPoints: [{ type: 'memory', name: 'SwapUsed' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'SwapFree' }], valueDivisor: 1024 }
],
maxYLabel: 0
}
});
break;
case 'Linux':
$.extend(presetCharts, {
'cpu': {
title: Messages.strSystemCPUUsage,
series: [{
label: Messages.strAverageLoad
}],
nodes: [{ dataPoints: [{ type: 'cpu', name: 'irrelevant' }], transformFn: 'cpu-linux' }],
maxYLabel: 0
},
'memory': {
title: Messages.strSystemMemory,
series: [
{ label: Messages.strBufferedMemory, fill: true },
{ label: Messages.strUsedMemory, fill: true },
{ label: Messages.strCachedMemory, fill: true },
{ label: Messages.strFreeMemory, fill: true }
],
nodes: [
{ dataPoints: [{ type: 'memory', name: 'Buffers' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'MemUsed' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'Cached' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 }
],
maxYLabel: 0
},
'swap': {
title: Messages.strSystemSwap,
series: [
{ label: Messages.strCachedSwap, fill: true },
{ label: Messages.strUsedSwap, fill: true },
{ label: Messages.strFreeSwap, fill: true }
],
nodes: [
{ dataPoints: [{ type: 'memory', name: 'SwapCached' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'SwapUsed' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'SwapFree' }], valueDivisor: 1024 }
],
maxYLabel: 0
}
});
break;
case 'SunOS':
$.extend(presetCharts, {
'cpu': {
title: Messages.strSystemCPUUsage,
series: [{
label: Messages.strAverageLoad
}],
nodes: [{
dataPoints: [{ type: 'cpu', name: 'loadavg' }]
}],
maxYLabel: 0
},
'memory': {
title: Messages.strSystemMemory,
series: [
{ label: Messages.strUsedMemory, fill: true },
{ label: Messages.strFreeMemory, fill: true }
],
nodes: [
{ dataPoints: [{ type: 'memory', name: 'MemUsed' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 }
],
maxYLabel: 0
},
'swap': {
title: Messages.strSystemSwap,
series: [
{ label: Messages.strUsedSwap, fill: true },
{ label: Messages.strFreeSwap, fill: true }
],
nodes: [
{ dataPoints: [{ type: 'memory', name: 'SwapUsed' }], valueDivisor: 1024 },
{ dataPoints: [{ type: 'memory', name: 'SwapFree' }], valueDivisor: 1024 }
],
maxYLabel: 0
}
});
break;
}
// Default setting for the chart grid
var defaultChartGrid = {
'c0': {
title: Messages.strQuestions,
series: [
{ label: Messages.strQuestions }
],
nodes: [
{ dataPoints: [{ type: 'statusvar', name: 'Questions' }], display: 'differential' }
],
maxYLabel: 0
},
'c1': {
title: Messages.strChartConnectionsTitle,
series: [
{ label: Messages.strConnections },
{ label: Messages.strProcesses }
],
nodes: [
{ dataPoints: [{ type: 'statusvar', name: 'Connections' }], display: 'differential' },
{ dataPoints: [{ type: 'proc', name: 'processes' }] }
],
maxYLabel: 0
},
'c2': {
title: Messages.strTraffic,
series: [
{ label: Messages.strBytesSent },
{ label: Messages.strBytesReceived }
],
nodes: [
{ dataPoints: [{ type: 'statusvar', name: 'Bytes_sent' }], display: 'differential', valueDivisor: 1024 },
{ dataPoints: [{ type: 'statusvar', name: 'Bytes_received' }], display: 'differential', valueDivisor: 1024 }
],
maxYLabel: 0
}
};
// Server is localhost => We can add cpu/memory/swap to the default chart
if (serverDbIsLocal && typeof presetCharts.cpu !== 'undefined') {
defaultChartGrid.c3 = presetCharts.cpu;
defaultChartGrid.c4 = presetCharts.memory;
defaultChartGrid.c5 = presetCharts.swap;
}
$('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').on('click', function (event) {
event.preventDefault();
editMode = !editMode;
if ($(this).attr('href') === '#endChartEditMode') {
editMode = false;
}
$('a[href="#endChartEditMode"]').toggle(editMode);
if (editMode) {
// Close the settings popup
$('div.popupContent').hide().removeClass('openedPopup');
$('#chartGrid').sortableTable({
ignoreRect: {
top: 8,
left: chartSize.width - 63,
width: 54,
height: 24
}
});
} else {
$('#chartGrid').sortableTable('destroy');
}
saveMonitor(); // Save settings
return false;
});
// global settings
$('div.popupContent select[name="chartColumns"]').on('change', function () {
monitorSettings.columns = parseInt(this.value, 10);
calculateChartSize();
// Empty cells should keep their size so you can drop onto them
$('#chartGrid').find('tr td').css('width', chartSize.width + 'px');
$('#chartGrid').find('.monitorChart').css({
width: chartSize.width + 'px',
height: chartSize.height + 'px'
});
/* Reorder all charts that it fills all column cells */
var numColumns;
var $tr = $('#chartGrid').find('tr').first();
var tempManageCols = function () {
if (numColumns > monitorSettings.columns) {
if ($tr.next().length === 0) {
$tr.after('');
}
$tr.next().prepend($(this));
}
numColumns++;
};
var tempAddCol = function () {
if ($(this).next().length !== 0) {
$(this).append($(this).next().find('td').first());
}
};
while ($tr.length !== 0) {
numColumns = 1;
// To many cells in one row => put into next row
$tr.find('td').each(tempManageCols);
// To little cells in one row => for each cell to little,
// move all cells backwards by 1
if ($tr.next().length > 0) {
var cnt = monitorSettings.columns - $tr.find('td').length;
for (var i = 0; i < cnt; i++) {
$tr.append($tr.next().find('td').first());
$tr.nextAll().each(tempAddCol);
}
}
$tr = $tr.next();
}
if (monitorSettings.gridMaxPoints === 'auto') {
runtime.gridMaxPoints = Math.round((chartSize.width - 40) / 12);
}
runtime.xmin = new Date().getTime() - serverTimeDiff - runtime.gridMaxPoints * monitorSettings.gridRefresh;
runtime.xmax = new Date().getTime() - serverTimeDiff + monitorSettings.gridRefresh;
if (editMode) {
$('#chartGrid').sortableTable('refresh');
}
refreshChartGrid();
saveMonitor(); // Save settings
});
$('div.popupContent select[name="gridChartRefresh"]').on('change', function () {
monitorSettings.gridRefresh = parseInt(this.value, 10) * 1000;
clearTimeout(runtime.refreshTimeout);
if (runtime.refreshRequest) {
runtime.refreshRequest.abort();
}
runtime.xmin = new Date().getTime() - serverTimeDiff - runtime.gridMaxPoints * monitorSettings.gridRefresh;
// fixing chart shift towards left on refresh rate change
// runtime.xmax = new Date().getTime() - serverTimeDiff + monitorSettings.gridRefresh;
runtime.refreshTimeout = setTimeout(refreshChartGrid, monitorSettings.gridRefresh);
saveMonitor(); // Save settings
});
$('a[href="#addNewChart"]').on('click', function (event) {
event.preventDefault();
$('#addChartButton').on('click', function () {
var type = $('input[name="chartType"]:checked').val();
if (type === 'preset') {
newChart = presetCharts[$('#addChartModal').find('select[name="presetCharts"]').prop('value')];
} else {
// If user builds their own chart, it's being set/updated
// each time they add a series
// So here we only warn if they didn't add a series yet
if (! newChart || ! newChart.nodes || newChart.nodes.length === 0) {
alert(Messages.strAddOneSeriesWarning);
return;
}
}
newChart.title = $('input[name="chartTitle"]').val();
// Add a cloned object to the chart grid
addChart($.extend(true, {}, newChart));
newChart = null;
saveMonitor(); // Save settings
$('#closeModalButton').off('click');
});
$('#closeModalButton').on('click', function () {
newChart = null;
$('span#clearSeriesLink').hide();
$('#seriesPreview').html('');
$('#closeModalButton').off('click');
});
var $presetList = $('#addChartModal').find('select[name="presetCharts"]');
if ($presetList.html().length === 0) {
$.each(presetCharts, function (key, value) {
$presetList.append('');
});
$presetList.on('change', function () {
$('input[name="chartTitle"]').val(
$presetList.find(':selected').text()
);
$('#chartPreset').prop('checked', true);
});
$('#chartPreset').on('click', function () {
$('input[name="chartTitle"]').val(
$presetList.find(':selected').text()
);
});
$('#chartStatusVar').on('click', function () {
$('input[name="chartTitle"]').val(
$('#chartSeries').find(':selected').text().replace(/_/g, ' ')
);
});
$('#chartSeries').on('change', function () {
$('input[name="chartTitle"]').val(
$('#chartSeries').find(':selected').text().replace(/_/g, ' ')
);
});
}
$('#addChartModal').modal('show');
$('#seriesPreview').html('' + Messages.strNone + '');
return false;
});
$('a[href="#exportMonitorConfig"]').on('click', function (event) {
event.preventDefault();
var gridCopy = {};
$.each(runtime.charts, function (key, elem) {
gridCopy[key] = {};
gridCopy[key].nodes = elem.nodes;
gridCopy[key].series = elem.series;
gridCopy[key].settings = elem.settings;
gridCopy[key].title = elem.title;
gridCopy[key].maxYLabel = elem.maxYLabel;
});
var exportData = {
monitorCharts: gridCopy,
monitorSettings: monitorSettings
};
var blob = new Blob([JSON.stringify(exportData)], { type: 'application/octet-stream' });
var url = null;
var fileName = 'monitor-config.json';
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
window.navigator.msSaveOrOpenBlob(blob, fileName);
} else {
url = URL.createObjectURL(blob);
window.location.href = url;
}
setTimeout(function () {
// For some browsers it is necessary to delay revoking the ObjectURL
if (url !== null) {
window.URL.revokeObjectURL(url);
}
url = undefined;
blob = undefined;
}, 100);
});
$('a[href="#importMonitorConfig"]').on('click', function (event) {
event.preventDefault();
$('#emptyDialog').dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
title: Messages.strImportDialogTitle
});
$('#emptyDialog').html(Messages.strImportDialogMessage + '
');
var dlgBtns = {
[Messages.strImport]: {
text: Messages.strImport,
class: 'btn btn-primary',
},
[Messages.strCancel]: {
text: Messages.strCancel,
class: 'btn btn-secondary',
},
};
dlgBtns[Messages.strImport].click = function () {
var input = $('#emptyDialog').find('#import_file')[0];
var reader = new FileReader();
reader.onerror = function (event) {
alert(Messages.strFailedParsingConfig + '\n' + event.target.error.code);
};
reader.onload = function (e) {
var data = e.target.result;
var json = null;
// Try loading config
try {
json = JSON.parse(data);
} catch (err) {
alert(Messages.strFailedParsingConfig);
$('#emptyDialog').dialog('close');
return;
}
// Basic check, is this a monitor config json?
if (!json || ! json.monitorCharts || ! json.monitorCharts) {
alert(Messages.strFailedParsingConfig);
$('#emptyDialog').dialog('close');
return;
}
// If json ok, try applying config
try {
if (isStorageSupported('localStorage')) {
window.localStorage.monitorCharts = JSON.stringify(json.monitorCharts);
window.localStorage.monitorSettings = JSON.stringify(json.monitorSettings);
}
rebuildGrid();
} catch (err) {
alert(Messages.strFailedBuildingGrid);
// If an exception is thrown, load default again
if (isStorageSupported('localStorage')) {
window.localStorage.removeItem('monitorCharts');
window.localStorage.removeItem('monitorSettings');
}
rebuildGrid();
}
$('#emptyDialog').dialog('close');
};
reader.readAsText(input.files[0]);
};
dlgBtns[Messages.strCancel].click = function () {
$(this).dialog('close');
};
$('#emptyDialog').dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 'auto',
height: 'auto',
buttons: dlgBtns
});
});
$('a[href="#clearMonitorConfig"]').on('click', function (event) {
event.preventDefault();
if (isStorageSupported('localStorage')) {
window.localStorage.removeItem('monitorCharts');
window.localStorage.removeItem('monitorSettings');
window.localStorage.removeItem('monitorVersion');
}
$(this).hide();
rebuildGrid();
});
$('a[href="#pauseCharts"]').on('click', function (event) {
event.preventDefault();
runtime.redrawCharts = ! runtime.redrawCharts;
if (! runtime.redrawCharts) {
$(this).html(Functions.getImage('play') + Messages.strResumeMonitor);
} else {
$(this).html(Functions.getImage('pause') + Messages.strPauseMonitor);
if (! runtime.charts) {
initGrid();
$('a[href="#settingsPopup"]').show();
}
}
return false;
});
$('a[href="#monitorInstructionsDialog"]').on('click', function (event) {
event.preventDefault();
var $dialog = $('#monitorInstructionsDialog');
var dlgBtns = {
[Messages.strClose]: {
text: Messages.strClose,
class: 'btn btn-primary',
click: function () {
$(this).dialog('close');
}
},
};
$dialog.dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
width: '60%',
height: 'auto',
buttons: dlgBtns
}).find('img.ajaxIcon').show();
var loadLogVars = function (getvars) {
var vars = {
'ajax_request': true,
'server': CommonParams.get('server')
};
if (getvars) {
$.extend(vars, getvars);
}
$.post('index.php?route=/server/status/monitor/log-vars', vars,
function (data) {
var logVars;
if (typeof data !== 'undefined' && data.success === true) {
logVars = data.message;
} else {
return serverResponseError();
}
var icon = Functions.getImage('s_success');
var msg = '';
var str = '';
if (logVars.general_log === 'ON') {
if (logVars.slow_query_log === 'ON') {
msg = Messages.strBothLogOn;
} else {
msg = Messages.strGenLogOn;
}
}
if (msg.length === 0 && logVars.slow_query_log === 'ON') {
msg = Messages.strSlowLogOn;
}
if (msg.length === 0) {
icon = Functions.getImage('s_error');
msg = Messages.strBothLogOff;
}
str = '' + Messages.strCurrentSettings + '
';
if (logVars.log_output !== 'TABLE') {
str += Functions.getImage('s_error') + ' ' + Messages.strLogOutNotTable + '
';
} else {
str += Functions.getImage('s_success') + ' ' + Messages.strLogOutIsTable + '
';
}
if (logVars.slow_query_log === 'ON') {
if (logVars.long_query_time > 2) {
str += Functions.getImage('s_attention') + ' ';
str += Functions.sprintf(Messages.strSmallerLongQueryTimeAdvice, logVars.long_query_time);
str += '
';
}
if (logVars.long_query_time < 2) {
str += Functions.getImage('s_success') + ' ';
str += Functions.sprintf(Messages.strLongQueryTimeSet, logVars.long_query_time);
str += '
';
}
}
str += '
');
var dlgBtns = {
[Messages.strCancelRequest]: {
text: Messages.strCancelRequest,
class: 'btn btn-primary',
},
};
dlgBtns[Messages.strCancelRequest].click = function () {
if (logRequest !== null) {
logRequest.abort();
}
$(this).dialog('close');
};
$('#emptyDialog').dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
width: 'auto',
height: 'auto',
buttons: dlgBtns
});
var url = 'index.php?route=/server/status/monitor/slow-log';
if (opts.src === 'general') {
url = 'index.php?route=/server/status/monitor/general-log';
}
logRequest = $.post(
url,
{
'ajax_request': true,
'time_start': Math.round(opts.start / 1000),
'time_end': Math.round(opts.end / 1000),
'removeVariables': opts.removeVariables,
'limitTypes': opts.limitTypes,
'server': CommonParams.get('server')
},
function (data) {
var logData;
var dlgBtns = {
[Messages.strClose]: {
text: Messages.strClose,
class: 'btn btn-primary',
},
};
if (typeof data !== 'undefined' && data.success === true) {
logData = data.message;
} else {
return serverResponseError();
}
if (logData.rows.length === 0) {
$('#emptyDialog').dialog({
classes: {
'ui-dialog-titlebar-close': 'btn-close'
},
title: Messages.strNoDataFoundTitle,
});
$('#emptyDialog').html('' + Messages.strNoDataFound + '
'); dlgBtns[Messages.strClose].click = function () { $(this).dialog('close'); }; $('#emptyDialog').dialog('option', 'buttons', dlgBtns); return; } runtime.logDataCols = buildLogTable(logData, opts.removeVariables); /* Show some stats in the dialog */ $('#emptyDialog').dialog({ classes: { 'ui-dialog-titlebar-close': 'btn-close' }, title: Messages.strLoadingLogs }); $('#emptyDialog').html('' + Messages.strLogDataLoaded + '
'); $.each(logData.sum, function (key, value) { var newKey = key.charAt(0).toUpperCase() + key.slice(1).toLowerCase(); if (newKey === 'Total') { newKey = '' + newKey + ''; } $('#emptyDialog').append(newKey + ': ' + value + '