From 23bf0fbe156216a6943cda5f4f86f4c57aac82dd Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 28 May 2013 15:18:41 +0000 Subject: [PATCH] 2013-05-28 Sergio Martin * include/functions_ui.php include/functions.php include/functions_treeview.php operation/tree.php: Some aesthetic improvements on treeview, fixed some bugs and added control of the access to the agents/modules/alerts details by the user configuration flag * images/page_white_text.png images/page_white.png images/pdf.png: Some icon changes * godmode/alerts/alert_list.list.php operation/agentes/alerts_status.php operation/agentes/alerts_status.functions.php: Prepared the alerts view to be added to metaconsole git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8222 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 19 ++ .../godmode/alerts/alert_list.list.php | 2 +- pandora_console/images/page_white.png | Bin 416 -> 0 bytes pandora_console/images/page_white_text.png | Bin 487 -> 1605 bytes pandora_console/images/pdf.png | Bin 1562 -> 1617 bytes pandora_console/include/functions.php | 14 ++ .../include/functions_treeview.php | 71 ++++--- pandora_console/include/functions_ui.php | 81 +++++--- .../agentes/alerts_status.functions.php | 4 +- .../operation/agentes/alerts_status.php | 193 ++++++++++++------ pandora_console/operation/tree.php | 17 +- 11 files changed, 264 insertions(+), 137 deletions(-) delete mode 100644 pandora_console/images/page_white.png diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b3ad82a9d5..009d81ea69 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,22 @@ +2013-05-28 Sergio Martin + + * include/functions_ui.php + include/functions.php + include/functions_treeview.php + operation/tree.php: Some aesthetic improvements on + treeview, fixed some bugs and added control of the + access to the agents/modules/alerts details by the + user configuration flag + + * images/page_white_text.png + images/page_white.png + images/pdf.png: Some icon changes + + * godmode/alerts/alert_list.list.php + operation/agentes/alerts_status.php + operation/agentes/alerts_status.functions.php: Prepared the + alerts view to be added to metaconsole + 2013-05-28 Ramon Novoa * godmode/setup/performance.php: Added a new help it. diff --git a/pandora_console/godmode/alerts/alert_list.list.php b/pandora_console/godmode/alerts/alert_list.list.php index 1215c888f9..04a9059e63 100644 --- a/pandora_console/godmode/alerts/alert_list.list.php +++ b/pandora_console/godmode/alerts/alert_list.list.php @@ -314,7 +314,7 @@ else { $url = 'index.php?sec='.$sec.'&sec2=godmode/agentes/configurar_agente&pure='.$pure.'&tab=alert&id_agente=' . $id_agente; } -$table->class = 'alert_list'; +$table->class = 'alert_list databox'; $table->width = '98%'; $table->size = array (); diff --git a/pandora_console/images/page_white.png b/pandora_console/images/page_white.png deleted file mode 100644 index eda448863993df93ab48817af86e2b6cc3d0addc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 416 zcmV;R0bl-!P)EKoEv!Cds`AO&-AF z6Vyvke1)POwD@=uFKtq!C+VdRBDTGS78FdVg3Y*-CYvm=)zX1sXC^xz|ITiZnc-

pABI64AWn7K>vX1k4%68@UnLiN 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 Rhjk1<;OXk;vd$@?2>_$_MDhRt delta 735 zcmcb}GmB?K6qACpg^P)qv5T>jxuJ!jp{tRTfq|uyp{co{iHoDDiHX_dDkd42A|srN zwlO6sxS5-~85)|K7?>Lwm;ueQa5gk?wsdrLb#inCT46TXg1N3fsPkzM0|S$Xr;B4q z#jT`2|Nq-F8znGJ_Luvgeq#@#&S8#F#^7Ton34}{VPFwZ-X!V6bG+|g`i|1i_Rb*} z>ebpb_ww*$y_#`~fr;Y~qgG-^k8{Mn8bRj6n@W3p3L003D?~(y=pA87&wTChV*C1s zP7I7kI^M~$r5yive~Vmb{WbH3i4W^j9@HEB`1bYx|8LL!2QX}V&fx6c%^dbQ;go~h zp^^t%n3t~x8o!*yj)9XQ;KD3fVHz diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index c294bdfabd..1e9bddd8c2 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -95,23 +95,23 @@ function treeview_printModuleTable($id_module, $server_data = false) { $group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group); $agent_name = db_get_value('nombre', 'tagente', 'id_agente', $module['id_agente']); - // Actions table -/* - echo ''; - echo ''; - echo ''; + if (can_user_access_node ()) { + // Actions table + echo '
'; - html_print_submit_button (__('Go to modules detail'), 'upd_button', false, 'class="sub search"'); - echo '
'; + echo ''; + echo ''; - echo '
'; + html_print_submit_button (__('Go to modules detail'), 'upd_button', false, 'class="sub search"'); + echo '
'; -*/ + echo ''; + } -//id_module and id_agent hidden -echo '

