Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 3036 → Rev 3037

/web/acc/phpsysinfo/js/jQuery/jquery.js
1,5 → 1,5
/*!
* jQuery JavaScript Library v1.12.4-ff3fix-ff2fix
* jQuery JavaScript Library v1.12.4-ff3fix-ff2fix-CVE_2015_9251fix-CVE_2019_11358fix
* http://jquery.com/
*
* Includes Sizzle.js
209,8 → 209,9
src = target[ name ];
copy = options[ name ];
 
// Prevent Object.prototype pollution
// Prevent never-ending loop
if ( target === copy ) {
if ( name === "__proto__" || target === copy ) {
continue;
}
 
10445,9 → 10446,13
}
} );
 
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
} );
 
 
 
var oldCallbacks = [],
rjsonp = /(=)\?(?=&|$)|\?\?/;
 
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo.js
176,9 → 176,10
* generate a span tag
* @param {Number} id translation id in the xml file
* @param {String} [plugin] name of the plugin for which the tag should be generated
* @param {String} [defaultvalue] default value
* @return {String} string which contains generated span tag for translation string
*/
function genlang(id, plugin) {
function genlang(id, plugin, defaultvalue) {
var html = "", idString = "", plugname = "",
langarrId = current_language + "_";
 
206,7 → 207,9
 
if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) {
html += langarr[langarrId][idString];
}
} else if (defaultvalue !== undefined) {
html += defaultvalue;
}
 
html += "</span>";
 
