* Mon May 12 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
- Adding SM2 panel [SME: 13004] - Upgrade to phpsysinfo 3.4.4 - Add code to delete inline styles and add css to make it look better. - version saved / built uses the static version, which means no drops downs and choices.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
//$Id: uprecords.js 661 2014-01-08 11:26:39 aolah76 $
|
||||
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang */
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -33,36 +33,41 @@ var uprecords_show = false;
|
||||
*/
|
||||
|
||||
function uprecords_populate(xml) {
|
||||
var html = "", datetimeFormat = "", hostname = "";
|
||||
|
||||
var html = "";// lastboot = 0;
|
||||
$("#Plugin_uprecordsTable").html(" ");
|
||||
hostname = $("Plugins Plugin_uprecords", xml).attr('Hostname');
|
||||
if (hostname !== undefined) {
|
||||
$('span[class=Hostname_uprecords]').html(hostname);
|
||||
}
|
||||
|
||||
$("Options", xml).each(function getByteFormat(id) {
|
||||
datetimeFormat = $(this).attr("datetimeFormat");
|
||||
});
|
||||
|
||||
$("Plugins Plugin_uprecords uprecords Item", xml).each(function uprecords_getitem(idp) {
|
||||
if(idp==0) {
|
||||
html += " <tr>\n";
|
||||
html += " <th>" + genlang(101, true, "uprecords") + "</th>\n";
|
||||
html += " <th>" + genlang(102, true, "uprecords") + "</th>\n";
|
||||
html += " <th>" + genlang(103, true, "uprecords") + "</th>\n";
|
||||
html += " <th>" + genlang(104, true, "uprecords") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
}
|
||||
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("hash") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Uptime") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("System") + "</td>\n";
|
||||
/* lastboot = new Date($(this).attr("Bootup"));
|
||||
html += " <tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("hash") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Uptime") + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("System") + "</td>\n";
|
||||
/*
|
||||
var lastboot = new Date($(this).attr("Bootup"));
|
||||
if (typeof(lastboot.toUTCString)==="function") {
|
||||
html += " <td style=\"font-weight:normal\">" + lastboot.toUTCString() + "</td>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + lastboot.toUTCString() + "</td>\n";
|
||||
} else { //deprecated
|
||||
html += " <td style=\"font-weight:normal\">" + lastboot.toGMTString() + "</td>\n";
|
||||
} */
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Bootup") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
html += " <td style=\"font-weight:normal\">" + lastboot.toGMTString() + "</td>\n";
|
||||
}
|
||||
*/
|
||||
if ((datetimeFormat !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
|
||||
var lastboot = new Date($(this).attr("Bootup"));
|
||||
html += " <td style=\"font-weight:normal\">" + lastboot.toLocaleString() + "</td>\n";
|
||||
} else {
|
||||
html += " <td style=\"font-weight:normal\">" + $(this).attr("Bootup") + "</td>\n";
|
||||
}
|
||||
html += " </tr>\n";
|
||||
uprecords_show = true;
|
||||
});
|
||||
|
||||
$("#Plugin_uprecordsTable").append(html);
|
||||
$("#Plugin_uprecordsTable-tbody").empty().append(html);
|
||||
$('#Plugin_uprecordsTable tr:nth-child(even)').addClass('even');
|
||||
|
||||
}
|
||||
@@ -70,12 +75,20 @@ function uprecords_populate(xml) {
|
||||
function uprecords_buildTable() {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_uprecordsTable\" class=\"stripeMe\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
html += "<div style=\"overflow-x:auto;\">\n";
|
||||
html += " <table id=\"Plugin_uprecordsTable\" class=\"stripeMe\" style=\"border-collapse:collapse;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th>" + genlang(101, "uprecords") + "</th>\n";
|
||||
html += " <th>" + genlang(102, "uprecords") + "</th>\n";
|
||||
html += " <th>" + genlang(103, "uprecords") + "</th>\n";
|
||||
html += " <th>" + genlang(104, "uprecords") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody id=\"Plugin_uprecordsTable-tbody\">\n";
|
||||
html += " </tbody>\n";
|
||||
html += " </table>\n";
|
||||
html += "</div>\n";
|
||||
$("#Plugin_uprecords").append(html);
|
||||
}
|
||||
|
||||
@@ -84,26 +97,27 @@ function uprecords_buildTable() {
|
||||
*/
|
||||
|
||||
function uprecords_request() {
|
||||
$("#Reload_uprecordsTable").attr("title", "reload");
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=uprecords",
|
||||
dataType: "xml",
|
||||
error: function uprecords_error() {
|
||||
$.jGrowl("Error loading XML document for Plugin uprecords!");
|
||||
},
|
||||
success: function uprecords_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
uprecords_populate(xml);
|
||||
if (uprecords_show) {
|
||||
plugin_translate("uprecords");
|
||||
$("#Plugin_uprecords").show();
|
||||
$.jGrowl("Error loading XML document for Plugin uprecords!");
|
||||
},
|
||||
success: function uprecords_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
uprecords_populate(xml);
|
||||
if (uprecords_show) {
|
||||
plugin_translate("uprecords");
|
||||
$("#Plugin_uprecords").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function uprecords_buildpage() {
|
||||
$("#footer").before(buildBlock("uprecords", 1, true));
|
||||
$("#Plugin_uprecords").css("width", "915px");
|
||||
$("#Plugin_uprecords").addClass("fullsize");
|
||||
|
||||
uprecords_buildTable();
|
||||
|
||||
@@ -111,6 +125,6 @@ $(document).ready(function uprecords_buildpage() {
|
||||
|
||||
$("#Reload_uprecordsTable").click(function uprecords_reload(id) {
|
||||
uprecords_request();
|
||||
$("#Reload_uprecordsTable").attr("title",datetime());
|
||||
$(this).attr("title", datetime());
|
||||
});
|
||||
});
|
||||
|
@@ -3,13 +3,24 @@ function renderPlugin_uprecords(data) {
|
||||
var directives = {
|
||||
hash: {
|
||||
html: function () {
|
||||
return this["hash"];
|
||||
return this.hash;
|
||||
}
|
||||
},
|
||||
Bootup: {
|
||||
html: function () {
|
||||
var datetimeFormat;
|
||||
if (((datetimeFormat = data.Options["@attributes"].datetimeFormat) !== undefined) && (datetimeFormat.toLowerCase() === "locale")) {
|
||||
var bootup = new Date(this.Bootup);
|
||||
return bootup.toLocaleString();
|
||||
} else {
|
||||
return this.Bootup;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if ((data['Plugins']['Plugin_uprecords'] !== undefined) && (data['Plugins']['Plugin_uprecords']['Uprecords'] !== undefined)) {
|
||||
var upitems = items(data['Plugins']['Plugin_uprecords']['Uprecords']['Item']);
|
||||
if ((data.Plugins.Plugin_uprecords !== undefined) && (data.Plugins.Plugin_uprecords.Uprecords !== undefined)) {
|
||||
var upitems = items(data.Plugins.Plugin_uprecords.Uprecords.Item);
|
||||
if (upitems.length > 0) {
|
||||
var up_memory = [];
|
||||
up_memory.push_attrs(upitems);
|
||||
|
Reference in New Issue
Block a user