Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 2808 → Rev 2976

/web/acc/phpsysinfo/js/jQuery/README
13,7 → 13,7
 
jquery.dataTables.js
--------------------
VERSION : 1.8.2+jquery1.9fix+parseJSONfix2+bindfix
VERSION : 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix
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.
/web/acc/phpsysinfo/js/jQuery/jquery.dataTables.js
1,6 → 1,6
/*
* File: jquery.dataTables.js
* Version: 1.8.2+jquery1.9fix+parseJSONfix2+bindfix
* Version: 1.8.2+jquery1.9fix+parseJSONfix2+bindfix+samesitefix
* Description: Paginate, search and sort HTML tables
* Author: Allan Jardine (www.sprymedia.co.uk)
* Created: 28/3/2008
6363,7 → 6363,7
else
{
sFullCookie = sNameFile + "=" + encodeURIComponent(sValue) +
"; expires=" + date.toGMTString() +"; path=" + aParts.join('/')+"/";
"; expires=" + date.toGMTString() +"; path=" + aParts.join('/')+"/; samesite=strict";
}
/* Are we going to go over the cookie limit of 4KiB? If so, try to delete a cookies
6396,7 → 6396,7
if ( sOldName !== "" )
{
document.cookie = sOldName+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+
aParts.join('/') + "/";
aParts.join('/') + "/; samesite=strict";
}
}
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo.js
26,7 → 26,7
"use strict";
 
var langxml = [], filesystemTable, current_language = "", plugin_liste = [], blocks = [], langarr = [],
showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showMemoryInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, oldnetwork = [];
showCPUListExpanded, showCPUInfoExpanded, showNetworkInfosExpanded, showMemoryInfosExpanded, showNetworkActiveSpeed, showCPULoadCompact, showTotals, increaseWidth, oldnetwork = [];
 
/**
* Fix PNG loading on IE6 or below
57,7 → 57,7
} else {
expires = "";
}
document.cookie = name + "=" + value + expires + "; path=/";
document.cookie = name + "=" + value + expires + "; path=/; samesite=strict";
}
 
/**
112,11 → 112,19
* @param {String} template template that should be activated
*/
function switchStyle(template) {
$('link[rel*=style][title]').each(function getTitle(i) {
if (this.getAttribute('title') === 'PSI_Template') {
this.setAttribute('href', './templates/' + template + ".css");
}
});
if (increaseWidth > 0) {
$('link[rel*=style][title]').each(function getTitle(i) {
if (this.getAttribute('title') === 'PSI_Template') {
this.setAttribute('href', './templates/css.php?name=' + template + '&increase=' + increaseWidth);
}
});
} else {
$('link[rel*=style][title]').each(function getTitle(i) {
if (this.getAttribute('title') === 'PSI_Template') {
this.setAttribute('href', './templates/' + template + ".css");
}
});
}
}
 
/**
281,17 → 289,19
html += " <th class=\"right\">" + genlang(37) + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tfoot>\n";
html += " <tr style=\"font-weight : bold\">\n";
html += " <td>&nbsp;</td>\n";
html += " <td>&nbsp;</td>\n";
html += " <td>" + genlang(38) + "</td>\n";
html += " <td id=\"s_fs_total\"></td>\n";
html += " <td class=\"right\"><span id=\"s_fs_tfree\"></span></td>\n";
html += " <td class=\"right\"><span id=\"s_fs_tused\"></span></td>\n";
html += " <td class=\"right\"><span id=\"s_fs_tsize\"></span></td>\n";
html += " </tr>\n";
html += " </tfoot>\n";
if (showTotals) {
html += " <tfoot>\n";
html += " <tr style=\"font-weight : bold\">\n";
html += " <td>&nbsp;</td>\n";
html += " <td>&nbsp;</td>\n";
html += " <td>" + genlang(38) + "</td>\n";
html += " <td id=\"s_fs_total\"></td>\n";
html += " <td class=\"right\"><span id=\"s_fs_tfree\"></span></td>\n";
html += " <td class=\"right\"><span id=\"s_fs_tused\"></span></td>\n";
html += " <td class=\"right\"><span id=\"s_fs_tsize\"></span></td>\n";
html += " </tr>\n";
html += " </tfoot>\n";
}
html += " <tbody>\n";
html += " </tbody>\n";
html += " </table>\n";
403,6 → 413,23
}
 
/**
* format a given MT/s value to a better readable statement with the right suffix
* @param {Number} mtps mtps value that should be formatted
* @return {String} html string with no breaking spaces and translation statements
*/
function formatMTps(mtps) {
if ((mtps >= 0) && (mtps < 1000)) {
return mtps.toString() + "&nbsp;" + genlang(131);
} else {
if (mtps >= 1000) {
return round(mtps / 1000, 2) + "&nbsp;" + genlang(132);
} else {
return "";
}
}
}
 
