Error fixes

This commit is contained in:
Alejandro Gallardo Escobar 2014-12-30 16:23:31 +01:00
parent 0940008c8a
commit 39486ea9fc
2 changed files with 14 additions and 4 deletions

View File

@ -80,7 +80,9 @@ TreeController = {
none: "Total" none: "Total"
}, },
fired: { fired: {
agents: "Alert fired",
modules: "Alert fired",
none: "Alert fired"
}, },
critical: { critical: {
agents: "Critical agents", agents: "Critical agents",
@ -348,11 +350,11 @@ TreeController = {
container.append($node); container.append($node);
if (typeof element.tree != 'undefined' && element.tree.length > 0) { if (typeof element.children != 'undefined' && element.children.length > 0) {
$node.addClass("leaf-closed"); $node.addClass("leaf-closed");
// Add children // Add children
var $children = _processGroup($node, element.tree); var $children = _processGroup($node, element.children);
$node.data('children', $children); $node.data('children', $children);
$leafIcon.click(function (e) { $leafIcon.click(function (e) {
@ -395,13 +397,18 @@ TreeController = {
getChildren: 1, getChildren: 1,
id: element.id, id: element.id,
type: element.type, type: element.type,
filter: controller.filter filter: controller.filter,
childrenMethod: 'live',
countModuleStatusMethod: 'live',
countAgentStatusMethod: 'live'
}, },
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) {
data = $.parseJSON(data);
if (data.success) { if (data.success) {
if (typeof data.tree != 'undefined' && data.tree.length > 0) { if (typeof data.tree != 'undefined' && data.tree.length > 0) {

View File

@ -156,6 +156,9 @@ echo "</div>";
parameters['type'] = "<?php echo $tab; ?>"; parameters['type'] = "<?php echo $tab; ?>";
parameters['filter']['search'] = $("input#text-search").val(); parameters['filter']['search'] = $("input#text-search").val();
parameters['filter']['status'] = $("select#status").val(); parameters['filter']['status'] = $("select#status").val();
parameters['childrenMethod'] = 'live';
parameters['countModuleStatusMethod'] = 'live';
parameters['countAgentStatusMethod'] = 'live';
$.ajax({ $.ajax({
type: "POST", type: "POST",