diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 16c3ad3673..bca8b158c1 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,17 @@ +2013-11-27 Sergio Martin + + * images/hourglass_dark.png + images/star_white.png + images/star_dark.png + images/hourglass_white.png + images/tick_dark.png + images/tick_white.png + mobile/include/style/main.css + mobile/operation/agent.php + mobile/operation/events.php: Improvements in event + viewer of mobile console after fix some conflictive + code + 2013-11-27 Junichi Satoh * include/functions_modules.php: Fixed that some multibyte characters diff --git a/pandora_console/images/hourglass_dark.png b/pandora_console/images/hourglass_dark.png new file mode 100644 index 0000000000..2a55fdb5e4 Binary files /dev/null and b/pandora_console/images/hourglass_dark.png differ diff --git a/pandora_console/images/hourglass_white.png b/pandora_console/images/hourglass_white.png new file mode 100644 index 0000000000..855f229772 Binary files /dev/null and b/pandora_console/images/hourglass_white.png differ diff --git a/pandora_console/images/star_dark.png b/pandora_console/images/star_dark.png new file mode 100644 index 0000000000..55ed22e12b Binary files /dev/null and b/pandora_console/images/star_dark.png differ diff --git a/pandora_console/images/star_white.png b/pandora_console/images/star_white.png new file mode 100644 index 0000000000..b452c098e3 Binary files /dev/null and b/pandora_console/images/star_white.png differ diff --git a/pandora_console/images/tick_dark.png b/pandora_console/images/tick_dark.png new file mode 100644 index 0000000000..a90181c794 Binary files /dev/null and b/pandora_console/images/tick_dark.png differ diff --git a/pandora_console/images/tick_white.png b/pandora_console/images/tick_white.png new file mode 100644 index 0000000000..cd836bd779 Binary files /dev/null and b/pandora_console/images/tick_white.png differ diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index e2237cf608..26171bd9de 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -730,13 +730,9 @@ li.ui-btn { height: 28px !important; } -.events td { - min-height: 35px; -} - @media screen and (max-width: 25em) { - .events .cell_3, .events .button_row { + .events .status_row { display: none; } @@ -744,6 +740,10 @@ li.ui-btn { width: 87%; float: left; } + + .events_agent { + min-width: 50%; + } } @media screen and (min-width: 25em) @@ -755,6 +755,15 @@ li.ui-btn { .events td { height: 35px; } + + .events_agent { + float: left; + margin-right: 15px; + } +} + +.events .cell_0 img { + margin-right: 5px; } .cell_event_name { @@ -770,3 +779,18 @@ li.ui-btn { span.nobold * { font-weight: normal; } + +.events_timestamp { + font-size: 10px; + float: right; + text-align: right; + line-height: 1.1em; +} + +.events_agent { + float: left; +} + +.events_agent b.ui-table-cell-label { + display: block !important; +} diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index 1f8f22a2e5..b201edec79 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -164,4 +164,4 @@ class Agent { $ui->endContent(); $ui->showPage(); } -} \ No newline at end of file +} diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index a2c46a1f18..9acc219d58 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -73,63 +73,48 @@ class Events { foreach ($events_db as $event) { $end = 0; - $details_button = ''; + switch ($event['estado']) { + case 0: + $img_st = "images/star_white.png"; + break; + case 1: + $img_st = "images/tick_white.png"; + break; + case 2: + $img_st = "images/hourglass_white.png"; + break; + } + + if($event['criticity'] == EVENT_CRIT_WARNING) { + $img_st = str_replace("white.png", "dark.png", $img_st); + } + + $status_icon = html_print_image($img_st, true); + $open_link = ''; $close_link = ''; - if (!$this->readOnly) { - /* - $details_button = '' . - ' -   - ' . - ''; - */ - + if (!$this->readOnly) { $open_link = '
'; $close_link = '
'; } $row = array(); - $row[] = $open_link . '' . __('Event Name') . '' . io_safe_output($event['evento']) . $details_button . $close_link; - - /* - switch ($event['estado']) { - case 0: - $img_st = "images/star.png"; - $title_st = __('New event'); - break; - case 1: - $img_st = "images/tick.png"; - $title_st = __('Event validated'); - break; - case 2: - $img_st = "images/hourglass.png"; - $title_st = __('Event in process'); - break; - } - $row[] = html_print_image ($img_st, true, - array ("class" => "image_status", - "width" => 16, - "height" => 16, - "title" => $title_st, - "id" => 'status_img_' . $event["id_evento"])); - */ - - $row[] = $open_link . '' . __('Timestamp') . '' . - ui_print_timestamp ($event['timestamp_rep'], true) . $close_link; - + $row[] = $open_link . '' . __('Event Name') . '' . io_safe_output($event['evento']) . $close_link; + if ($event["id_agente"] == 0) { $agent_name = __('System'); } else { - $agent_name = '' . ui_print_agent_name ($event["id_agente"], true, 'agent_medium', '', false, '', '', false, false) . ''; + $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[] = $open_link . '' . __('Agent') . '' . - $agent_name . $close_link; - - $row[] = $details_button; + $row[] = $row_1; $row[] = get_priority_class ($event["criticity"]); $events[$event['id_evento']] = $row; @@ -513,7 +498,7 @@ class Events { $ui->addDialog($options); - $ui->createDefaultHeader(__("PandoraFMS: Events"), + $ui->createDefaultHeader(__("Events"), $ui->createHeaderButton( array('icon' => 'back', 'pos' => 'left', @@ -726,77 +711,8 @@ class Events { $events_db = $listEvents['events']; $total_events = $listEvents['total']; - if (empty($events_db)) - $events_db = array(); - - $events = array(); - $field_event_name = __('Event Name'); - $field_timestamp = __('Timestamp'); - $field_agent = __('Agent'); - - $row_class = array(); - foreach ($events_db as $event) { - $myclass = get_priority_class ($event["criticity"]); - - $details_button = ''; - $open_link = ''; - $close_link = ''; - - if (!$this->readOnly) { - /* - $details_button = '' . - ' -   - ' . - ''; - */ - - $open_link = '
'; - $close_link = '
'; - } - - $row_class[$event['id_evento']] = "events $myclass"; - - $row = array(); - $row[$field_event_name] = $open_link . io_safe_output($event['evento']) . $details_button . $close_link; - /* - switch ($event['estado']) { - case 0: - $img_st = "images/star.png"; - $title_st = __('New event'); - break; - case 1: - $img_st = "images/tick.png"; - $title_st = __('Event validated'); - break; - case 2: - $img_st = "images/hourglass.png"; - $title_st = __('Event in process'); - break; - } - */ - - $row[$field_timestamp] = $open_link . ui_print_timestamp ($event['timestamp_rep'], true) . $close_link; - - if ($event["id_agente"] == 0) { - $agent_name = __('System'); - } - else { - $agent_name = '' . ui_print_agent_name ($event["id_agente"], true, 'agent_medium', '', false, '', '', false, false) . ''; - } - - if ($this->columns['agent']) { - $row[$field_agent] = $open_link . $agent_name . $close_link; - } - - - $row[' '] = $details_button; - - $events[$event['id_evento']] = $row; - } - $ui = Ui::getInstance(); - if (empty($events)) { + if (empty($events_db)) { if (!$return) { $ui->contentAddHtml('

' . __('No events') . '

'); } @@ -805,22 +721,19 @@ class Events { } } else { + // Create an empty table to be filled from ajax $table = new Table(); $table->id = 'list_events'; - $table->setRowClass($row_class); - $table->importFromHash($events); if (!$return) { $ui->contentAddHtml($table->getHTML()); - if ($system->getPageSize() < $total_events) { - $ui->contentAddHtml('
' . - html_print_image('images/spinner.gif', true) . - ' ' . __('Loading...') . - '
'); - - $this->addJavascriptAddBottom(); - } + $ui->contentAddHtml('
' . + html_print_image('images/spinner.gif', true) . + ' ' . __('Loading...') . + '
'); + + $this->addJavascriptAddBottom(); $this->addJavascriptDialog(); } @@ -972,7 +885,7 @@ class Events { $ui->contentAddHtml("