/**
* format the byte values into a user friendly value with the corespondenting unit expression<br>support is included
* for binary and decimal output<br>user can specify a constant format for all byte outputs or the output is formated
* automatically so that every value can be read in a user friendly way
686,7 → 713,7
pother = parseInt($(this).attr("ProcessesOther"), 10);
}
 
document.title = "Système information: " + hostname + " (" + ip + ")";
document.title = "System information: " + hostname + " (" + ip + ")";
$("#s_hostname_title").html(hostname);
$("#s_ip_title").html(ip);
$("#s_hostname").html(hostname);
837,8 → 864,8
*/
function fillHWDevice(xml, type, tree, rootposition) {
var devicecount = 0, html = "";
$("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) {
var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", devcoreposition = 0;
$("Hardware " + type + ((type=="MEM")?" Chip":" Device"), xml).each(function getHWDevice(deviceId) {
var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", speed = 0, voltage = 0, devcoreposition = 0;
 
devicecount++;
name = $(this).attr("Name");
845,6 → 872,8
capacity = parseInt($(this).attr("Capacity"), 10);
manufacturer = $(this).attr("Manufacturer");
product = $(this).attr("Product");
speed = parseInt($(this).attr("Speed"), 10);
voltage = parseFloat($(this).attr("Voltage"));
serial = $(this).attr("Serial");
count = parseInt($(this).attr("Count"), 10);
if (!isNaN(count) && count > 1) {
864,6 → 893,14
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(123) + ":</span></div></td><td>" + product + "</td></tr>\n";
tree.push(devcoreposition);
}
if (!isNaN(speed)) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(129) + ":</span></div></td><td>" + ((type=="MEM")?formatMTps(speed):formatBPS(1000000*speed)) + "</td></tr>\n";
tree.push(devcoreposition);
}
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(devcoreposition);
}
if (serial !== undefined) {
html += "<tr><td style=\"width:68%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(124) + ":</span></div></td><td>" + serial + "</td></tr>\n";
tree.push(devcoreposition);
878,7 → 915,7
 
function countHWDevice(xml, type) {
var devicecount = 0;
$("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) {
$("Hardware " + type + ((type=="MEM")?" Chip":" Device"), xml).each(function getHWDevice(deviceId) {
devicecount++;
});
return devicecount;
915,7 → 952,7
html += fillCpu(xml, tree, tree.push(0), closed);
}
 
var typelist = {PCI:17,IDE:18,SCSI:19,NVMe:126,USB:20,TB:117,I2C:118};
var typelist = {MEM:130,PCI:17,IDE:18,SCSI:19,NVMe:126,USB:20,TB:117,I2C:118};
for (var dev_type in typelist) {
if (countHWDevice(xml, dev_type)) {
html += " <tr><td colspan=\"2\"><div class=\"treediv\"><span class=\"treespanbold\">" + genlang(typelist[dev_type]) + "</span></div></td></tr>\n";
966,9 → 1003,9
html1 += " <thead>\n";
html1 += " <tr>\n";
html1 += " <th>" + genlang(22) + "</th>\n";
html1 += " <th class=\"right\" style=\"width:50px;\">" + genlang(23) + "</th>\n";
html1 += " <th class=\"right\" style=\"width:50px;\">" + genlang(24) + "</th>\n";
html1 += " <th class=\"right\" style=\"width:50px;\">" + genlang(25) + "</th>\n";
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(23) + "</th>\n";
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(24) + "</th>\n";
html1 += " <th class=\"right\" style=\"width:17.7%;\">" + genlang(25) + "</th>\n";
html1 += " </tr>\n";
html1 += " </thead>\n";
 
1082,11 → 1119,11
html += " <table id=\"MemoryTree\" class=\"tablemain\">\n";
html += " <thead>\n";
html += " <tr>\n";
html += " <th style=\"width:200px;\">" + genlang(34) + "</th>\n";
html += " <th style=\"width:285px;\">" + genlang(33) + "</th>\n";
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(125) + "</th>\n";
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(36) + "</th>\n";
html += " <th class=\"right\" style=\"width:100px;\">" + genlang(37) + "</th>\n";
html += " <th>" + genlang(34) + "</th>\n";
html += " <th style=\"width:33.3%;\">" + genlang(33) + "</th>\n";
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(125) + "</th>\n";
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(36) + "</th>\n";
html += " <th class=\"right\" style=\"width:14.2%;\">" + genlang(37) + "</th>\n";
html += " </tr>\n";
html += " </thead>\n";
html += " <tbody class=\"tree\">\n";
1097,7 → 1134,7
used = parseInt($(this).attr("Used"), 10);
total = parseInt($(this).attr("Total"), 10);
percent = parseInt($(this).attr("Percent"), 10);
html += "<tr><td style=\"width:200px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(28) + "</span></div></td><td style=\"width:285px;\">" + createBar(percent) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(free, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(used, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(total, xml) + "</td></tr>";
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(28) + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>";
memoryindex = tree.push(0);
 
$("Memory Details", xml).each(function getMemorydetails(id) {
1109,15 → 1146,15
cached = parseInt($(this).attr("Cached"), 10);
cachedp = parseInt($(this).attr("CachedPercent"), 10);
if (!isNaN(app)) {
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(64) + "</span></div></td><td style=\"width:285px;\">" + createBar(appp) + "</td><td class=\"right\" style=\"width:100px;\">&nbsp;</td><td class=\"right\" style=\"width:100px\">" + formatBytes(app, xml) + "</td><td class=\"right\" style=\"width:100px;\">&nbsp;</td></tr>";
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(64) + "</span></div></td><td>" + createBar(appp) + "</td><td class=\"right\">&nbsp;</td><td class=\"right\">" + formatBytes(app, xml) + "</td><td class=\"right\">&nbsp;</td></tr>";
tree.push(memoryindex);
}
if (!isNaN(cached)) {
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(66) + "</span></div></td><td style=\"width:285px;\">" + createBar(cachedp) + "</td><td class=\"right\" style=\"width:100px;\">&nbsp;</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(cached, xml) + "</td><td class=\"right\" style=\"width:100px;\">&nbsp;</td></tr>";
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(66) + "</span></div></td><td>" + createBar(cachedp) + "</td><td class=\"right\">&nbsp;</td><td class=\"right\">" + formatBytes(cached, xml) + "</td><td class=\"right\">&nbsp;</td></tr>";
tree.push(memoryindex);
}
if (!isNaN(buff)) {
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(65) + "</span></div></td><td style=\"width:285px\">" + createBar(buffp) + "</td><td class=\"rigth\" style=\"width:100px;\">&nbsp;</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(buff, xml) + "</td><td class=\"right\" style=\"width:100px;\">&nbsp;</td></tr>";
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(65) + "</span></div></td><td>" + createBar(buffp) + "</td><td class=\"rigth\">&nbsp;</td><td class=\"right\">" + formatBytes(buff, xml) + "</td><td class=\"right\">&nbsp;</td></tr>";
tree.push(memoryindex);
}
if (!isNaN(app) || !isNaN(buff) || !isNaN(cached)) {
1133,7 → 1170,7
used = parseInt($(this).attr("Used"), 10);
total = parseInt($(this).attr("Total"), 10);
percent = parseInt($(this).attr("Percent"), 10);
html += "<tr><td style=\"width:200px;\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(29) + "</span></div></td><td style=\"width:285px;\">" + createBar(percent) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(free, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(used, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(total, xml) + "</td></tr>";
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + genlang(29) + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>";
swapindex = tree.push(0);
 
$("Memory Swap Mount", xml).each(function getDevices(id) {
1152,7 → 1189,7
mpoint = mpid;
}
 
html += "<tr><td style=\"width:184px;\"><div class=\"treediv\"><span class=\"treespan\">" + mpoint + "</span></div></td><td style=\"width:285px;\">" + createBar(percent) + "</td><td class=\"right\" style=\"width:100px\">" + formatBytes(free, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(used, xml) + "</td><td class=\"right\" style=\"width:100px;\">" + formatBytes(total, xml) + "</td></tr>";
html += "<tr><td><div class=\"treediv\"><span class=\"treespan\">" + mpoint + "</span></div></td><td>" + createBar(percent) + "</td><td class=\"right\">" + formatBytes(free, xml) + "</td><td class=\"right\">" + formatBytes(used, xml) + "</td><td class=\"right\">" + formatBytes(total, xml) + "</td></tr>";
tree.push(swapindex);
});
});
1224,9 → 1261,9
inodes_text = "<span style=\"font-style:italic\">&nbsp;(" + inodes.toString() + "%)</span>";
}
 
if (!isNaN(ignore) && (ignore > 0)) {
if (ignore >= 2) {
if ((ignore == 2) && !isNaN(threshold) && (percent >= threshold)) {
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>"]);
} 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>"]);
1239,33 → 1276,39
}
}
} else {
if (!isNaN(threshold) && (percent >= threshold)) {
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)]);
} 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)]);
}
}
if (!isNaN(ignore) && (ignore > 0)) {
if (ignore == 1) {
if (showTotals) {
if (!isNaN(ignore) && (ignore > 0)) {
if (ignore == 2) {
total_used += used;
} else if (ignore == 1) {
total_used += used;
total_size += used;
}
} else {
total_used += used;
total_size += used;
total_free += free;
total_size += size;
}
total_usage = (total_size != 0) ? round(100 - (total_free / total_size) * 100, 2) : 0;
}
});
if (showTotals) {
if (!isNaN(threshold) && (total_usage >= threshold)) {
$("#s_fs_total").html(createBar(total_usage, "barwarn"));
} else {
total_used += used;
total_free += free;
total_size += size;
$("#s_fs_total").html(createBar(total_usage));
}
total_usage = round((total_used / total_size) * 100, 2);
});
 
if (!isNaN(threshold) && (total_usage >= threshold)) {
$("#s_fs_total").html(createBar(total_usage, "barwarn"));
} else {
$("#s_fs_total").html(createBar(total_usage));
$("#s_fs_tfree").html(formatBytes(total_free, xml));
$("#s_fs_tused").html(formatBytes(total_used, xml));
$("#s_fs_tsize").html(formatBytes(total_size, xml));
}
$("#s_fs_tfree").html(formatBytes(total_free, xml));
$("#s_fs_tused").html(formatBytes(total_used, xml));
$("#s_fs_tsize").html(formatBytes(total_size, xml));
}
 
