* 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:
@@ -18,7 +18,7 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang, createBar */
|
||||
/*global $, jQuery, buildBlock, datetime, plugin_translate, genlang */
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -28,7 +28,12 @@ var UpdateNotifier_show = false, UpdateNotifier_table;
|
||||
* @param {jQuery} xml plugin-XML
|
||||
*/
|
||||
function updatenotifier_populate(xml) {
|
||||
var html = "";
|
||||
var html = "", hostname = "";
|
||||
|
||||
hostname = $("Plugins Plugin_UpdateNotifier", xml).attr('Hostname');
|
||||
if (hostname !== undefined) {
|
||||
$('span[class=Hostname_UpdateNotifier]').html(hostname);
|
||||
}
|
||||
|
||||
$("Plugins Plugin_UpdateNotifier UpdateNotifier", xml).each(function(idp) {
|
||||
var packages = "", security = "";
|
||||
@@ -38,19 +43,19 @@ function updatenotifier_populate(xml) {
|
||||
//UpdateNotifier_table.fnAddData([packages]);
|
||||
//UpdateNotifier_table.fnAddData([security]);
|
||||
|
||||
html = " <tr>\n";
|
||||
html += " <td>" + packages + " " + genlang(3, true, "UpdateNotifier") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <td>" + security + " " + genlang(4, true, "UpdateNotifier") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
html = " <tr>\n";
|
||||
html += " <td>" + packages + " " + genlang(3, "UpdateNotifier") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <td>" + security + " " + genlang(4, "UpdateNotifier") + "</td>\n";
|
||||
html += " </tr>\n";
|
||||
|
||||
$("#Plugin_UpdateNotifier tbody").append(html);
|
||||
$("#Plugin_UpdateNotifier tbody").empty().append(html);
|
||||
|
||||
if ((packages == 0) && (security == 0)) {
|
||||
$("#UpdateNotifierTable-info").html(genlang(5, true, "UpdateNotifier"));
|
||||
if ((packages <= 0) && (security <= 0)) {
|
||||
$("#UpdateNotifierTable-info").html(genlang(5, "UpdateNotifier"));
|
||||
} else {
|
||||
$("#UpdateNotifierTable-info").html(genlang(2, true, "UpdateNotifier"));
|
||||
$("#UpdateNotifierTable-info").html(genlang(2, "UpdateNotifier"));
|
||||
}
|
||||
|
||||
UpdateNotifier_show = true;
|
||||
@@ -63,15 +68,17 @@ function updatenotifier_populate(xml) {
|
||||
function updatenotifier_buildTable() {
|
||||
var html = "";
|
||||
|
||||
html += "<table id=\"Plugin_UpdateNotifierTable\" style=\"border-spacing:0;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th id=\"UpdateNotifierTable-info\">" + genlang(2, true, "UpdateNotifier") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += "</table>\n";
|
||||
html += "<div style=\"overflow-x:auto;\">\n";
|
||||
html += " <table id=\"Plugin_UpdateNotifierTable\" style=\"border-collapse:collapse;\">\n";
|
||||
html += " <thead>\n";
|
||||
html += " <tr>\n";
|
||||
html += " <th id=\"UpdateNotifierTable-info\">" + genlang(2, "UpdateNotifier") + "</th>\n";
|
||||
html += " </tr>\n";
|
||||
html += " </thead>\n";
|
||||
html += " <tbody>\n";
|
||||
html += " </tbody>\n";
|
||||
html += " </table>\n";
|
||||
html += "</div>\n";
|
||||
|
||||
$("#Plugin_UpdateNotifier").append(html);
|
||||
|
||||
@@ -81,27 +88,33 @@ function updatenotifier_buildTable() {
|
||||
* load the xml via ajax
|
||||
*/
|
||||
function updatenotifier_request() {
|
||||
$("#Reload_UpdateNotifierTable").attr("title", "reload");
|
||||
$.ajax({
|
||||
url: "xml.php?plugin=UpdateNotifier",
|
||||
dataType: "xml",
|
||||
error: function () {
|
||||
$.jGrowl("Error loading XML document for Plugin UpdateNotifier!");
|
||||
},
|
||||
success: function updatenotifier_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
updatenotifier_populate(xml);
|
||||
if (UpdateNotifier_show) {
|
||||
plugin_translate("UpdateNotifier");
|
||||
$("#Plugin_UpdateNotifier").show();
|
||||
$.jGrowl("Error loading XML document for Plugin UpdateNotifier!");
|
||||
},
|
||||
success: function updatenotifier_buildblock(xml) {
|
||||
populateErrors(xml);
|
||||
updatenotifier_populate(xml);
|
||||
if (UpdateNotifier_show) {
|
||||
plugin_translate("UpdateNotifier");
|
||||
$("#Plugin_UpdateNotifier").show();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#footer").before(buildBlock("UpdateNotifier", 1, false));
|
||||
$("#Plugin_UpdateNotifier").css("width", "451px");
|
||||
$("#footer").before(buildBlock("UpdateNotifier", 1, true));
|
||||
$("#Plugin_UpdateNotifier").addClass("halfsize");
|
||||
|
||||
updatenotifier_buildTable();
|
||||
updatenotifier_request();
|
||||
|
||||
$("#Reload_UpdateNotifierTable").click(function updatenotifier_reload(id) {
|
||||
updatenotifier_request();
|
||||
$(this).attr("title", datetime());
|
||||
});
|
||||
});
|
||||
|
@@ -3,20 +3,20 @@ function renderPlugin_updatenotifier(data) {
|
||||
var directives = {
|
||||
updateNotifierNbPackages: {
|
||||
text: function () {
|
||||
return this['packages'];
|
||||
return this.packages;
|
||||
}
|
||||
},
|
||||
updateNotifierNbSecPackages: {
|
||||
text: function () {
|
||||
return this['security'];
|
||||
return this.security;
|
||||
}
|
||||
}
|
||||
};
|
||||
if ((data['Plugins']['Plugin_UpdateNotifier'] !== undefined) && (data['Plugins']['Plugin_UpdateNotifier']["UpdateNotifier"] !== undefined)){
|
||||
$('#updatenotifier').render(data['Plugins']['Plugin_UpdateNotifier']["UpdateNotifier"], directives);
|
||||
if ((data['Plugins']['Plugin_UpdateNotifier']["UpdateNotifier"]["packages"] == 0) &&
|
||||
(data['Plugins']['Plugin_UpdateNotifier']["UpdateNotifier"]["security"] == 0) ) {
|
||||
$("#updatenotifier-info").html("<strong>No updates available</strong>");
|
||||
if ((data.Plugins.Plugin_UpdateNotifier !== undefined) && (data.Plugins.Plugin_UpdateNotifier.UpdateNotifier !== undefined)){
|
||||
$('#updatenotifier').render(data.Plugins.Plugin_UpdateNotifier.UpdateNotifier, directives);
|
||||
if ((data.Plugins.Plugin_UpdateNotifier.UpdateNotifier.packages <= 0) &&
|
||||
(data.Plugins.Plugin_UpdateNotifier.UpdateNotifier.security <= 0) ) {
|
||||
$("#updatenotifier-info").html("<strong>"+genlang(5, 'updatenotifier')+"</strong>");
|
||||
}
|
||||
$('#block_updatenotifier').show();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user