mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-07 05:54:53 +02:00
Added new info to the tree
This commit is contained in:
parent
804b7743fc
commit
278ceefb32
@ -77,7 +77,7 @@ if (is_ajax ()) {
|
|||||||
elseif ($data["monitor_warning"] > 0) {
|
elseif ($data["monitor_warning"] > 0) {
|
||||||
$status['status'] = 'warning';
|
$status['status'] = 'warning';
|
||||||
}
|
}
|
||||||
elseif (($data["monitor_unknown"] > 0) || ($data["agents_unknown"] > 0)) {
|
elseif (($data["monitor_unknown"] > 0) || ($data["agents_unknown"] > 0)) {
|
||||||
$status['status'] = 'unknown';
|
$status['status'] = 'unknown';
|
||||||
}
|
}
|
||||||
elseif ($data["monitor_ok"] > 0) {
|
elseif ($data["monitor_ok"] > 0) {
|
||||||
|
@ -79,15 +79,76 @@ TreeController = {
|
|||||||
$content.addClass("node-content");
|
$content.addClass("node-content");
|
||||||
switch (element.type) {
|
switch (element.type) {
|
||||||
case 'group':
|
case 'group':
|
||||||
|
if (typeof element.icon != 'undefined' && element.icon.length > 0) {
|
||||||
|
$content.append('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')
|
||||||
|
+'images/groups_small/'+element.icon+'.png" />')
|
||||||
|
}
|
||||||
$content.append(element.name);
|
$content.append(element.name);
|
||||||
break;
|
break;
|
||||||
case 'agent':
|
case 'agent':
|
||||||
$content.append(element.name);
|
$content.append(element.name);
|
||||||
|
case 'module':
|
||||||
|
$content.append(element.name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$content.append(element.name);
|
$content.append(element.name);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Load the status counters
|
||||||
|
if (typeof element.counters != 'undefined' && element.counters.length > 0) {
|
||||||
|
var $counters = $("<div></div>");
|
||||||
|
$counters.addClass('tree-node-counters');
|
||||||
|
|
||||||
|
|
||||||
|
$content.append($counters);
|
||||||
|
}
|
||||||
|
// Load the counters asynchronously
|
||||||
|
else if (typeof element.searchCounters != 'undefined' && element.searchCounters) {
|
||||||
|
var $counters = $("<div></div>");
|
||||||
|
$counters
|
||||||
|
.addClass('tree-node-counters')
|
||||||
|
.append(' (')
|
||||||
|
.append('<img src="'+(controller.baseURL.length > 0 ? controller.baseURL : '')+'images/spinner.gif" />')
|
||||||
|
.append(')');
|
||||||
|
|
||||||
|
// $.ajax({
|
||||||
|
// url: controller.ajaxURL,
|
||||||
|
// type: 'POST',
|
||||||
|
// dataType: 'json',
|
||||||
|
// data: {
|
||||||
|
// page: controller.ajaxPage,
|
||||||
|
// getChildren: 1,
|
||||||
|
// id: element.id,
|
||||||
|
// type: element.type,
|
||||||
|
// filter: controller.filter
|
||||||
|
// },
|
||||||
|
// complete: function(xhr, textStatus) {
|
||||||
|
|
||||||
|
// },
|
||||||
|
// success: function(data, textStatus, xhr) {
|
||||||
|
// if (data.success) {
|
||||||
|
|
||||||
|
// if (typeof data.counters != 'undefined' && data.counters.length > 0) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// error: function(xhr, textStatus, errorThrown) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
$content.append($counters);
|
||||||
|
}
|
||||||
|
|
||||||
// If exist the detail container, show the data
|
// If exist the detail container, show the data
|
||||||
if (typeof controller.detailRecipient != 'undefined' && controller.detailRecipient.length > 0) {
|
if (typeof controller.detailRecipient != 'undefined' && controller.detailRecipient.length > 0) {
|
||||||
$content.click(function (e) {
|
$content.click(function (e) {
|
||||||
@ -123,7 +184,9 @@ TreeController = {
|
|||||||
var $children = _processGroup($node, element.tree);
|
var $children = _processGroup($node, element.tree);
|
||||||
$node.data('children', $children);
|
$node.data('children', $children);
|
||||||
|
|
||||||
$leafIcon.click(function () {
|
$leafIcon.click(function (e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
if ($node.hasClass("leaf-open")) {
|
if ($node.hasClass("leaf-open")) {
|
||||||
$node
|
$node
|
||||||
.removeClass("leaf-open")
|
.removeClass("leaf-open")
|
||||||
@ -165,7 +228,7 @@ TreeController = {
|
|||||||
},
|
},
|
||||||
complete: function(xhr, textStatus) {
|
complete: function(xhr, textStatus) {
|
||||||
$node.removeClass("leaf-loading");
|
$node.removeClass("leaf-loading");
|
||||||
$node.addClass("children-loaded")
|
$node.addClass("children-loaded");
|
||||||
},
|
},
|
||||||
success: function(data, textStatus, xhr) {
|
success: function(data, textStatus, xhr) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user