Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 3178 → Rev 3179

/web/acc/phpsysinfo/js/jQuery/README
4,7 → 4,7
 
jquery.js
---------
VERSION : 1.12.4-ff3fix-ff2fix
VERSION : v1.12.4-ff3fix-ff2fix-CVE_2015_9251fix-CVE_2019_11358fix
URL : http://jquery.com/
DESC : jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle
events, perform animations, and add Ajax interactions to your web pages.
13,7 → 13,7
 
jquery.dataTables.js
--------------------
VERSION : 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix
VERSION : 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix+noeval
URL : http://plugins.jquery.com/project/DataTables
DESC : dataTables is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable
table without page refreshes.
21,7 → 21,7
 
jquery.nyroModal.js
-------------------
VERSION : 1.6.2+jquery1.8fix+bindfix
VERSION : 1.6.2+jquery1.8fix+bindfix+ff2fix
URL : http://plugins.jquery.com/project/nyroModal
DESC : nyroModal is a high customizable modal window plugin.
USED : provide a modal dialog, that is shown when errors are found during execution of the php parsers, or lets say
50,7 → 50,7
 
jquery.ifixpng.js
-------------------
VERSION : 2.1 (23/04/2008)+jquery1.8fix
VERSION : 2.1 (23/04/2008)+jquery1.9fix
URL : http://jquery.khurshid.com
DESC : Designed to fix that problem by applying appropriate filters to user specified elements, while keeping all element tags intact.
USED : used for the entire userinterface
/web/acc/phpsysinfo/js/jQuery/README_bootstrap
3,7 → 3,7
 
