diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index b8eaeee46c..184979b0cc 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,20 @@ +2014-02-05 Sergio Martin + + * mobile/operation/events.php + mobile/operation/tactical.php + mobile/operation/networkmap.php + mobile/operation/modules.php + mobile/operation/alerts.php + mobile/operation/networkmaps.php + mobile/operation/agents.php + mobile/include/style/main.css: A lot of improvements + on the mobile console. Simplified views, more big tapping + areas, etc. + + * include/functions_visual_map.php: Fix alert fired + module when is in warning status in builder view of + visual consoles. Incident #559 + 2014-02-04 Sergio Martin * include/functions_groups.php diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php index 16e2c49525..9056fa83fc 100644 --- a/pandora_console/include/functions_visual_map.php +++ b/pandora_console/include/functions_visual_map.php @@ -778,7 +778,7 @@ function visual_map_get_image_status_element($layoutData) { break; case 4: //Critical (ALERT) - $img .= "_bad.png"; + $img = "4" . $img . "_bad.png"; break; case 0: //Normal (OK) @@ -788,6 +788,10 @@ function visual_map_get_image_status_element($layoutData) { //Warning $img .= "_warning.png"; break; + case 10: + //Warning (ALERT) + $img = "4" . $img . "_warning.png"; + break; case 3: //Unknown default: @@ -847,7 +851,6 @@ function visual_map_get_status_element($layoutData) { $real_status = db_get_row ("tagente_estado", "id_agente_modulo", $layoutData["id_agente_modulo"]); if ($real_status['estado'] == 2) { - //This module has an alert fired and warning status $status = VISUAL_MAP_STATUS_WARNING_ALERT; } @@ -934,7 +937,6 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line io_safe_input ($layout["background"]); } else { - html_debug_print($config, true); $backgroundImage = '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . $config['homedir'] . '/images/console/background/' . @@ -1269,7 +1271,6 @@ function visual_map_print_visual_map ($id_layout, $show_links = true, $draw_line $endTagA = false; if ($show_links) { - html_debug_print($layout_data['label'], true); $url_icon = ""; if ($layout_data['id_layout_linked'] > 0) { // Link to a map diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 097dac26f3..f66fab26ff 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -505,10 +505,6 @@ table.event_details td.cell_event_name { background: #222; } -.agents_tiny_stats * { - font-size: 12px !important; -} - .agent_details { line-height: 25px; } @@ -522,6 +518,11 @@ table.event_details td.cell_event_name { float: left; } +#list_agents td:hover, #list_networkmaps td:hover, +#list_events td:hover, #list_Modules td:hover { + cursor: pointer; +} + #list_agents td { height: 35px; padding-top: 20px; @@ -584,11 +585,50 @@ table.event_details td.cell_event_name { #list_agents .cell_6 .show_collapside { display: inline !important; } + + .agents_tiny_stats * { + font-size: 12px !important; + } +} + +/* For mobiles */ +@media screen and (max-width: 750px) +{ + .agents_tiny_stats * { + font-size: 12px !important; + } +} +/* For tablets */ +@media screen and (min-width: 750px) +{ + .agents_tiny_stats * { + font-size: 17px !important; + } } /*END-----------Agents styles-----------------------------------------*/ +/*INIT-----------Alerts styles---------------------------------------*/ + +#list_alerts td { + height: 35px; + padding-top: 20px; +} + +/*END-----------Alerts styles---------------------------------------*/ + +/*INIT-----------Alerts styles---------------------------------------*/ + +#list_networkmaps td { + height: 35px; + padding-top: 20px; +} + +/*END-----------Alerts styles---------------------------------------*/ + + + /*INIT-----------Modules styles---------------------------------------*/ @media screen and (max-width: 25em) { #list_Modules .cell_1 .ui-table-cell-label, @@ -602,12 +642,6 @@ table.event_details td.cell_event_name { padding-left: 10px; } - #list_Modules .cell_3, - #list_Modules .cell_4 { - display: inline !important; - float: none !important; - } - #list_Modules .cell_0 .ui-table-cell-label, #list_Modules .cell_1 .ui-table-cell-label, #list_Modules .cell_3 .ui-table-cell-label, @@ -648,6 +682,15 @@ table.event_details td.cell_event_name { font-weight: bold; } +#list_Modules td { + height: 35px; + padding-top: 20px; +} + +#list_Modules .cell_5 img { + float: left; +} + @media screen and (max-width: 25em) { #list_Modules_Embedded .cell_1 .ui-table-cell-label, #list_Modules_Embedded .cell_4 .ui-table-cell-label { @@ -967,6 +1010,10 @@ table.tactical_bars { margin-right: 5px; } +.cell_0 { + max-width: 500px; +} + .cell_event_name { padding-bottom: 10px; font-weight: bold; diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index ec1aad60fe..d3793725ad 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -273,7 +273,7 @@ class Agents { //~ ''; $row[2] = $row[__('OS')] = ui_print_os_icon ($agent["id_os"], false, true); - $row[3] = $row[__('Group')] = ui_print_group_icon ($agent["id_grupo"], true); + $row[3] = $row[__('Group')] = ui_print_group_icon ($agent["id_grupo"], true, "groups_small", '', false); //~ $row[4] = $row[__('Interval')] = '' . //~ '' . human_time_description_raw($agent["intervalo"]) . ''; @@ -394,6 +394,7 @@ class Agents { }); load_more_rows = 1; + refresh_link_listener(); } @@ -412,6 +413,18 @@ class Agents { custom_scroll(); }); }); + + //Set link on entire row + function refresh_link_listener() { + $('#list_agents tr').click( function() { + var link = $(this).find('a').attr('href'); + if (link != undefined) { + window.location = $(this).find('a').attr('href'); + } + }); + } + + refresh_link_listener(); "); } diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index b09d4d239b..3b85ad66d7 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -259,8 +259,7 @@ class Alerts { $row = array(); if (isset($this->columns['agent']) && $this->columns['agent']) { - $row[__('Agent')] = sprintf($disabled_style, - '' . io_safe_output($alert['agent_name'])) . ''; + $row[__('Agent')] = sprintf($disabled_style, io_safe_output($alert['agent_name'])); } $row[__('Module')] = sprintf($disabled_style, io_safe_output($alert['module_name'])); diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 881be5fef3..38932d27ab 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -101,16 +101,8 @@ class Events { $status_icon = html_print_image($img_st, true); - $open_link = ''; - $close_link = ''; - - if (!$this->readOnly) { - $open_link = '
'; - $close_link = '
'; - } - $row = array(); - $row[] = $open_link . '' . __('Event Name') . '
' . io_safe_output($event['evento']) . '
' . $close_link; + $row[] = '' . __('Event Name') . '
' . io_safe_output($event['evento']) . '
'; if ($event["id_agente"] == 0) { $agent_name = __('System'); @@ -119,10 +111,8 @@ class Events { $agent_name = '' . ui_print_agent_name ($event["id_agente"], true, 'agent_small', '', false, '', '', false, false) . ''; } - $row_1 = $open_link; - $row_1 .= '' . __('Agent') . '' . $agent_name . ''; - $row_1 .= '' . $status_icon . '
' . ui_print_timestamp ($event['timestamp_rep'], true) . '
'; - $row_1 .= $close_link; + $row_1 = '' . __('Agent') . '' . $agent_name . ''; + $row_1 .= '' . $status_icon . '
' . ui_print_timestamp ($event['timestamp_rep'], true, array('units' => 'tiny')) . '
'; $row[] = $row_1; @@ -910,6 +900,18 @@ class Events { } }); } + + //Set link on entire row + function refresh_link_listener() { + $('#list_events tr').click( function() { + var link = $(this).find('a').attr('href'); + if (link != undefined) { + window.location = $(this).find('a').attr('href'); + } + }); + } + + refresh_link_listener(); "); } @@ -939,6 +941,7 @@ class Events { //$(\"table#list_events\").table().table('refresh'); load_more_rows = 1; + refresh_link_listener(); } } diff --git a/pandora_console/mobile/operation/modules.php b/pandora_console/mobile/operation/modules.php index 48f1080416..d67e09abe6 100644 --- a/pandora_console/mobile/operation/modules.php +++ b/pandora_console/mobile/operation/modules.php @@ -412,7 +412,7 @@ class Modules { if ($this->columns['agent']) { $row[1] = $row[__('Agent name')] = '' . - '' . ui_print_truncate_text($module['agent_name'], 50, false) . '' . + ui_print_truncate_text($module['agent_name'], 50, false) . ''; } if ($module['utimestamp'] == 0 && (($module['module_type'] < 21 || @@ -513,8 +513,7 @@ class Modules { '' . '' . - '' . html_print_image('images/chart_curve.png', true, array ("style" => 'vertical-align: middle;')) . '' . - ' ' . $output . '' . ''; + $output . '' . ''; if (!$ajax) { if ($this->columns['agent']) { @@ -633,6 +632,7 @@ class Modules { }); load_more_rows = 1; + refresh_link_listener() } @@ -651,6 +651,18 @@ class Modules { custom_scroll(); }); }); + + //Set link on entire row + function refresh_link_listener() { + $('#list_Modules tr').click( function() { + var link = $(this).find('a').attr('href'); + if (link != undefined) { + window.location = $(this).find('a').attr('href'); + } + }); + } + + refresh_link_listener(); "); } diff --git a/pandora_console/mobile/operation/networkmap.php b/pandora_console/mobile/operation/networkmap.php index a52dde5301..e40951ac77 100755 --- a/pandora_console/mobile/operation/networkmap.php +++ b/pandora_console/mobile/operation/networkmap.php @@ -203,7 +203,6 @@ class Networkmap { fwrite ($fh, $graph); $cmd = $filter . " -Tcmapx -o" . $filename_map." -Tpng -o".$filename_img." ".$filename_dot; $result = system ($cmd); - html_debug_print($cmd, true); fclose ($fh); //unlink ($filename_dot); } @@ -219,7 +218,7 @@ class Networkmap { return; } $ui->contentAddHtml('
'); - $ui->contentAddHtml(''); + $ui->contentAddHtml(''); $ui->contentAddHtml('
'); } else { diff --git a/pandora_console/mobile/operation/networkmaps.php b/pandora_console/mobile/operation/networkmaps.php index fe4fc7969b..d1605c7c68 100755 --- a/pandora_console/mobile/operation/networkmaps.php +++ b/pandora_console/mobile/operation/networkmaps.php @@ -192,6 +192,16 @@ class Networkmaps { $table->importFromHash($list); $ui->contentAddHtml($table->getHTML()); } + + $ui->contentAddHtml(""); } private function filterNetworkmapsGetString() { diff --git a/pandora_console/mobile/operation/tactical.php b/pandora_console/mobile/operation/tactical.php index 6ac2b22ef7..5cd9cfbf0d 100755 --- a/pandora_console/mobile/operation/tactical.php +++ b/pandora_console/mobile/operation/tactical.php @@ -68,22 +68,30 @@ class Tactical { ' . $formatted_data['server_health']['title'] . ' ' . $formatted_data['server_health']['graph'] . ' - ' . $formatted_data_untiny['server_health']['graph'] . ' + + + ' . $formatted_data_untiny['server_health']['graph'] . ' ' . $formatted_data['monitor_health']['title'] . ' ' . $formatted_data['monitor_health']['graph'] . ' - ' . $formatted_data_untiny['monitor_health']['graph'] . ' + + + ' . $formatted_data_untiny['monitor_health']['graph'] . ' ' . $formatted_data['module_sanity']['title'] . ' ' . $formatted_data['module_sanity']['graph'] . ' - ' . $formatted_data_untiny['module_sanity']['graph'] . ' + + + ' . $formatted_data_untiny['module_sanity']['graph'] . ' ' . $formatted_data['alert_level']['title'] . ' ' . $formatted_data['alert_level']['graph'] . ' - ' . $formatted_data_untiny['alert_level']['graph'] . ' + + + ' . $formatted_data_untiny['alert_level']['graph'] . ' ';