From 35e02a902836d21b503b341632aa0224b8c92af9 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 5 Apr 2013 10:49:38 +0000 Subject: [PATCH] 2013-04-05 Miguel de Dios * mobile/operation/agents.php, mobile/operation/tactical.php, mobile/operation/home.php, mobile/include/style/main.css, include/functions_html.php, include/functions_reporting.php: some fixes and improves in the mobile console. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7933 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 7 ++ pandora_console/include/functions_html.php | 2 +- .../include/functions_reporting.php | 45 +++++--- pandora_console/mobile/include/style/main.css | 10 ++ pandora_console/mobile/operation/agents.php | 4 +- pandora_console/mobile/operation/home.php | 105 ++---------------- pandora_console/mobile/operation/tactical.php | 33 +++++- 7 files changed, 91 insertions(+), 115 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 64d8cdae45..3fbacfe77b 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,10 @@ +2013-04-05 Miguel de Dios + + * mobile/operation/agents.php, mobile/operation/tactical.php, + mobile/operation/home.php, mobile/include/style/main.css, + include/functions_html.php, include/functions_reporting.php: some + fixes and improves in the mobile console. + 2013-04-05 Junichi Satoh * include/help/ja/help_recontask.php: Updated help. diff --git a/pandora_console/include/functions_html.php b/pandora_console/include/functions_html.php index 5a7dced873..6af3d31f65 100644 --- a/pandora_console/include/functions_html.php +++ b/pandora_console/include/functions_html.php @@ -1177,7 +1177,7 @@ function html_get_predefined_table ($model = 'transparent', $columns = 4) { $table->style = array_fill(0, 4, 'text-align:center; width: ' . $width_percent . '%;'); $table->width = "100%"; } - + return $table; } diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 66d767ad5d..96f44e8bcc 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -983,24 +983,35 @@ function reporting_get_stats_servers($tiny = true) { return $output; } -function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150) { +function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_height = 150, $links = false) { global $config; // Link URLS - $urls = array(); - $urls['monitor_critical'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2"; - $urls['monitor_warning'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1"; - $urls['monitor_ok'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0"; - $urls['monitor_unknown'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=3"; - $urls['monitor_not_init'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=5"; - + if ($links === false) { + $urls = array(); + $urls['monitor_critical'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=2"; + $urls['monitor_warning'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=1"; + $urls['monitor_ok'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=0"; + $urls['monitor_unknown'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=3"; + $urls['monitor_not_init'] = "index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=60&status=5"; + } + else { + $urls = array(); + $urls['monitor_critical'] = $links['monitor_critical']; + $urls['monitor_warning'] = $links['monitor_warning']; + $urls['monitor_ok'] = $links['monitor_ok']; + $urls['monitor_unknown'] = $links['monitor_unknown']; + $urls['monitor_not_init'] = $links['monitor_not_init']; + } + // Modules by status table $table_mbs = html_get_predefined_table(); - + $table_mbs->class = "tactical_monitors"; + $table_mbs->style[0] = $table_mbs->style[2] = 'text-align: right; padding-right: 3px;'; $table_mbs->style[1] = $table_mbs->style[3] = 'text-align: left; padding-left: 3px;'; - - if($data["monitor_checks"] > 0) { + + if ($data["monitor_checks"] > 0) { $tdata = array(); $table_mbs->colspan[count($table_mbs->data)][0] = 4; $table_mbs->cellstyle[count($table_mbs->data)][0] = 'text-align: center;'; @@ -1014,33 +1025,33 @@ function reporting_get_stats_modules_status($data, $graph_width = 250, $graph_he $tdata[0] = html_print_image('images/status_sets/default/agent_critical_ball.png', true, array('title' => __('Monitor critical'), 'width' => '20px')); $tdata[1] = $data["monitor_critical"] <= 0 ? '-' : $data["monitor_critical"]; $tdata[1] = '' . $tdata[1] . ''; - + $tdata[2] = html_print_image('images/status_sets/default/agent_warning_ball.png', true, array('title' => __('Monitor warning'), 'width' => '20px')); $tdata[3] = $data["monitor_warning"] <= 0 ? '-' : $data["monitor_warning"]; $tdata[3] = '' . $tdata[3] . ''; $table_mbs->rowclass[] = ''; $table_mbs->data[] = $tdata; - + $tdata = array(); $tdata[0] = html_print_image('images/status_sets/default/agent_ok_ball.png', true, array('title' => __('Monitor normal'), 'width' => '20px')); $tdata[1] = $data["monitor_ok"] <= 0 ? '-' : $data["monitor_ok"]; $tdata[1] = '' . $tdata[1] . ''; - + $tdata[2] = html_print_image('images/status_sets/default/agent_no_monitors_ball.png', true, array('title' => __('Monitor unknown'), 'width' => '20px')); $tdata[3] = $data["monitor_unknown"] <= 0 ? '-' : $data["monitor_unknown"]; $tdata[3] = '' . $tdata[3] . ''; $table_mbs->rowclass[] = ''; $table_mbs->data[] = $tdata; - + $tdata = array(); $tdata[0] = html_print_image('images/status_sets/default/agent_no_data_ball.png', true, array('title' => __('Monitor not init'), 'width' => '20px')); $tdata[1] = $data["monitor_not_init"] <= 0 ? '-' : $data["monitor_not_init"]; $tdata[1] = '' . $tdata[1] . ''; - + $tdata[2] = $tdata[3] = ''; $table_mbs->rowclass[] = ''; $table_mbs->data[] = $tdata; - + $output = '
' . __('Monitors by status') . diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index bda701673a..f96aa7654c 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -22,10 +22,20 @@ label, input, .ui-btn-inner { font-size: 12px !important; } + + +/*INIT----------Tactical styles-----------------------------------------*/ #tactical * { font-size: 14px !important; } +#tactical a { + font-size: 25px !important; +} +/*END-----------Tactical styles-----------------------------------------*/ + + + /*INIT----------Groups styles-----------------------------------------*/ .group_view tr { border-bottom: 3px solid white !important; diff --git a/pandora_console/mobile/operation/agents.php b/pandora_console/mobile/operation/agents.php index 68d9d68199..788be314bc 100644 --- a/pandora_console/mobile/operation/agents.php +++ b/pandora_console/mobile/operation/agents.php @@ -82,9 +82,9 @@ class Agents { __('Alerts') . '' . $agent[7]; $agent[8] = '' . __('Last contact') . '' . $agent[8]; + + $agents[$key] = $agent; } - - $agents[$key] = $agent; } echo json_encode(array('end' => $end, 'agents' => $agents)); diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php index e80ea75229..7cceb38be5 100644 --- a/pandora_console/mobile/operation/home.php +++ b/pandora_console/mobile/operation/home.php @@ -30,9 +30,9 @@ class Home { $ui->createDefaultHeader(__("PandoraFMS: Home")); $ui->showFooter(false); $ui->beginContent(); - $ui->beginForm(); + $ui->beginForm("index.php?page=agents"); $options = array( - 'name' => 'global_search', + 'name' => 'free_search', 'value' => $this->global_search, 'placeholder' => __('Global search') ); @@ -60,97 +60,16 @@ class Home { 'text' => __('Alerts'), 'href' => 'index.php?page=alerts'); $ui->contentAddHtml($ui->createButton($options)); - //~ - //~ $ui->contentAddHtml(' - //~ - //~
- //~ - //~
- //~
- //~

Apple schedules iPad Mini event for October 23

- //~

One of the worst-kept secrets in tech has been confirmed: Apple will hold an event October 23 in San Jose, California, at which the company is widely expected to unveil a smaller, cheaper version of its popular iPad called "Mini".

- //~
- //~
- //~ - //~
- //~
- //~

Microsoft Surface tablet goes on sale for $499

- //~

The Microsoft Surface tablet picture has come into focus. The Redmond giant filled in the blanks on the new tablets availability and specs.

- //~
- //~
- //~ - //~
- //~
- //~

AOL unveils Alto, an email service that syncs 5 accounts

- //~

AOL, struggling to shed its outdated image, is reimagining one of the most visibly aging parts of its platform: Its email service.

- //~
- //~
-//~
'); - + $options = array('icon' => 'grid', + 'pos' => 'right', + 'text' => __('Agents'), + 'href' => 'index.php?page=agents'); + $ui->contentAddHtml($ui->createButton($options)); + $options = array('icon' => 'check', + 'pos' => 'right', + 'text' => __('Modules'), + 'href' => 'index.php?page=modules'); + $ui->contentAddHtml($ui->createButton($options)); $ui->endContent(); $ui->showPage(); return; diff --git a/pandora_console/mobile/operation/tactical.php b/pandora_console/mobile/operation/tactical.php index ee01a85f07..ec9355d68b 100755 --- a/pandora_console/mobile/operation/tactical.php +++ b/pandora_console/mobile/operation/tactical.php @@ -62,19 +62,22 @@ class Tactical { $data = reporting_get_group_stats(); $data['mobile'] = true; - $formatted_data = reporting_get_stats_indicators($data, 280, 20, false); + $formatted_data = reporting_get_stats_indicators($data, 200, 10, false); + /* $overview = '
' . $formatted_data['server_health']['title'] . '' . $formatted_data['server_health']['graph'] . '
' . + '
' . $formatted_data['monitor_health']['title'] . '' . $formatted_data['monitor_health']['graph'] . '
' . + '
' . '
' . @@ -89,11 +92,37 @@ class Tactical { '' . $formatted_data['alert_level']['graph'] . '
'; + */ + $overview = ' + + + + + + + + + + + + + + + + +
' . $formatted_data['server_health']['title'] . '' . $formatted_data['server_health']['graph'] . '
' . $formatted_data['monitor_health']['title'] . '' . $formatted_data['monitor_health']['graph'] . '
' . $formatted_data['module_sanity']['title'] . '' . $formatted_data['module_sanity']['graph'] . '
' . $formatted_data['alert_level']['title'] . '' . $formatted_data['alert_level']['graph'] . '
'; + $ui->contentGridAddCell($overview); $formatted_data = reporting_get_stats_alerts($data); ob_start(); - $formatted_data .= reporting_get_stats_modules_status($data) . "
\n" . + $links = array(); + $links['monitor_critical'] = "index.php?page=modules&status=1"; + $links['monitor_warning'] = "index.php?page=modules&status=2"; + $links['monitor_ok'] = "index.php?page=modules&status=0"; + $links['monitor_unknown'] = "index.php?page=modules&status=3"; + $links['monitor_not_init'] = "index.php?page=modules&status=5"; + $formatted_data .= reporting_get_stats_modules_status($data, 250, 150, $links) . "
\n" . reporting_get_stats_agents_monitors($data); $graph_js = ob_get_clean(); $formatted_data = $graph_js . $formatted_data;