jquery.js
---------
VERSION : 1.12.4-ff3fix-ff2fix
VERSION : v1.12.4-ff3fix-ff2fix-CVE_2015_9251fix-CVE_2019_11358fix
URL : http://jquery.com/
DESC : jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle
events, perform animations, and add Ajax interactions to your web pages.
/web/acc/phpsysinfo/js/jQuery/jquery.dataTables.js
1,6 → 1,6
/*
* File: jquery.dataTables.js
* Version: 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix
* Version: 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix+noeval
* Description: Paginate, search and sort HTML tables
* Author: Allan Jardine (www.sprymedia.co.uk)
* Created: 28/3/2008
6376,6 → 6376,7
if ( iLength+10 > 4096 ) /* Magic 10 for padding */
{
var aCookies =document.cookie.split(';');
var sData;
for ( var i=0, iLen=aCookies.length ; i<iLen ; i++ )
{
if ( aCookies[i].indexOf( sBaseName ) != -1 )
6382,7 → 6383,11
{
/* It's a DataTables cookie, so eval it and check the time stamp */
var aSplitCookie = aCookies[i].split('=');
try { oData = eval( '('+decodeURIComponent(aSplitCookie[1])+')' ); }
try {
sData = decodeURIComponent(aSplitCookie[1]);
oData = (typeof JSON.parse == 'function') ?
JSON.parse( sData.replace(/'/g, '"') ) : $.parseJSON( sData.replace(/'/g, '"') ); }
//try { oData = eval( '('+decodeURIComponent(aSplitCookie[1])+')' ); }
catch( e ) { continue; }
if ( typeof oData.iCreate != 'undefined' && oData.iCreate < iOldTime )
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo.js
29,6 → 29,13
showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showMemoryInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, showTotals, increaseWidth, oldnetwork = [];
 
/**
* Fix potential XSS vulnerability in jQuery
*/
jQuery.htmlPrefilter = function( html ) {
return html;
};
 
/**
* Fix PNG loading on IE6 or below
*/
function PNGload(png) {
121,7 → 128,7
} else {
$('link[rel*=style][title]').each(function getTitle(i) {
if (this.getAttribute('title') === 'PSI_Template') {
this.setAttribute('href', './templates/' + template + ".css");
this.setAttribute('href', './templates/' + template + ".css");
}
});
}
621,11 → 628,22
* @param {Number} size barclass
* @return {String} HTML string which contains the full layout of the bar
*/
function createBar(size, barclass) {
function createBar(size, barclass, sizeused) {
var percsize = 0, percsizeused = 0;
if (barclass === undefined) {
barclass = "bar";
}
return "<div class=\"" + barclass + "\" style=\"float:left; width: " + Math.max(Math.min(Math.round(size), 100), 0) + "px;\">&nbsp;</div>&nbsp;" + size + "%";
percsize = Math.max(Math.min(Math.ceil(size), 100), 0);
if (sizeused === undefined) {
percsizeused = percsize;
} else {
percsizeused = Math.max(Math.min(Math.ceil(sizeused), size), 0);
}
if (percsizeused == percsize) {
return "<div class=\"" + barclass + "\" style=\"float:left; width: " + percsizeused + "px;\">&nbsp;</div>&nbsp;" + size + "%";
} else {
return "<div class=\"" + barclass + "\" style=\"float:left; width: " + percsizeused + "px;\">&nbsp;</div><div class=\"barrest\" style=\"float:left; width: " + (percsize-percsizeused) + "px;\">&nbsp;</div>&nbsp;" + size + "%";
}
}
 
/**
663,7 → 681,7
}
 
var kernel = "", distro = "", icon = "", uptime = "", users = 0, loadavg = "", os = "";
var processes = 0, prunning = 0, psleeping = 0, pstopped = 0, pzombie = 0, pwaiting = 0, pother = 0;
var processes = 0, psarray = [0,0,0,0,0,0];
var syslang = "", codepage = "";
var lastboot = 0;
var timestamp = parseInt($("Generation", xml).attr("timestamp"), 10)*1000; //server time
702,32 → 720,32
processes = parseInt($(this).attr("Processes"), 10);
}
if ($(this).attr("ProcessesRunning") !== undefined) {
prunning = parseInt($(this).attr("ProcessesRunning"), 10);
psarray[0] = parseInt($(this).attr("ProcessesRunning"), 10);
}
if ($(this).attr("ProcessesSleeping") !== undefined) {
psleeping = parseInt($(this).attr("ProcessesSleeping"), 10);
psarray[1] = parseInt($(this).attr("ProcessesSleeping"), 10);
}
if ($(this).attr("ProcessesStopped") !== undefined) {
pstopped = parseInt($(this).attr("ProcessesStopped"), 10);
psarray[2] = parseInt($(this).attr("ProcessesStopped"), 10);
}
if ($(this).attr("ProcessesZombie") !== undefined) {
pzombie = parseInt($(this).attr("ProcessesZombie"), 10);
psarray[3] = parseInt($(this).attr("ProcessesZombie"), 10);
}
if ($(this).attr("ProcessesWaiting") !== undefined) {
pwaiting = parseInt($(this).attr("ProcessesWaiting"), 10);
psarray[4] = parseInt($(this).attr("ProcessesWaiting"), 10);
}
if ($(this).attr("ProcessesOther") !== undefined) {
pother = parseInt($(this).attr("ProcessesOther"), 10);
psarray[5] = parseInt($(this).attr("ProcessesOther"), 10);
}
 
document.title = "System information: " + hostname + " (" + ip + ")";
$("#s_hostname_title").html(hostname);
$("#s_ip_title").html(ip);
$("#s_ip_title").html(ip);
setAndStrip("#s_hostname", hostname);
setAndStrip("#s_ip", ip);
setAndStrip("#s_kernel", kernel);
setAndStrip("#s_distro", "<img src='./gfx/images/" + icon + "' alt='Icon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' />&nbsp;" + distro); //onload IE6 PNG fix
setAndStrip("#s_os", "<img src='./gfx/images/" + os + ".png' alt='OSIcon' title='' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' />&nbsp;" + os); //onload IE6 PNG fix
setAndStrip("#s_distro", "<img src='./gfx/images/" + icon + "' alt='Icon' title='" + icon + "' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' />&nbsp;" + distro); //onload IE6 PNG fix
setAndStrip("#s_os", "<img src='./gfx/images/" + os + ".png' alt='OSIcon' title='" + os + ".png' style='width:16px;height:16px;vertical-align:middle;' onload='PNGload($(this));' />&nbsp;" + os); //onload IE6 PNG fix
setAndStrip("#s_uptime", uptime);
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
setAndStrip("#s_lastboot", lastboot.toLocaleString());
744,15 → 762,15
setAndStrip("#s_syslang", syslang);
setAndStrip("#s_codepage", codepage);
setAndStrip("#s_processes", processes);
if ((processes > 0) && (prunning || psleeping || pstopped || pzombie || pwaiting || pother)) {
if ((processes > 0) && (psarray[0] || psarray[1] || psarray[2] || psarray[3] || psarray[4] || psarray[5])) {
$("#s_processes").append(" (");
var typelist = {running:111,sleeping:112,stopped:113,zombie:114,waiting:115,other:116};
for (var proc_type in typelist) {
if (eval("p" + proc_type)) {
var idlist = {0:111,1:112,2:113,3:114,4:115,5:116};
for (var proc_type in idlist) {
if (psarray[proc_type]) {
if (not_first) {
$("#s_processes").append(", ");
}
$("#s_processes").append(eval("p" + proc_type) + "&nbsp;" + genlang(typelist[proc_type]));
$("#s_processes").append(psarray[proc_type] + "&nbsp;" + genlang(idlist[proc_type]));
not_first = true;
}
}
824,7 → 842,7
tree.push(cpucoreposition);
}
if (isFinite(voltage)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + " " + genlang(82) + "</td></tr>\n";
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + String.fromCharCode(160) + genlang(62) + "</td></tr>\n";
tree.push(cpucoreposition);
}
if (!isNaN(bogo)) {
904,7 → 922,7
tree.push(devcoreposition);
}
if (isFinite(voltage)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + " " + genlang(82) + "</td></tr>\n";
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + String.fromCharCode(160) + genlang(62) + "</td></tr>\n";
tree.push(devcoreposition);
}
if (serial !== undefined) {
1031,8 → 1049,9
}
 
$("Network NetDevice", xml).each(function getDevice(id) {
var name = "", rx = 0, tx = 0, er = 0, dr = 0, info = "", networkindex = 0, htmlrx = '', htmltx = '', rxr = 0, txr = 0;
var name = "", rx = 0, tx = 0, er = 0, dr = 0, info = "", bridge = "", networkindex = 0, htmlrx = '', htmltx = '', rxr = 0, txr = 0;
name = $(this).attr("Name");
bridge = $(this).attr("Bridge");
rx = parseInt($(this).attr("RxBytes"), 10);
tx = parseInt($(this).attr("TxBytes"), 10);
er = parseInt($(this).attr("Err"), 10);
1074,8 → 1093,11
}
}
 
html +="<tr><td><div class=\"treediv\"><span class=\"treespan\">" + name + "</span></div></td><td class=\"right\">" + formatBytes(rx, xml) + htmlrx + "</td><td class=\"right\">" + formatBytes(tx, xml) + htmltx +"</td><td class=\"right\">" + er.toString() + "/<wbr>" + dr.toString() + "</td></tr>";
 
if ( (bridge !== undefined) && (bridge !== "") ) {
html +="<tr><td><div class=\"treediv\"><span class=\"treespan\">" + name + " (" + bridge +")</span></div></td><td class=\"right\">" + formatBytes(rx, xml) + htmlrx + "</td><td class=\"right\">" + formatBytes(tx, xml) + htmltx +"</td><td class=\"right\">" + er.toString() + "/<wbr>" + dr.toString() + "</td></tr>";
} else {
html +="<tr><td><div class=\"treediv\"><span class=\"treespan\">" + name + "</span></div></td><td class=\"right\">" + formatBytes(rx, xml) + htmlrx + "</td><td class=\"right\">" + formatBytes(tx, xml) + htmltx +"</td><td class=\"right\">" + er.toString() + "/<wbr>" + dr.toString() + "</td></tr>";
}
networkindex = tree.push(0);
 
if (showNetworkActiveSpeed) {
1262,7 → 1284,7
return;
}
 
var total_usage = 0, total_used = 0, total_free = 0, total_size = 0, threshold = 0;
var total_usage = 0, total_used = 0, total_free = 0, total_size = 0, threshold = 0, usage = 0;
 
filesystemTable.fnClearTable();
 
1297,25 → 1319,26
type = "";
}
 
usage = (size != 0) ? Math.ceil((used / size) * 100) : 0;
if (!isNaN(ignore) && (ignore > 0) && showTotals) {
if (ignore >= 3) {
if ((ignore == 3) && !isNaN(threshold) && (percent >= threshold)) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn", usage) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
} else {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "bar", usage) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span><i>(" + formatBytes(used, xml) + ")</i>", "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
}
} else {
if (!isNaN(threshold) && (percent >= threshold)) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn", usage) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
} else {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "bar", usage) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span><i>(" + formatBytes(free, xml) + ")</i>", "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span><i>(" + formatBytes(size, xml) + ")</i>"]);
}
}
} else {
if (!isNaN(threshold) && (percent >= threshold) && (showTotals || isNaN(ignore) || (ignore < 4))) {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn") + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span>" + formatBytes(free, xml), "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span>" + formatBytes(size, xml)]);
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "barwarn", usage) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span>" + formatBytes(free, xml), "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span>" + formatBytes(size, xml)]);
} else {
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span>" + formatBytes(free, xml), "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span>" + formatBytes(size, xml)]);
filesystemTable.fnAddData(["<span style=\"display:none;\">" + mpoint + "</span>" + mpoint, "<span style=\"display:none;\">" + type + "</span>" + type, "<span style=\"display:none;\">" + name + "</span>" + name + options_text, "<span style=\"display:none;\">" + percent.toString() + "</span>" + createBar(percent, "bar", usage) + inodes_text, "<span style=\"display:none;\">" + free.toString() + "</span>" + formatBytes(free, xml), "<span style=\"display:none;\">" + used.toString() + "</span>" + formatBytes(used, xml), "<span style=\"display:none;\">" + size.toString() + "</span>" + formatBytes(size, xml)]);
}
}
if (showTotals) {
1331,15 → 1354,16
total_free += free;
total_size += size;
}
total_usage = (total_size != 0) ? round(100 - (total_free / total_size) * 100, 2) : 0;
}
});
 
if (showTotals) {
usage = (total_size != 0) ? Math.ceil((total_used / total_size) * 100) : 0;
total_usage = (total_size != 0) ? round(100 - (total_free / total_size) * 100, 2) : 0;
if (!isNaN(threshold) && (total_usage >= threshold)) {
$("#s_fs_total").html(createBar(total_usage, "barwarn"));
$("#s_fs_total").html(createBar(total_usage, "barwarn" , usage));
} else {
$("#s_fs_total").html(createBar(total_usage));
$("#s_fs_total").html(createBar(total_usage, "bar", usage));
}
$("#s_fs_tfree").html(formatBytes(total_free, xml));
$("#s_fs_tused").html(formatBytes(total_used, xml));
1451,7 → 1475,7
if (isFinite(value))
$("#fansTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td><td class=\"right\">" + _min + "</td></tr>");
else
$("#fansTable tbody").append("<tr><td>" + label + "</td><td>---%</td><td class=\"right\">" + _min + "</td></tr>");
$("#fansTable tbody").append("<tr><td>" + label + "</td><td>---%</td><td class=\"right\">" + _min + "</td></tr>");
} else {
if (isFinite(min))
_min = round(min,0) + "&nbsp;" + genlang(63);
1569,7 → 1593,10
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
unit = $(this).attr("Unit");
if (unit === "%") {
$("#otherTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td></tr>");
if (isFinite(value))
$("#otherTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td></tr>");
else
$("#otherTable tbody").append("<tr><td>" + label + "</td><td>---%</td></tr>");
} else {
$("#otherTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + value + "</td></tr>");
}
1871,7 → 1898,7
$("#template").val(cookie_template);
if ($("#template").val() === null) {
$("#template").val(old_template);
}
}
}
switchStyle($("#template").val().toString());
$('#template').show();
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js
2,6 → 2,13
showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, oldnetwork = [], refrTimer;
 
/**
* Fix potential XSS vulnerability in jQuery
*/
jQuery.htmlPrefilter = function( html ) {
return html;
};
 
/**
* generate a cookie, if not exist, and add an entry to it<br><br>
* inspired by <a href="http://www.quirksmode.org/js/cookies.html">http://www.quirksmode.org/js/cookies.html</a>
* @param {String} name name that holds the value
231,6 → 238,7
}
},
success: function (data) {
var refrtime;
// console.log(data);
// data_dbg = data;
if ((typeof(initiate) === 'boolean') && (data.Options !== undefined) && (data.Options["@attributes"] !== undefined) && ((refrtime = data.Options["@attributes"].refresh) !== undefined) && (refrtime !== "0")) {
292,8 → 300,8
success: function (data) {
try {
for (var propertyName in data.Plugins) {
if ((data.Plugins[propertyName]["@attributes"] !== undefined) &&
((hostname = data.Plugins[propertyName]["@attributes"]["Hostname"]) !== undefined)) {
if ((data.Plugins[propertyName]["@attributes"] !== undefined) &&
((hostname = data.Plugins[propertyName]["@attributes"].Hostname) !== undefined)) {
$('span[class=hostname_' + pluginname + ']').html(hostname);
}
break;
323,13 → 331,19
});
}
 
if ((ua=useragent.match(/Version\/(\d+)\.[\d\.]+ (Mobile\/\S+ )?Safari\//)) !== null) {
if ((ua=useragent.match(/Midori\/(\d+)\.?(\d+)?/)) !== null) {
if ((ua[1]==0) && (ua.length==3) && (ua[2]<=4)) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori04.css');
} else if ((ua[1]==0) && (ua.length==3) && (ua[2]==5)) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori05.css');
}
} else if ((ua=useragent.match(/\(KHTML, like Gecko\) Version\/(\d+)\.[\d\.]+ (Mobile\/\S+ )?Safari\//)) !== null) {
if (ua[1]<=5) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari5.css');
} else if (ua[1]<=8) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari8.css');
}
} else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+/)) !== null) {
} else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+/)) !== null) {
if (ua[1]<=15) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox15.css');
} else if (ua[1]<=20) {
339,18 → 353,16
} else if (ua[1]==28) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox28.css');
}
} else if ((ua=useragent.match(/Midori\/(\d+)\.?(\d+)?/)) !== null) {
if ((ua[1]==0) && (ua.length==3) && (ua[2]<=4)) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori04.css');
} else if ((ua[1]==0) && (ua.length==3) && (ua[2]==5)) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-midori05.css');
}
} else if ((ua=useragent.match(/Chrome\/(\d+)\.[\d\.]+/)) !== null) {
} else if ((ua=useragent.match(/Chrome\/(\d+)\.[\d\.]+/)) !== null) {
if (ua[1]<=25) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome25.css');
} else if (ua[1]<=28) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-chrome28.css');
}
} else if ((ua=useragent.match(/^Opera\/.*Version\/(\d+)\.[\d\.]+$/)) !== null) {
if (ua[1]<=11) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-opera11.css');
}
}
 
$(window).resize();
599,12 → 611,12
},
Distro: {
html: function () {
return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.Distroicon + '" alt="" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.Distro + '</td></tr></table>';
return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.Distroicon + '" alt="" title="' + this.Distroicon + '" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.Distro + '</td></tr></table>';
}
},
OS: {
html: function () {
return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.OS + '.png" alt="" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.OS + '</td></tr></table>';
return '<table class="borderless table-hover table-nopadding" style="width:100%;"><tr><td style="padding-right:4px!important;width:32px;"><img src="gfx/images/' + this.OS + '.png" alt="" title="' + this.OS + '.png" style="width:32px;height:32px;" /></td><td style="vertical-align:middle;">' + this.OS + '</td></tr></table>';
}
},
LoadAvg: {
620,36 → 632,37
},
Processes: {
html: function () {
var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0;
var processes = 0, psarray = [0,0,0,0,0,0];
var not_first = false;
processes = parseInt(this.Processes, 10);
if (processes > 0) {
if (this.ProcessesRunning !== undefined) {
p111 = parseInt(this.ProcessesRunning, 10);
psarray[0] = parseInt(this.ProcessesRunning, 10);
}
if (this.ProcessesSleeping !== undefined) {
p112 = parseInt(this.ProcessesSleeping, 10);
psarray[1] = parseInt(this.ProcessesSleeping, 10);
}
if (this.ProcessesStopped !== undefined) {
p113 = parseInt(this.ProcessesStopped, 10);
psarray[2] = parseInt(this.ProcessesStopped, 10);
}
if (this.ProcessesZombie !== undefined) {
p114 = parseInt(this.ProcessesZombie, 10);
psarray[3] = parseInt(this.ProcessesZombie, 10);
}
if (this.ProcessesWaiting !== undefined) {
p115 = parseInt(this.ProcessesWaiting, 10);
psarray[4] = parseInt(this.ProcessesWaiting, 10);
}
if (this.ProcessesOther !== undefined) {
p116 = parseInt(this.ProcessesOther, 10);
psarray[5] = parseInt(this.ProcessesOther, 10);
}
if (p111 || p112 || p113 || p114 || p115 || p116) {
if (psarray[0] || psarray[1] || psarray[2] || psarray[3] || psarray[4] || psarray[5]) {
processes += " (";
for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) {
if (eval("p" + proc_type)) {
var idlist = {0:111,1:112,2:113,3:114,4:115,5:116};
for (var proc_type in idlist) {
if (psarray[proc_type]) {
if (not_first) {
processes += ", ";
}
processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type);
processes += psarray[proc_type] + String.fromCharCode(160) + genlang(idlist[proc_type]);
not_first = true;
}
}
728,7 → 741,7
},
Voltage: {
html: function() {
return round(this.Voltage, 2) + genlang(82); //V
return round(this.Voltage, 2) + String.fromCharCode(160) + genlang(62); //V
}
},
Bogomips: {
770,7 → 783,7
},
Voltage: {
html: function() {
return round(this.Voltage, 2) + genlang(82); //V
return round(this.Voltage, 2) + String.fromCharCode(160) + genlang(62); //V
}
},
Capacity: {
795,7 → 808,7
 
var html="";
 
if (data.Hardware["@attributes"] !== undefined) {
if (data.Hardware["@attributes"] !== undefined) {
if (data.Hardware["@attributes"].Name !== undefined) {
html+="<tr id=\"hardware-Machine\">";
html+="<th style=\"width:8%;\">"+genlang(107)+"</th>"; //Machine
862,7 → 875,7
html+="<td><span class=\"treegrid-span\">" + genlang('128') + ":</span></td>"; //Number of memories
} else {
html+="<td><span class=\"treegrid-span\">" + genlang('120') + ":</span></td>"; //Number of devices
}
}
html+="<td class=\"rightCell\"><span id=\"" + hw_type + "Count\"></span></td>";
html+="</tr>";
}
1130,8 → 1143,8
},
Percent: {
html: function () {
var used1 = (this.Total != 0) ? Math.ceil((this.Used / this.Total) * 100) : 0;
var used2 = Math.ceil(this.Percent);
var used1 = Math.max(Math.min((this.Total != 0) ? Math.ceil((this.Used / this.Total) * 100) : 0, 100), 0);
var used2 = Math.max(Math.min(Math.ceil(this.Percent), 100), 0);
var used21= used2 - used1;
if (used21 > 0) {
return '<div class="progress">' + '<div class="' +
1138,8 → 1151,8
( ( ((this.Ignore == undefined) || (this.Ignore < 4)) && ((data.Options["@attributes"].threshold !== undefined) &&
(parseInt(this.Percent, 10) >= parseInt(data.Options["@attributes"].threshold, 10))) ) ? 'progress-bar progress-bar-danger' : 'progress-bar progress-bar-info' ) +
'" style="width:' + used1 + '% ;"></div>' +
'<div class="progress-bar progress-bar-warning" style="width:' + used21 + '% ;"></div>'
+'</div><div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>';
'<div class="progress-bar progress-bar-warning" style="width:' + used21 + '% ;"></div>' +
'</div><div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>';
} else {
return '<div class="progress">' + '<div class="' +
( ( ((this.Ignore == undefined) || (this.Ignore < 4)) && ((data.Options["@attributes"].threshold !== undefined) &&
1161,7 → 1174,7
if (showtotals) {
if ((datas[i]["@attributes"].Ignore !== undefined) && (datas[i]["@attributes"].Ignore > 0)) {
if (datas[i]["@attributes"].Ignore == 2) {
total.Used += parseInt(datas[i]["@attributes"].Used, 10);
total.Used += parseInt(datas[i]["@attributes"].Used, 10);
} else if (datas[i]["@attributes"].Ignore == 1) {
total.Total += parseInt(datas[i]["@attributes"].Used, 10);
total.Used += parseInt(datas[i]["@attributes"].Used, 10);
1200,6 → 1213,15
}
 
var directives = {
Name: {
text: function () {
if (this.Bridge !== undefined) {
return this.Name + " (" + this.Bridge + ")";
} else {
return this.Name;
}
}
},
RxBytes: {
html: function () {
var htmladd = '';
1209,7 → 1231,7
htmladd ="<br><i>("+formatBPS(round(this.RxRate, 2))+")</i>";
} else {
htmladd ="<br><i>("+formatBytes(round(this.RxRate, 2), data.Options["@attributes"].byteFormat)+"/s)</i>";
}
}
} else if ($.inArray(this.Name, oldnetwork) >= 0) {
var diff, difftime;
if (((diff = this.RxBytes - oldnetwork[this.Name].RxBytes) > 0) && ((difftime = data.Generation["@attributes"].timestamp - oldnetwork[this.Name].timestamp) > 0)) {
1317,7 → 1339,7
var directives = {
Value: {
text: function () {
return round(this.Value,2) + String.fromCharCode(160) + "V";
return (isFinite(this.Value)?round(this.Value,2):"---") + String.fromCharCode(160) + "V";
}
},
Min: {
1409,11 → 1431,14
Value: {
html: function () {
if (this.Unit === "%") {
return '<div class="progress">' +
'<div class="progress-bar progress-bar-info" style="width:' + round(this.Value,0) + '%;"></div>' +
'</div><div class="percent">' + round(this.Value,0) + '%</div>';
if (isFinite(this.Value))
return '<div class="progress">' +
'<div class="progress-bar progress-bar-info" style="width:' + round(this.Value,0) + '%;"></div>' +
'</div><div class="percent">' + round(this.Value,0) + '%</div>';
else
return '---%';
} else {
return round(this.Value,0) + String.fromCharCode(160) + genlang(63); //RPM
return (isFinite(this.Value)?round(this.Value,0):"---") + String.fromCharCode(160) + genlang(63); //RPM
}
}
},
1462,7 → 1487,7
var directives = {
Value: {
text: function () {
return round(this.Value,2) + String.fromCharCode(160) + "W";
return (isFinite(this.Value)?round(this.Value,2):"---") + String.fromCharCode(160) + "W";
}
},
Max: {
1505,7 → 1530,7
var directives = {
Value: {
text: function () {
return round(this.Value,2) + String.fromCharCode(160) + "A";
return (isFinite(this.Value)?round(this.Value,2):"---") + String.fromCharCode(160) + "A";
}
},
Min: {
1555,10 → 1580,12
Value: {
html: function () {
if (this.Unit === "%") {
return '<div class="progress">' +
'<div class="progress-bar progress-bar-info" style="width:' + round(this.Value,0) + '%;"></div>' +
'</div><div class="percent">' + round(this.Value,0) + '%</div>';
// return round(this.Value,0) + "%";
if (isFinite(this.Value))
return '<div class="progress">' +
'<div class="progress-bar progress-bar-info" style="width:' + round(this.Value,0) + '%;"></div>' +
'</div><div class="percent">' + round(this.Value,0) + '%</div>';
else
return '---%';
} else {
return this.Value;
}