Now the the items detail is returned correctly

This commit is contained in:
Alejandro Gallardo Escobar 2015-01-29 20:53:00 +01:00
parent 42b8b97f82
commit 3b449f3789
1 changed files with 21 additions and 20 deletions

View File

@ -27,7 +27,7 @@ if (is_ajax ()) {
$getChildren = (bool) get_parameter('getChildren', 0); $getChildren = (bool) get_parameter('getChildren', 0);
$getGroupStatus = (bool) get_parameter('getGroupStatus', 0); $getGroupStatus = (bool) get_parameter('getGroupStatus', 0);
$get_detail = (bool) get_parameter('getDetail'); $getDetail = (bool) get_parameter('getDetail');
if ($getChildren) { if ($getChildren) {
$type = get_parameter('type', 'group'); $type = get_parameter('type', 'group');
@ -82,35 +82,36 @@ if (is_ajax ()) {
return; return;
} }
if ($get_detail) { if ($getDetail) {
require_once($config['homedir']."/include/functions_treeview.php"); require_once($config['homedir']."/include/functions_treeview.php");
// Clean the output
ob_clean();
$id = (int) get_parameter('id'); $id = (int) get_parameter('id');
$type = (string) get_parameter('type'); $type = (string) get_parameter('type');
$server = array(); $server = array();
if (defined ('METACONSOLE')) { if (defined ('METACONSOLE')) {
$server_name = (string) get_parameter('server'); $server_id = (int) get_parameter('serverID');
$server = metaconsole_get_connection($server_name); $server = metaconsole_get_servers($server_id);
metaconsole_connect($server); metaconsole_connect($server);
} }
switch ($type) { ob_clean();
case 'agent':
treeview_printTable($id, $server); if (!empty($id) && !empty($type)) {
break; switch ($type) {
case 'module': case 'agent':
treeview_printModuleTable($id, $server); treeview_printTable($id, $server);
break; break;
case 'alert': case 'module':
treeview_printAlertsTable($id, $server); treeview_printModuleTable($id, $server);
break; break;
default: case 'alert':
// Nothing treeview_printAlertsTable($id, $server);
break; break;
default:
// Nothing
break;
}
} }
if (!empty($server) && defined ('METACONSOLE')) { if (!empty($server) && defined ('METACONSOLE')) {