630,7 → 633,23
* @param {jQuery} xml phpSysInfo-XML
*/
function refreshVitals(xml) {
var hostname = "", ip = "";
var hostname = "", ip = "", stripid = 0;
 
function setAndStrip(id, value) {
if (value !== "") {
$(id).html(value);
if (stripid%2 === 1) {
$(id).closest('tr').addClass('even');
} else {
$(id).closest('tr').removeClass('even');
}
$(id).closest('tr').css("display", "");
stripid++;
} else {
$(id).closest('tr').css("display", "none");
}
}
 
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) {
$("#vitals").remove();
$("Vitals", xml).each(function getVitals(id) {
672,27 → 691,15
}
if ($(this).attr("SysLang") !== undefined) {
syslang = $(this).attr("SysLang");
document.getElementById("s_syslang_tr").style.display='';
}
 
if ($(this).attr("CodePage") !== undefined) {
codepage = $(this).attr("CodePage");
if ($(this).attr("SysLang") !== undefined) {
document.getElementById("s_codepage_tr1").style.display='';
} else {
document.getElementById("s_codepage_tr2").style.display='';
}
}
 
//processes
if ($(this).attr("Processes") !== undefined) {
processes = parseInt($(this).attr("Processes"), 10);
if ((($(this).attr("CodePage") !== undefined) && ($(this).attr("SysLang") === undefined)) ||
(($(this).attr("CodePage") === undefined) && ($(this).attr("SysLang") !== undefined))) {
document.getElementById("s_processes_tr1").style.display='';
} else {
document.getElementById("s_processes_tr2").style.display='';
}
}
if ($(this).attr("ProcessesRunning") !== undefined) {
prunning = parseInt($(this).attr("ProcessesRunning"), 10);
715,47 → 722,41
 
document.title = "System information: " + hostname + " (" + ip + ")";
$("#s_hostname_title").html(hostname);
$("#s_ip_title").html(ip);
$("#s_hostname").html(hostname);
$("#s_ip").html(ip);
$("#s_kernel").html(kernel);
$("#s_distro").html("<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
$("#s_os").html("<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
$("#s_uptime").html(uptime);
$("#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_uptime", uptime);
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
$("#s_lastboot").html(lastboot.toLocaleString());
setAndStrip("#s_lastboot", lastboot.toLocaleString());
} else {
if (typeof(lastboot.toUTCString)==="function") {
$("#s_lastboot").html(lastboot.toUTCString());
setAndStrip("#s_lastboot", lastboot.toUTCString());
} else {
//deprecated
$("#s_lastboot").html(lastboot.toGMTString());
setAndStrip("#s_lastboot", lastboot.toGMTString());
}
}
$("#s_users").html(users);
$("#s_loadavg").html(loadavg);
$("#s_syslang").html(syslang);
$("#s_codepage_1").html(codepage);
$("#s_codepage_2").html(codepage);
$("#s_processes_1").html(processes);
$("#s_processes_2").html(processes);
if (prunning || psleeping || pstopped || pzombie || pwaiting || pother) {
$("#s_processes_1").append(" (");
$("#s_processes_2").append(" (");
setAndStrip("#s_users", users);
setAndStrip("#s_loadavg", loadavg);
setAndStrip("#s_syslang", syslang);
setAndStrip("#s_codepage", codepage);
setAndStrip("#s_processes", processes);
if ((processes > 0) && (prunning || psleeping || pstopped || pzombie || pwaiting || pother)) {
$("#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)) {
if (not_first) {
$("#s_processes_1").append(", ");
$("#s_processes_2").append(", ");
$("#s_processes").append(", ");
}
$("#s_processes_1").append(eval("p" + proc_type) + "&nbsp;" + genlang(typelist[proc_type]));
$("#s_processes_2").append(eval("p" + proc_type) + "&nbsp;" + genlang(typelist[proc_type]));
$("#s_processes").append(eval("p" + proc_type) + "&nbsp;" + genlang(typelist[proc_type]));
not_first = true;
}
}
$("#s_processes_1").append(") ");
$("#s_processes_2").append(") ");
$("#s_processes").append(") ");
}
});
}
771,9 → 772,10
function fillCpu(xml, tree, rootposition, collapsed) {
var cpucount = 0, html = "";
$("Hardware CPU CpuCore", xml).each(function getCpuCore(cpuCoreId) {
var model = "", speed = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = "";
var model = "", speed = 0, voltage = 0, bus = 0, cache = 0, bogo = 0, temp = 0, load = 0, speedmax = 0, speedmin = 0, cpucoreposition = 0, virt = "", manufacturer = "";
cpucount++;
model = $(this).attr("Model");
voltage = $(this).attr("Voltage");
speed = parseInt($(this).attr("CpuSpeed"), 10);
speedmax = parseInt($(this).attr("CpuSpeedMax"), 10);
speedmin = parseInt($(this).attr("CpuSpeedMin"), 10);
821,6 → 823,10
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(14) + ":</span></div></td><td>" + formatHertz(bus) + "</td></tr>\n";
tree.push(cpucoreposition);
}
if (!isNaN(voltage)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(52) + ":</span></div></td><td>" + round(voltage, 2) + " V</td></tr>\n";
tree.push(cpucoreposition);
}
if (!isNaN(bogo)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(16) + ":</span></div></td><td>" + bogo.toString() + "</td></tr>\n";
tree.push(cpucoreposition);
931,7 → 937,7
return;
}
 
var html = "", tree = [], closed = [], index = 0, machine = "";
var html = "", tree = [], closed = [], index = 0, machine = "", virtualizer = "";
$("#hardware").empty();
html += "<h2>" + genlang(10) + "</h2>\n";
html += " <div style=\"overflow-x:auto;\">\n";
941,6 → 947,10
$("Hardware", xml).each(function getMachine(id) {
machine = $(this).attr("Name");
});
$("Hardware", xml).each(function getVirtualizer(id) {
virtualizer = $(this).attr("Virtualizer");
});
 
if ((machine !== undefined) && (machine !== "")) {
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(107) + "</span></div></td></tr>\n";
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespan\">" + machine + "</span></div></td></tr>\n";
947,6 → 957,11
tree.push(tree.push(0));
}
 
if ((virtualizer !== undefined) && (virtualizer !== "")) {
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(134) + "</span></div></td></tr>\n";
html += "<tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespan\">" + virtualizer + "</span></div></td></tr>\n";
tree.push(tree.push(0));
}
if (countCpu(xml)) {
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(11) + "</span></div></td></tr>\n";
html += fillCpu(xml, tree, tree.push(0), closed);
1260,6 → 1275,9
if (!isNaN(inodes)) {
inodes_text = "<span style=\"font-style:italic\">&nbsp;(" + inodes.toString() + "%)</span>";
}
if (type === undefined) {
type = "";
}
 
if (!isNaN(ignore) && (ignore > 0) && showTotals) {
if (ignore >= 3) {
1552,12 → 1570,13
 
$("#ups").empty();
$("UPSInfo UPS", xml).each(function getUps(id) {
var name = "", model = "", mode = "", start_time = "", upsstatus = "", temperature = "", outages_count = "", last_outage = "", last_outage_finish = "", line_voltage = "", line_frequency = "", load_percent = "", battery_date = "", battery_voltage = "", battery_charge_percent = "", time_left_minutes = "";
var name = "", model = "", mode = "", start_time = "", upsstatus = "", beeperstatus = "", temperature = "", outages_count = "", last_outage = "", last_outage_finish = "", line_voltage = "", line_frequency = "", load_percent = "", battery_date = "", battery_voltage = "", battery_charge_percent = "", time_left_minutes = "";
name = $(this).attr("Name");
model = $(this).attr("Model");
mode = $(this).attr("Mode");
start_time = $(this).attr("StartTime");
upsstatus = $(this).attr("Status");
beeperstatus = $(this).attr("BeeperStatus");
 
temperature = $(this).attr("Temperature");
outages_count = $(this).attr("OutagesCount");
1589,6 → 1608,10
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(73) + "</span></div></td><td>" + upsstatus + "</td></tr>\n";
tree.push(index);
}
if (beeperstatus !== undefined) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(133) + "</span></div></td><td>" + beeperstatus + "</td></tr>\n";
tree.push(index);
}
if (temperature !== undefined) {
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(84) + "</span></div></td><td>" + temperature + "</td></tr>\n";
tree.push(index);
1901,7 → 1924,7
ip_string = ipv4[1];
ipv4 = ipv4[2].match(/[0-9]+/g);
for (var i = 0;i < 4;i ++) {
var byte = parseInt(ipv4[i],10);
var byte = parseInt(ipv4[i], 10);
if (byte<256) {
ipv4[i] = ("0" + byte.toString(16)).substr(-2);
} else {
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js
106,9 → 106,10
* generate a span tag
* @param {Number} id translation id in the xml file
* @param {String} [plugin] name of the plugin for which the tag should be generated
* @param {String} [defaultvalue] default value
* @return {String} string which contains generated span tag for translation string
*/
function genlang(id, plugin) {
function genlang(id, plugin, defaultvalue) {
var html = "", idString = "", plugname = "",
langarrId = current_language + "_";
 
137,6 → 138,8
 
if ((langxml[langarrId] !== undefined) && (langarr[langarrId] !== undefined)) {
html += langarr[langarrId][idString];
} else if (defaultvalue !== undefined) {
html += defaultvalue;
}
 
html += "</span>";
620,36 → 623,38
var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0;
var not_first = false;
processes = parseInt(this.Processes, 10);
if (this.ProcessesRunning !== undefined) {
p111 = parseInt(this.ProcessesRunning, 10);
}
if (this.ProcessesSleeping !== undefined) {
p112 = parseInt(this.ProcessesSleeping, 10);
}
if (this.ProcessesStopped !== undefined) {
p113 = parseInt(this.ProcessesStopped, 10);
}
if (this.ProcessesZombie !== undefined) {
p114 = parseInt(this.ProcessesZombie, 10);
}
if (this.ProcessesWaiting !== undefined) {
p115 = parseInt(this.ProcessesWaiting, 10);
}
if (this.ProcessesOther !== undefined) {
p116 = parseInt(this.ProcessesOther, 10);
}
if (p111 || p112 || p113 || p114 || p115 || p116) {
processes += " (";
for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) {
if (eval("p" + proc_type)) {
if (not_first) {
processes += ", ";
if (processes > 0) {
if (this.ProcessesRunning !== undefined) {
p111 = parseInt(this.ProcessesRunning, 10);
}
if (this.ProcessesSleeping !== undefined) {
p112 = parseInt(this.ProcessesSleeping, 10);
}
if (this.ProcessesStopped !== undefined) {
p113 = parseInt(this.ProcessesStopped, 10);
}
if (this.ProcessesZombie !== undefined) {
p114 = parseInt(this.ProcessesZombie, 10);
}
if (this.ProcessesWaiting !== undefined) {
p115 = parseInt(this.ProcessesWaiting, 10);
}
if (this.ProcessesOther !== undefined) {
p116 = parseInt(this.ProcessesOther, 10);
}
if (p111 || p112 || p113 || p114 || p115 || p116) {
processes += " (";
for (var proc_type in {111:0,112:1,113:2,114:3,115:4,116:5}) {
if (eval("p" + proc_type)) {
if (not_first) {
processes += ", ";
}
processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type);
not_first = true;
}
processes += eval("p" + proc_type) + String.fromCharCode(160) + genlang(proc_type);
not_first = true;
}
processes += ")";
}
processes += ")";
}
return processes;
}
718,6 → 723,11
return formatTemp(this.Cputemp, data.Options["@attributes"].tempFormat);
}
},
Voltage: {
html: function() {
return round(this.Voltage, 2) + ' V';
}
},
Bogomips: {
text: function () {
return parseInt(this.Bogomips, 10);
782,14 → 792,22
 
var html="";
 
if ((data.Hardware["@attributes"] !== undefined) && (data.Hardware["@attributes"].Name !== undefined)) {
html+="<tr id=\"hardware-Machine\">";
html+="<th style=\"width:8%;\">"+genlang(107)+"</th>"; //Machine
html+="<td colspan=\"2\"><span data-bind=\"Name\"></span></td>";
html+="</tr>";
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
html+="<td colspan=\"2\"><span data-bind=\"Name\"></span></td>";
html+="</tr>";
}
if (data.Hardware["@attributes"].Virtualizer !== undefined) {
html+="<tr id=\"hardware-Virtualizer\">";
html+="<th style=\"width:8%;\">"+genlang(134)+"</th>"; //Virtualizer
html+="<td colspan=\"2\"><span data-bind=\"Virtualizer\"></span></td>";
html+="</tr>";
}
}
 
var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9};
var paramlist = {CpuSpeed:13,CpuSpeedMax:100,CpuSpeedMin:101,Cache:15,Virt:94,BusSpeed:14,Voltage:52,Bogomips:16,Cputemp:51,Manufacturer:122,Load:9};
try {
datas = items(data.Hardware.CPU.CpuCore);
for (i = 0; i < datas.length; i++) {
868,8 → 886,13
$("#hardware-data").empty().append(html);
 
 
if ((data.Hardware["@attributes"] !== undefined) && (data.Hardware["@attributes"].Name !== undefined)) {
$('#hardware-Machine').render(data.Hardware["@attributes"]);
if (data.Hardware["@attributes"] !== undefined) {
if (data.Hardware["@attributes"].Name !== undefined) {
$('#hardware-Machine').render(data.Hardware["@attributes"]);
}
if (data.Hardware["@attributes"].Virtualizer !== undefined) {
$('#hardware-Virtualizer').render(data.Hardware["@attributes"]);
}
}
 
try {
1598,7 → 1621,7
 
if ((data.UPSInfo !== undefined) && (items(data.UPSInfo.UPS).length > 0)) {
var html="";
var paramlist = {Model:70,StartTime:72,Status:73,Temperature:84,OutagesCount:74,LastOutage:75,LastOutageFinish:76,LineVoltage:77,LineFrequency:108,LoadPercent:78,BatteryDate:104,BatteryVoltage:79,BatteryChargePercent:80,TimeLeftMinutes:81};
var paramlist = {Model:70,StartTime:72,Status:73,BeeperStatus:133,Temperature:84,OutagesCount:74,LastOutage:75,LastOutageFinish:76,LineVoltage:77,LineFrequency:108,LoadPercent:78,BatteryDate:104,BatteryVoltage:79,BatteryChargePercent:80,TimeLeftMinutes:81};
 
try {
datas = items(data.UPSInfo.UPS);