'; + //id_module and id_agent hidden + echo ''; return; } @@ -142,8 +142,8 @@ function treeview_printAlertsTable($id_module, $server_data = array()) { } echo '
'; - echo ''; - echo ''; + echo '
'.$module_name.'
'; + echo ''; echo ''; echo ''; @@ -171,13 +171,15 @@ function treeview_printAlertsTable($id_module, $server_data = array()) { } echo '
' . html_print_image('images/bell.png', true) . ' ' . $module_name . '
'.__('Template').''.__('Actions').'
'; - // Actions table - echo ''; - echo ''; - echo ''; - echo '
'; - html_print_submit_button (__('Go to alerts detail'), 'upd_button', false, 'class="sub search"'); - echo '
'; + if(can_user_access_node ()) { + // Actions table + echo ''; + echo ''; + echo ''; + echo '
'; + html_print_submit_button (__('Go to alerts detail'), 'upd_button', false, 'class="sub search"'); + echo '
'; + } } function treeview_printTable($id_agente, $server_data = array()) { @@ -223,7 +225,7 @@ function treeview_printTable($id_agente, $server_data = array()) { } echo '
'; - echo ''; + echo '
'; //Agent name echo ''; if ($agent['disabled']) { @@ -357,17 +359,14 @@ function treeview_printTable($id_agente, $server_data = array()) { echo ''; - echo '
'.__('Agent name').'
'; - - // If user has access to normal console -/* - echo ''; - echo ''; -*/ - - echo '
'; - html_print_submit_button (__('Go to agent detail'), 'upd_button', false, 'class="sub search"'); - echo '
'; + if (can_user_access_node ()) { + echo ''; + echo ''; + echo ''; + echo '
'; + html_print_submit_button (__('Go to agent detail'), 'upd_button', false, 'class="sub search"'); + echo '
'; + } return; } diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index bd096540b8..35385192b6 100644 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -663,7 +663,7 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f global $config; $actionText = ""; - require_once ("include/functions_alerts.php"); + require_once ($config['homedir'] . "/include/functions_alerts.php"); $isFunctionPolicies = enterprise_include_once ('include/functions_policies.php'); $id_group = (int) get_parameter ("ag_group", 0); //0 is the All group (selects all groups) @@ -718,16 +718,18 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $data = array (); - if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { - $policyInfo = policies_is_alert_in_policy2($alert['id'], false); - if ($policyInfo === false) - $data[$index['policy']] = ''; - else { - $img = 'images/policies.png'; - - $data[$index['policy']] = '' . - html_print_image($img,true, array('title' => $policyInfo['name'])) . - ''; + if (!defined('METACONSOLE')) { + if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { + $policyInfo = policies_is_alert_in_policy2($alert['id'], false); + if ($policyInfo === false) + $data[$index['policy']] = ''; + else { + $img = 'images/policies.png'; + + $data[$index['policy']] = '' . + html_print_image($img,true, array('title' => $policyInfo['name'])) . + ''; + } } } @@ -737,37 +739,50 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $data[$index['standby']] = html_print_image ('images/bell_pause.png', true, array('title' => __('Standby on'))); } - // Force alert execution - $data[$index['force_execution']] = ''; - if ($alert["force_execution"] == 0) { - $data[$index['force_execution']] = - '' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . ''; - } - else { - $data[$index['force_execution']] = - '' . html_print_image("images/refresh.png", true) . ''; + if (!defined('METACONSOLE')) { + // Force alert execution + $data[$index['force_execution']] = ''; + if ($alert["force_execution"] == 0) { + $data[$index['force_execution']] = + '' . html_print_image("images/target.png", true, array("border" => '0', "title" => __('Force'))) . ''; + } + else { + $data[$index['force_execution']] = + '' . html_print_image("images/refresh.png", true) . ''; + } } - + $data[$index['agent_name']] = $disabledHtmlStart; if ($agent == 0) { $data[$index['module_name']] .= - ui_print_truncate_text(modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt'); + ui_print_truncate_text(isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt'); } else { - if ($agent_style !== false) { - $data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled . " $agent_style"); + if (defined('METACONSOLE')) { + $data[$index['agent_name']] .= $alert['agent_name']; } else { - $data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled); + if ($agent_style !== false) { + $data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled . " $agent_style"); + } + else { + $data[$index['agent_name']] .= ui_print_agent_name (modules_get_agentmodule_agent ($alert["id_agent_module"]), true, 20, $styleDisabled); + } } $data[$index['module_name']] = - ui_print_truncate_text (modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt'); + ui_print_truncate_text (isset($alert['agent_module_name']) ? $alert['agent_module_name'] : modules_get_agentmodule_name ($alert["id_agent_module"]), 'module_small', false, true, true, '[…]', 'font-size: 7.2pt'); } + $data[$index['agent_name']] .= $disabledHtmlEnd; $data[$index['description']] = ''; - $data[$index['template']] .= ''; + if (defined('METACONSOLE')) { + $data[$index['template']] .= ''; + } + else { + $data[$index['template']] .= ''; + } $data[$index['template']] .= html_print_image ('images/zoom.png', true); $data[$index['template']] .= ' '; $actionDefault = db_get_value_sql("SELECT id_alert_action @@ -818,11 +833,13 @@ function ui_format_alert_row ($alert, $agent = true, $url = '', $agent_style = f $data[$index['status']] = ui_print_status_image($status, $title, true); - if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { - $data[$index['validate']] = ''; - - - $data[$index['validate']] .= html_print_checkbox ("validate[]", $alert["id"], false, true); + if (!defined('METACONSOLE')) { + if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { + $data[$index['validate']] = ''; + + + $data[$index['validate']] .= html_print_checkbox ("validate[]", $alert["id"], false, true); + } } return $data; diff --git a/pandora_console/operation/agentes/alerts_status.functions.php b/pandora_console/operation/agentes/alerts_status.functions.php index 4bb3ae3182..d60cbb1379 100755 --- a/pandora_console/operation/agentes/alerts_status.functions.php +++ b/pandora_console/operation/agentes/alerts_status.functions.php @@ -35,7 +35,7 @@ function validateAlert() { } function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby = false, $return = false) { - $table->width = '90%'; + $table->width = '100%'; $table->data = array (); $table->style = array (); @@ -64,7 +64,7 @@ function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_st $table->data[1][1] = html_print_input_text('free_search', $free_search, '', 20, 40, true); $table->data[1][2] = __('Standby'); $table->data[1][3] = html_print_select ($alert_standby, "filter_standby", $filter_standby, '', '', '', true); - $table->data[1][4] = html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub search"', true); + $table->data[1][4] = html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true); $data = '
'; $data .= html_print_table ($table, true); diff --git a/pandora_console/operation/agentes/alerts_status.php b/pandora_console/operation/agentes/alerts_status.php index fa58d06fd9..f2bc9b431c 100644 --- a/pandora_console/operation/agentes/alerts_status.php +++ b/pandora_console/operation/agentes/alerts_status.php @@ -32,9 +32,9 @@ if (is_ajax()) { return; } -require_once ("include/functions_agents.php"); -require_once ('operation/agentes/alerts_status.functions.php'); -require_once ('include/functions_users.php'); +require_once ($config['homedir'] . "/include/functions_agents.php"); +require_once ($config['homedir'] . '/operation/agentes/alerts_status.functions.php'); +require_once ($config['homedir'] . '/include/functions_users.php'); $isFunctionPolicies = enterprise_include_once ('include/functions_policies.php'); @@ -64,6 +64,7 @@ if ($flag_alert == 1 && check_acl($config['id_user'], $id_group, "AW")) { forceExecution($id_group); } + $idAgent = get_parameter_get('id_agente', 0); // Show alerts for specific agent @@ -103,7 +104,12 @@ else { $print_agent = true; - ui_print_page_header (__('Alert detail'), "images/op_alerts.png", false, "alert_validation"); + if (!defined('METACONSOLE')) { + ui_print_page_header (__('Alert detail'), "images/op_alerts.png", false, "alert_validation"); + } + else { + ui_meta_print_header(__("Alerts view")); + } } if ($alert_validate) { @@ -115,6 +121,8 @@ if ($alert_validate) { } } +enterprise_hook('open_meta_frame'); + if ($free_search != '') { switch ($config["dbtype"]) { case "mysql": @@ -256,8 +264,16 @@ else { $filter_alert['disabled'] = $filter; } -$alerts['alerts_simple'] = agents_get_alerts_simple ($agents, - $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup); +if (defined('METACONSOLE')) { + require_once ($config['homedir'] . '/enterprise/meta/include/functions_alerts_meta.php'); + + $alerts['alerts_simple'] = alerts_meta_get_alerts ($agents, + $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup); +} +else { + $alerts['alerts_simple'] = agents_get_alerts_simple ($agents, + $filter_alert, $options_simple, $whereAlertSimple, false, false, $idGroup); +} $countAlertsSimple = agents_get_alerts_simple ($agents, $filter_alert, false, $whereAlertSimple, false, false, $idGroup, true); @@ -268,6 +284,7 @@ if ($tab != null) { // Filter form if ($print_agent) { + echo '
'; ui_toggle(printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby, true),__('Alert control filter'), __('Toggle filter(s)')); } @@ -280,89 +297,140 @@ $table->align = array (); if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK) { if ($print_agent) { - $table->head[0] = "" . __('P.') . ""; + if (!defined('METACONSOLE')) { + $table->head[0] = "" . __('P.') . ""; + } + $table->head[1] = "" . __('S.') . ""; - $table->head[2] = "" . __('F.') . ""; - $table->head[3] = __('Agent') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . ''; - $table->head[4] = __('Module') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" =>$selectModuleUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; - $table->head[5] = __('Template') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" =>$selectTemplateUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + + if (!defined('METACONSOLE')) { + $table->head[2] = "" . __('F.') . ""; + } + + $table->head[3] = __('Agent'); + $table->head[4] = __('Module'); + $table->head[5] = __('Template'); $table->head[6] = __('Action'); $table->head[7] = __('Last fired'); $table->head[8] = __('Status'); - if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { - $table->head[9] = __('Validate'); + if (!defined('METACONSOLE')) { + if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { + $table->head[9] = __('Validate'); + $table->align[9] = 'center'; + } } + $table->align[8] = 'center'; - $table->align[9] = 'center'; + + // Sort buttons are only for normal console + if (!defined('METACONSOLE')) { + $table->head[3] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . ''; + $table->head[4] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" =>$selectModuleUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; + $table->head[5] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" =>$selectTemplateUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + } } else { + if (!defined('METACONSOLE')) { + $table->head[0] = "" . __('P.') . ""; + } - $table->head[0] = "" . __('P.') . ""; $table->head[1] = "" . __('S.') . ""; - $table->head[2] = "" . __('F.') . ""; - $table->head[3] = __('Module') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; - $table->head[4] = __('Template') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + + if (!defined('METACONSOLE')) { + $table->head[2] = "" . __('F.') . ""; + } + + $table->head[3] = __('Module'); + $table->head[4] = __('Template'); $table->head[5] = __('Action'); $table->head[6] = __('Last fired'); $table->head[7] = __('Status'); - if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { - $table->head[8] = __('Validate'); + if (!defined('METACONSOLE')) { + if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { + $table->head[8] = __('Validate'); + $table->align[8] = 'center'; + } } $table->align[7] = 'center'; - $table->align[8] = 'center'; + + // Sort buttons are only for normal console + if (!defined('METACONSOLE')) { + $table->head[3] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; + $table->head[4] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + } } } else { if ($print_agent) { - $table->head[0] = "" . __('S.') . ""; - $table->head[1] = "" . __('F.') . ""; - $table->head[2] = __('Agent') . ' ' . - ''. html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . ''; - $table->head[3] = __('Module') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; - $table->head[4] = __('Template') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + if (!defined('METACONSOLE')) { + $table->head[1] = "" . __('F.') . ""; + } + $table->head[2] = __('Agent'); + $table->head[3] = __('Module'); + $table->head[4] = __('Template'); $table->head[5] = __('Action'); $table->head[6] = __('Last fired'); $table->head[7] = __('Status'); - if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { - $table->head[8] = __('Validate'); + if (!defined('METACONSOLE')) { + if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { + $table->head[8] = __('Validate'); + $table->align[8] = 'center'; + } } $table->align[7] = 'center'; - $table->align[8] = 'center'; + + // Sort buttons are only for normal console + if (!defined('METACONSOLE')) { + $table->head[2] .= ' ' . + ''. html_print_image("images/sort_up.png", true, array("style" => $selectAgentUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectAgentDown)) . ''; + $table->head[3] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; + $table->head[4] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + } } else { $table->head[0] = "" . __('S.') . ""; - $table->head[1] = "" . __('F.') . ""; - $table->head[2] = __('Module') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; - $table->head[3] = __('Template') . ' ' . - '' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '' . - '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + if (!defined('METACONSOLE')) { + $table->head[1] = "" . __('F.') . ""; + } + $table->head[2] = __('Module'); + $table->head[3] = __('Template'); $table->head[4] = __('Action'); $table->head[5] = __('Last fired'); $table->head[6] = __('Status'); - if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { - $table->head[7] = __('Validate'); + if (!defined('METACONSOLE')) { + if (check_acl ($config["id_user"], $id_group, "LW") || check_acl ($config["id_user"], $id_group, "LM")) { + $table->head[7] = __('Validate'); + $table->align[7] = 'center'; + } } $table->align[6] = 'center'; - $table->align[7] = 'center'; + + // Sort buttons are only for normal console + if (!defined('METACONSOLE')) { + $table->head[2] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectModuleUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectModuleDown)) . ''; + $table->head[3] .= ' ' . + '' . html_print_image("images/sort_up.png", true, array("style" => $selectTemplateUp)) . '' . + '' . html_print_image("images/sort_down.png", true, array("style" => $selectTemplateDown)) . ''; + } } } @@ -386,11 +454,13 @@ if (!empty ($table->data)) { ui_pagination ($countAlertsSimple, $url, $offset_simple, 0, false, 'offset_simple'); html_print_table ($table); - if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) { - if (count($alerts['alerts_simple']) > 0) { - echo '
'; - html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub ok"', false); - echo '
'; + if (!defined('METACONSOLE')) { + if (check_acl ($config["id_user"], $id_group, "AW") || check_acl ($config["id_user"], $id_group, "AM")) { + if (count($alerts['alerts_simple']) > 0) { + echo '
'; + html_print_submit_button (__('Validate'), 'alert_validate', false, 'class="sub ok"', false); + echo '
'; + } } } @@ -400,6 +470,9 @@ else { echo '
'.__('No alerts found').'
'; } +enterprise_hook('close_meta_frame'); + + ui_require_css_file('cluetip'); ui_require_jquery_file('cluetip'); ?> diff --git a/pandora_console/operation/tree.php b/pandora_console/operation/tree.php index e96610eea3..d23d08435b 100644 --- a/pandora_console/operation/tree.php +++ b/pandora_console/operation/tree.php @@ -183,10 +183,12 @@ if (is_ajax ()) $agent_info["monitor_warning"] = $row["warning_count"]; $agent_info["monitor_unknown"] = $row["unknown_count"]; $agent_info["monitor_normal"] = $row["normal_count"]; + $agent_info["monitor_notinit"] = $row["notinit_count"]; $agent_info["modules"] = $row["total_count"]; $agent_info["alert_img"] = agents_tree_view_alert_img ($agent_info["monitor_alertsfired"]); - $agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"], $agent_info["monitor_warning"], $agent_info["monitor_unknown"]); + $agent_info["status_img"] = agents_tree_view_status_img ($agent_info["monitor_critical"], $agent_info["monitor_warning"], $agent_info["monitor_unknown"]. + $agent_info["modules"], $agent_info["monitor_notinit"]); // Filter by status (only in policy view) if ($type == 'policies') { @@ -459,15 +461,15 @@ if (is_ajax ()) $data = "".substr(io_safe_output($row["datos"]),0,12).""; echo ""; + if ($row['utimestamp'] != '') { + ui_print_help_tip ($row["timestamp"], '', 'images/clock2.png'); + echo " "; + } echo $data; if ($row['unit'] != '') { echo " "; echo '('.$row['unit'].')'; } - if ($row['utimestamp'] != '') { - echo " "; - ui_print_help_tip ($row["timestamp"], '', 'images/clock2.png'); - } echo ""; } echo "\n"; @@ -776,6 +778,7 @@ enterprise_hook('close_meta_frame'); data: "page=&printTable=1&id_agente=" + id_agent + "&server_name=" + server_name, success: function(data) { $('#cont').html(data); + forced_title_callback(); } }); @@ -789,6 +792,7 @@ enterprise_hook('close_meta_frame'); data: "page=&printAlertsTable=1&id_module=" + id_module + "&server_name=" + server_name, success: function(data) { $('#cont').html(data); + forced_title_callback(); } }); } @@ -800,6 +804,7 @@ enterprise_hook('close_meta_frame'); data: "page=&printModuleTable=1&id_module=" + id_module + "&server_name=" + server_name, success: function(data) { $('#cont').html(data); + forced_title_callback(); } }); } @@ -831,7 +836,7 @@ enterprise_hook('close_meta_frame'); }) .show (); refresh_pagination_callback (module_id, id_agent, server_name); - + forced_title_callback(); } }); }