/**
1284,15 → 1327,15
var values = false;
$("#temperatureTable tbody").empty();
$("MBInfo Temperature Item", xml).each(function getTemperatures(id) {
var label = "", value = "", limit = 0, _limit = "", event = "";
var label = "", value = "", event = "", limit = 0, _limit = "";
label = $(this).attr("Label");
value = $(this).attr("Value");
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
limit = parseFloat($(this).attr("Max"));
if (isFinite(limit))
_limit = formatTemp(limit, xml);
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
$("#temperatureTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + formatTemp(value, xml) + "</td><td class=\"right\">" + _limit + "</td></tr>");
values = true;
});
1318,9 → 1361,12
var values = false;
$("#voltageTable tbody").empty();
$("MBInfo Voltage Item", xml).each(function getVoltages(id) {
var label = "", value = 0, max = 0, min = 0, _min = "", _max = "", event = "";
var label = "", value = 0, event = "", max = 0, min = 0, _min = "", _max = "";
label = $(this).attr("Label");
value = parseFloat($(this).attr("Value"));
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
max = parseFloat($(this).attr("Max"));
if (isFinite(max))
_max = round(max, 2) + "&nbsp;" + genlang(62);
1327,9 → 1373,6
min = parseFloat($(this).attr("Min"));
if (isFinite(min))
_min = round(min, 2) + "&nbsp;" + genlang(62);
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
$("#voltageTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + "&nbsp;" + genlang(62) + "</td><td class=\"right\">" + _min + "</td><td class=\"right\">" + _max + "</td></tr>");
values = true;
});
1355,16 → 1398,23
var values = false;
$("#fansTable tbody").empty();
$("MBInfo Fans Item", xml).each(function getFans(id) {
var label = "", value = 0, min = 0, _min = "", event = "";
var label = "", value = 0, event = "", min = 0, _min = "", unit = "";
label = $(this).attr("Label");
value = parseFloat($(this).attr("Value"));
min = parseFloat($(this).attr("Min"));
if (isFinite(min))
_min = round(min,0) + "&nbsp;" + genlang(63);
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
$("#fansTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value,0) + "&nbsp;" + genlang(63) + "</td><td class=\"right\">" + _min + "</td></tr>");
min = parseFloat($(this).attr("Min"));
unit = $(this).attr("Unit");
if (unit === "%") {
if (isFinite(min))
_min = round(min,0) + "%";
$("#fansTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td><td class=\"right\">" + _min + "</td></tr>");
} else {
if (isFinite(min))
_min = round(min,0) + "&nbsp;" + genlang(63);
$("#fansTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value,0) + "&nbsp;" + genlang(63) + "</td><td class=\"right\">" + _min + "</td></tr>");
}
values = true;
});
if (values) {
1389,15 → 1439,15
var values = false;
$("#powerTable tbody").empty();
$("MBInfo Power Item", xml).each(function getPowers(id) {
var label = "", value = "", limit = 0, _limit = "", event = "";
var label = "", value = "", event = "", limit = 0, _limit = "";
label = $(this).attr("Label");
value = $(this).attr("Value");
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
limit = parseFloat($(this).attr("Max"));
if (isFinite(limit))
_limit = round(limit, 2) + "&nbsp;" + genlang(103);
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
$("#powerTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + "&nbsp;" + genlang(103) + "</td><td class=\"right\">" + _limit + "</td></tr>");
values = true;
});
1423,10 → 1473,12
var values = false;
$("#currentTable tbody").empty();
$("MBInfo Current Item", xml).each(function getCurrents(id) {
var label = "", value = "", min = 0, max = 0, _min = "", _max = "", event = "";
var label = "", value = "", event = "", min = 0, max = 0, _min = "", _max = "";
label = $(this).attr("Label");
value = $(this).attr("Value");
 
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
max = parseFloat($(this).attr("Max"));
if (isFinite(max))
_max = round(max, 2) + "&nbsp;" + genlang(106);
1433,10 → 1485,6
min = parseFloat($(this).attr("Min"));
if (isFinite(min))
_min = round(min, 2) + "&nbsp;" + genlang(106);
 
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
$("#currentTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + round(value, 2) + "&nbsp;" + genlang(106) + "</td><td class=\"right\">" + _min + "</td><td class=\"right\">" + _max + "</td></tr>");
values = true;
});
1462,14 → 1510,18
var values = false;
$("#otherTable tbody").empty();
$("MBInfo Other Item", xml).each(function getOthers(id) {
var label = "", value = "", event = "";
var label = "", value = "", event = "", unit = "";
label = $(this).attr("Label");
value = $(this).attr("Value");
 
event = $(this).attr("Event");
if (event !== undefined)
label += " <img style=\"vertical-align: middle; width:16px;\" src=\"./gfx/attention.gif\" alt=\"!\" title=\""+event+"\"/>";
$("#otherTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + value + "</td></tr>");
unit = $(this).attr("Unit");
if (unit === "%") {
$("#otherTable tbody").append("<tr><td>" + label + "</td><td>" + createBar(round(value,0)) + "</td></tr>");
} else {
$("#otherTable tbody").append("<tr><td>" + label + "</td><td class=\"right\">" + value + "</td></tr>");
}
values = true;
});
if (values) {
1526,59 → 1578,59
}
index = tree.push(0);
if (model !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(70) + "</span></div></td><td>" + model + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(70) + "</span></div></td><td>" + model + "</td></tr>\n";
tree.push(index);
}
if (start_time !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(72) + "</span></div></td><td>" + start_time + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(72) + "</span></div></td><td>" + start_time + "</td></tr>\n";
tree.push(index);
}
if (upsstatus !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(73) + "</span></div></td><td>" + upsstatus + "</td></tr>\n";
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 (temperature !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(84) + "</span></div></td><td>" + temperature + "</td></tr>\n";
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);
}
if (outages_count !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(74) + "</span></div></td><td>" + outages_count + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(74) + "</span></div></td><td>" + outages_count + "</td></tr>\n";
tree.push(index);
}
if (last_outage !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(75) + "</span></div></td><td>" + last_outage + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(75) + "</span></div></td><td>" + last_outage + "</td></tr>\n";
tree.push(index);
}
if (last_outage_finish !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(76) + "</span></div></td><td>" + last_outage_finish + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(76) + "</span></div></td><td>" + last_outage_finish + "</td></tr>\n";
tree.push(index);
}
if (line_voltage !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(77) + "</span></div></td><td>" + line_voltage + "&nbsp;" + genlang(82) + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(77) + "</span></div></td><td>" + line_voltage + "&nbsp;" + genlang(82) + "</td></tr>\n";
tree.push(index);
}
if (line_frequency !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(108) + "</span></div></td><td>" + line_frequency + "&nbsp;" + genlang(109) + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(108) + "</span></div></td><td>" + line_frequency + "&nbsp;" + genlang(109) + "</td></tr>\n";
tree.push(index);
}
if (!isNaN(load_percent)) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(78) + "</span></div></td><td>" + createBar(load_percent) + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(78) + "</span></div></td><td>" + createBar(load_percent) + "</td></tr>\n";
tree.push(index);
}
if (battery_date !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(104) + "</span></div></td><td>" + battery_date + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(104) + "</span></div></td><td>" + battery_date + "</td></tr>\n";
tree.push(index);
}
if (battery_voltage !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(79) + "</span></div></td><td>" + battery_voltage + "&nbsp;" + genlang(82) + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(79) + "</span></div></td><td>" + battery_voltage + "&nbsp;" + genlang(82) + "</td></tr>\n";
tree.push(index);
}
if (!isNaN(battery_charge_percent)) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(80) + "</span></div></td><td>" + createBar(battery_charge_percent) + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(80) + "</span></div></td><td>" + createBar(battery_charge_percent) + "</td></tr>\n";
tree.push(index);
}
if (time_left_minutes !== undefined) {
html += "<tr><td style=\"width:160px\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(81) + "</span></div></td><td>" + time_left_minutes + "&nbsp;" + genlang(83) + "</td></tr>\n";
html += "<tr><td style=\"width:36%\"><div class=\"treediv\"><span class=\"treespan\">" + genlang(81) + "</span></div></td><td>" + time_left_minutes + "&nbsp;" + genlang(83) + "</td></tr>\n";
tree.push(index);
}
values=true;
1691,6 → 1743,9
showNetworkInfosExpanded = $("#showNetworkInfosExpanded").val().toString()==="true";
showMemoryInfosExpanded = $("#showMemoryInfosExpanded").val().toString()==="true";
showCPULoadCompact = $("#showCPULoadCompact").val().toString()==="true";
showTotals = $("#hideTotals").val().toString()!=="true";
increaseWidth = $("#increaseWidth").val().toString();
if (isNaN(increaseWidth) || (increaseWidth<=0)) increaseWidth = 0;
switch ($("#showNetworkActiveSpeed").val().toString()) {
case "bps": showNetworkActiveSpeed = 2;
break;
1914,7 → 1969,8
}
block += "<div id=\"panel_" + plugin + "\" style=\"display:none;\">\n";
block += "<div id=\"Plugin_" + plugin + "\" class=\"plugin\" style=\"display:none;\">\n";
block += "<h2>" + reloadpic + genlang(translationid, plugin) + "</h2>\n";
block += "<h2>" + reloadpic + genlang(translationid, plugin) + "\n";
block += "<span class=\"Hostname_" + plugin + "\"></span></h2>\n";
block += "</div>\n";
block += "</div>\n";
return block;
/web/acc/phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js
21,7 → 21,7
} else {
expires = "";
}
document.cookie = name + "=" + value + expires + "; path=/";
document.cookie = name + "=" + value + expires + "; path=/; samesite=strict";
}
 
/**
288,6 → 288,13
pluginname: pluginname,
success: function (data) {
try {
for (var propertyName in data.Plugins) {
if ((data.Plugins[propertyName]["@attributes"] !== undefined) &&
((hostname = data.Plugins[propertyName]["@attributes"]["Hostname"]) !== undefined)) {
$('span[class=hostname_' + pluginname + ']').html(hostname);
}
break;
}
// dynamic call
window['renderPlugin_' + this.pluginname](data);
changeLanguage(this.pluginname);
313,9 → 320,13
});
}
 
if (((ua=useragent.match(/Safari\/(\d+)\.[\d\.]+$/)) !== null) && (ua[1]<=534)) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-safari5.css');
} else if ((ua=useragent.match(/Firefox\/(\d+)\.[\d\.]+$/)) !== null) {
if ((ua=useragent.match(/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) {
if (ua[1]<=15) {
$("#PSI_CSS_Fix")[0].setAttribute('href', 'templates/vendor/bootstrap-firefox15.css');
} else if (ua[1]<=20) {
325,6 → 336,18
} 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) {
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');
}
}
 
$(window).resize();
452,7 → 475,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 {
553,12 → 576,12
var timestamp = 0;
var datetimeFormat;
if ((data.Generation !== undefined) && (data.Generation["@attributes"] !== undefined) && (data.Generation["@attributes"].timestamp !== undefined) ) {
timestamp = parseInt(data.Generation["@attributes"].timestamp)*1000; //server time
timestamp = parseInt(data.Generation["@attributes"].timestamp, 10) * 1000; //server time
if (isNaN(timestamp)) timestamp = Number(new Date()); //client time
} else {
timestamp = Number(new Date()); //client time
}
lastboot = new Date(timestamp - (parseInt(this.Uptime)*1000));
lastboot = new Date(timestamp - (parseInt(this.Uptime, 10) * 1000));
if (((datetimeFormat = data.Options["@attributes"].datetimeFormat) !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
return lastboot.toLocaleString();
} else {
596,24 → 619,24
html: function () {
var processes = "", p111 = 0, p112 = 0, p113 = 0, p114 = 0, p115 = 0, p116 = 0;
var not_first = false;
processes = parseInt(this.Processes);
processes = parseInt(this.Processes, 10);
if (this.ProcessesRunning !== undefined) {
p111 = parseInt(this.ProcessesRunning);
p111 = parseInt(this.ProcessesRunning, 10);
}
if (this.ProcessesSleeping !== undefined) {
p112 = parseInt(this.ProcessesSleeping);
p112 = parseInt(this.ProcessesSleeping, 10);
}
if (this.ProcessesStopped !== undefined) {
p113 = parseInt(this.ProcessesStopped);
p113 = parseInt(this.ProcessesStopped, 10);
}
if (this.ProcessesZombie !== undefined) {
p114 = parseInt(this.ProcessesZombie);
p114 = parseInt(this.ProcessesZombie, 10);
}
if (this.ProcessesWaiting !== undefined) {
p115 = parseInt(this.ProcessesWaiting);
p115 = parseInt(this.ProcessesWaiting, 10);
}
if (this.ProcessesOther !== undefined) {
p116 = parseInt(this.ProcessesOther);
p116 = parseInt(this.ProcessesOther, 10);
}
if (p111 || p112 || p113 || p114 || p115 || p116) {
processes += " (";
697,7 → 720,7
},
Bogomips: {
text: function () {
return parseInt(this.Bogomips);
return parseInt(this.Bogomips, 10);
}
},
Load: {
717,8 → 740,8
},
hwCount: {
text: function() {
if ((this.Count !== undefined) && !isNaN(this.Count) && (parseInt(this.Count)>1)) {
return parseInt(this.Count);
if ((this.Count !== undefined) && !isNaN(this.Count) && (parseInt(this.Count, 10)>1)) {
return parseInt(this.Count, 10);
} else {
return "";
}
726,7 → 749,30
}
};
 
var mem_directives = {
Speed: {
html: function() {
return formatMTps(this.Speed);
}
},
Voltage: {
html: function() {
return round(this.Voltage, 2) + ' V';
}
},
Capacity: {
html: function () {
return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat);
}
}
};
 
var dev_directives = {
Speed: {
html: function() {
return formatBPS(1000000*this.Speed);
}
},
Capacity: {
html: function () {
return formatBytes(this.Capacity, data.Options["@attributes"].byteFormat);
779,15 → 825,23
$("#hardware-CPU").hide();
}
 
var devparamlist = {Capacity:43,Manufacturer:122,Product:123,Serial:124};
for (hw_type in {PCI:0,IDE:1,SCSI:2,NVMe:3,USB:4,TB:5,I2C:6}) {
var devparamlist = {Capacity:43,Manufacturer:122,Product:123,Speed:129,Voltage:52,Serial:124};
for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) {
try {
datas = items(data.Hardware[hw_type].Device);
if (hw_type == 'MEM') {
datas = items(data.Hardware[hw_type].Chip);
} else {
datas = items(data.Hardware[hw_type].Device);
}
for (i = 0; i < datas.length; i++) {
if (i === 0) {
html+="<tr id=\"hardware-" + hw_type + "\" class=\"treegrid-" + hw_type + "\">";
html+="<th>" + hw_type + "</th>";
html+="<td><span class=\"treegrid-span\">" + genlang('120') + ":</span></td>"; //Number of devices
if (hw_type == 'MEM') {
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>";
}
837,21 → 891,33
}
 
var licz;
for (hw_type in {PCI:0,IDE:1,SCSI:2,NVMe:3,USB:4,TB:5,I2C:6}) {
for (hw_type in {MEM:0,PCI:1,IDE:2,SCSI:3,NVMe:4,USB:5,TB:6,I2C:7}) {
try {
licz = 0;
datas = items(data.Hardware[hw_type].Device);
if (hw_type == 'MEM') {
datas = items(data.Hardware[hw_type].Chip);
} else {
datas = items(data.Hardware[hw_type].Device);
}
for (i = 0; i < datas.length; i++) {
$('#hardware-'+hw_type+'-'+ i).render(datas[i]["@attributes"], hw_directives);
if ((datas[i]["@attributes"].Count !== undefined) && !isNaN(datas[i]["@attributes"].Count) && (parseInt(datas[i]["@attributes"].Count)>1)) {
licz += parseInt(datas[i]["@attributes"].Count);
if ((datas[i]["@attributes"].Count !== undefined) && !isNaN(datas[i]["@attributes"].Count) && (parseInt(datas[i]["@attributes"].Count, 10)>1)) {
licz += parseInt(datas[i]["@attributes"].Count, 10);
} else {
licz++;
}
for (proc_param in devparamlist) {
if ((datas[i]["@attributes"][proc_param] !== undefined)) {
$('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], dev_directives);
if (hw_type == 'MEM') {
for (proc_param in devparamlist) {
if ((datas[i]["@attributes"][proc_param] !== undefined)) {
$('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], mem_directives);
}
}
} else {
for (proc_param in devparamlist) {
if ((datas[i]["@attributes"][proc_param] !== undefined)) {
$('#hardware-'+hw_type+'-'+ i +'-'+proc_param).render(datas[i]["@attributes"], dev_directives);
}
}
}
}
if (i > 0) {
916,19 → 982,19
'<div class="progress-bar progress-bar-info" style="width:' + this["@attributes"].Percent + '%;"></div>' +
'</div><div class="percent">' + this["@attributes"].Percent + '%</div>';
} else {
var rest = parseInt(this["@attributes"].Percent);
var rest = parseInt(this["@attributes"].Percent, 10);
var html = '<div class="progress">';
if ((this.Details["@attributes"].AppPercent !== undefined) && (this.Details["@attributes"].AppPercent > 0)) {
html += '<div class="progress-bar progress-bar-info" style="width:' + this.Details["@attributes"].AppPercent + '%;"></div>';
rest -= parseInt(this.Details["@attributes"].AppPercent);
rest -= parseInt(this.Details["@attributes"].AppPercent, 10);
}
if ((this.Details["@attributes"].CachedPercent !== undefined) && (this.Details["@attributes"].CachedPercent > 0)) {
html += '<div class="progress-bar progress-bar-warning" style="width:' + this.Details["@attributes"].CachedPercent + '%;"></div>';
rest -= parseInt(this.Details["@attributes"].CachedPercent);
rest -= parseInt(this.Details["@attributes"].CachedPercent, 10);
}
if ((this.Details["@attributes"].BuffersPercent !== undefined) && (this.Details["@attributes"].BuffersPercent > 0)) {
html += '<div class="progress-bar progress-bar-danger" style="width:' + this.Details["@attributes"].BuffersPercent + '%;"></div>';
rest -= parseInt(this.Details["@attributes"].BuffersPercent);
rest -= parseInt(this.Details["@attributes"].BuffersPercent, 10);
}
if (rest > 0) {
html += '<div class="progress-bar progress-bar-success" style="width:' + rest + '%;"></div>';
1013,29 → 1079,17
var directives = {
Total: {
html: function () {
if ((this.Ignore !== undefined) && (this.Ignore > 0)) {
return formatBytes(this.Total, data.Options["@attributes"].byteFormat, true);
} else {
return formatBytes(this.Total, data.Options["@attributes"].byteFormat);
}
return formatBytes(this.Total, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals);
}
},
Free: {
html: function () {
if ((this.Ignore !== undefined) && (this.Ignore > 0)) {
return formatBytes(this.Free, data.Options["@attributes"].byteFormat, true);
} else {
return formatBytes(this.Free, data.Options["@attributes"].byteFormat);
}
return formatBytes(this.Free, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore > 0) && showtotals);
}
},
Used: {
html: function () {
if ((this.Ignore !== undefined) && (this.Ignore >= 2)) {
return formatBytes(this.Used, data.Options["@attributes"].byteFormat, true);
} else {
return formatBytes(this.Used, data.Options["@attributes"].byteFormat);
}
return formatBytes(this.Used, data.Options["@attributes"].byteFormat, (this.Ignore !== undefined) && (this.Ignore >= 3) && showtotals);
}
},
MountPoint: {
1050,11 → 1104,23
},
Percent: {
html: function () {
return '<div class="progress">' + '<div class="' +
( ( ((this.Ignore == undefined) || (this.Ignore < 3)) && ((data.Options["@attributes"].threshold !== undefined) &&
(parseInt(this.Percent) >= parseInt(data.Options["@attributes"].threshold))) ) ? 'progress-bar progress-bar-danger' : 'progress-bar progress-bar-info' ) +
'" style="width:' + this.Percent + '% ;"></div>' +
'</div>' + '<div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>';
var used1 = (this.Total != 0) ? Math.ceil((this.Used / this.Total) * 100) : 0;
var used2 = Math.ceil(this.Percent);
var used21= used2 - used1;
if (used21 > 0) {
return '<div class="progress">' + '<div class="' +
( ( ((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>';
} else {
return '<div class="progress">' + '<div class="' +
( ( ((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:' + used2 + '% ;"></div>' +
'</div>' + '<div class="percent">' + this.Percent + '% ' + ((this.Inodes !== undefined) ? '<i>(' + this.Inodes + '%)</i>' : '') + '</div>';
}
}
}
};
1063,23 → 1129,31
var fs_data = [];
var datas = items(data.FileSystem.Mount);
var total = {Total:0,Free:0,Used:0};
var showtotals = $("#hideTotals").val().toString()!=="true";
for (var i = 0; i < datas.length; i++) {
fs_data.push(datas[i]["@attributes"]);
if ((datas[i]["@attributes"].Ignore !== undefined) && (datas[i]["@attributes"].Ignore > 0)) {
if (datas[i]["@attributes"].Ignore == 1) {
total.Total += parseInt(datas[i]["@attributes"].Used);
total.Used += parseInt(datas[i]["@attributes"].Used);
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);
} else if (datas[i]["@attributes"].Ignore == 1) {
total.Total += parseInt(datas[i]["@attributes"].Used, 10);
total.Used += parseInt(datas[i]["@attributes"].Used, 10);
}
} else {
total.Total += parseInt(datas[i]["@attributes"].Total, 10);
total.Free += parseInt(datas[i]["@attributes"].Free, 10);
total.Used += parseInt(datas[i]["@attributes"].Used, 10);
}
} else {
total.Total += parseInt(datas[i]["@attributes"].Total);
total.Free += parseInt(datas[i]["@attributes"].Free);
total.Used += parseInt(datas[i]["@attributes"].Used);
total.Percent = (total.Total != 0) ? round(100 - (total.Free / total.Total) * 100, 2) : 0;
}
total.Percent = (total.Total !== 0) ? round((total.Used / total.Total) * 100, 2) : 0;
}
if (i > 0) {
$('#filesystem-data').render(fs_data, directives);
$('#filesystem-foot').render(total, directives);
if (showtotals) {
$('#filesystem-foot').render(total, directives);
$('#filesystem-foot').show();
}
$('#filesystem_MountPoint').removeClass("sorttable_sorted"); //reset sort order
// sorttable.innerSortFunction.apply(document.getElementById('filesystem_MountPoint'), []);
sorttable.innerSortFunction.apply($('#filesystem_MountPoint')[0], []);
1292,13 → 1366,24
var directives = {
Value: {
html: function () {
return round(this.Value,0) + String.fromCharCode(160) + genlang(63); //RPM
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>';
} else {
return round(this.Value,0) + String.fromCharCode(160) + genlang(63); //RPM
}
}
},
Min: {
html: function () {
if (this.Min !== undefined)
return round(this.Min,0) + String.fromCharCode(160) + genlang(63); //RPM
if (this.Min !== undefined) {
if (this.Unit === "%") {
return round(this.Min,0) + "%";
} else {
return round(this.Min,0) + String.fromCharCode(160) + genlang(63); //RPM
}
}
}
},
Label: {
1425,6 → 1510,18
}
 
var directives = {
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) + "%";
} else {
return this.Value;
}
}
},
Label: {
html: function () {
if (this.Event === undefined)
1643,6 → 1740,23
}
 
/**
* format a given MT/s value to a better readable statement with the right suffix
* @param {Number} mtps mtps value that should be formatted
* @return {String} html string with no breaking spaces and translation statements
*/
function formatMTps(mtps) {
if ((mtps >= 0) && (mtps < 1000)) {
return mtps.toString() + String.fromCharCode(160) + genlang(131);
} else {
if (mtps >= 1000) {
return round(mtps / 1000, 2) + String.fromCharCode(160) + genlang(132);
} else {
return "";
}
}
}
 
/**
* format the byte values into a user friendly value with the corespondenting unit expression<br>support is included
* for binary and decimal output<br>user can specify a constant format for all byte outputs or the output is formated
* automatically so that every value can be read in a user friendly way