diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index d3965eaef8..74522117d3 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,19 @@ +2014-01-31 Sergio Martin + + * mobile/operation/agent.php + mobile/operation/events.php + mobile/operation/modules.php + mobile/operation/alerts.php + mobile/include/style/main.css + include/functions.php: Fixed last 10 events on + agent view and improve usability and styles + +2014-01-30 Sergio Martin + + * include/languages/es.po + include/languages/es.mo: Update some spanish + bad translations + 2014-01-30 Sergio Martin * operation/gis_maps/ajax.php: Fixed broken agent diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index b12cf59207..e0b4f781fc 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -1821,7 +1821,7 @@ function get_periods ($custom = true, $show_default = true) { if ($custom) { $periods[-1] = __('custom'); } - + if (empty($config['interval_values'])) { if ($show_default) { $periods[SECONDS_5MINUTES] = sprintf(__('%s minutes'), '5'); diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index c971d78b33..ee9c01b12b 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -1,5 +1,6 @@ * { text-decoration: none !important; + font-size: 12px; } body { @@ -8,7 +9,6 @@ body { direction: ltr; display: block; font-family: Arial,Helvetica,sans-serif; - font-size: 12px; margin: 0; text-align: left; vertical-align: top; @@ -27,12 +27,14 @@ body { } /*INIT----------Tactical styles-----------------------------------------*/ +/* Common */ #tactical1 *, #tactical2 * { - font-size: 12px !important; + font-weight: bold; } #tactical1 a, #tactical2 a { - font-size: 18px !important; + font-weight: bold; + color: #222; } legend { @@ -47,6 +49,24 @@ legend { font-weight: normal !important; text-shadow: none !important; } + +/* For mobiles */ +@media screen and (max-width: 750px) +{ + #tactical1 *, #tactical2 * { + font-size: 12px; + } + #tactical1 a, #tactical2 a { + font-size: 18px; + } +} +/* For tablets */ +@media screen and (min-width: 750px) +{ + #tactical1 a, #tactical2 a { + font-size: 25px !important; + } +} /*END-----------Tactical styles-----------------------------------------*/ #status_pie { @@ -250,6 +270,14 @@ table#list_events th { border: 0px; } +div.graph { + margin: 0 auto; +} + +.tickLabels * { + font-size: 10px !important; +} + table.alternate tr:nth-child(odd) td, table.alternate tr:nth-child(odd) th{ background-color: #ffffff; } @@ -457,6 +485,15 @@ table.event_details td.cell_event_name { font-size: 12px !important; } +.agent_details { + line-height: 25px; +} + +.agent_name { + font-weight: bold; + font-size: 14px; +} + @media screen and (max-width: 25em) { #list_agents .cell_2 .ui-table-cell-label, #list_agents .cell_3 .ui-table-cell-label, @@ -573,6 +610,11 @@ table.event_details td.cell_event_name { color: #000000 !important; } +#list_Modules .module_name { + font-size: 15px; + font-weight: bold; +} + @media screen and (max-width: 25em) { #list_Modules_Embedded .cell_1 .ui-table-cell-label, #list_Modules_Embedded .cell_4 .ui-table-cell-label { @@ -827,7 +869,11 @@ li.ui-btn { } * { - font-size: 18px; + font-size: 18px !important; + } + + .event_name { + font-size: 18px !important; } } @@ -837,9 +883,9 @@ li.ui-btn { max-width: 300px; } -#logout_dialog-button_close { - display: block; - margin: 15px auto; +.event_name { + font-size: 15px; + font-weight: bold; } #login_container #login_btn-container { diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index 6add11f327..cdb2d9b6ae 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -65,6 +65,7 @@ class Agent { $system = System::getInstance(); $ui->createPage(); + if ($this->id != 0) { $agent_name = (string) agents_get_name ($this->id); @@ -109,20 +110,22 @@ class Agent { if (!empty($addresses)) { $ip .= ui_print_help_tip(__('Other IP addresses').':
'.implode('
',$addresses), true); } + $ip .= '
'; - $last_contant = '' . __('Last contact') . ' / ' . __('Remote') . ' ' - .ui_print_timestamp ($this->agent["ultimo_contacto"], true); + $last_contact = __('Last contact') . ' / ' . __('Remote') . ': ' + .ui_print_timestamp ($this->agent["ultimo_contacto"], true) . '
'; $description = - empty($agent["comentarios"]) ? '' . __('N/A') . '' : $this->agent["comentarios"]; + empty($agent["comentarios"]) ? '' : $this->agent["comentarios"] . '
'; - - $html = ui_print_group_icon ($this->agent["id_grupo"], true) . '  '; - $html .= $agent_name . '
'; - $html .= $ip . '
'; - $html .= $last_contant . '
'; - $html .= $description . '
'; + $html = '
'; + $html .= ui_print_group_icon ($this->agent["id_grupo"], true) . '  '; + $html .= '' . $agent_name . '
'; + $html .= $ip; + $html .= $last_contact; + $html .= $description; + $html .= '
'; $ui->contentGridAddCell($html); ob_start(); @@ -132,6 +135,7 @@ class Agent { $html .= "" . __('Events (24h)') . "
"; $html .= graph_graphic_agentevents( $this->id, 250, 15, 86400, ui_get_full_url(false), true); + $html .= '

'; $ui->contentGridAddCell($html); $ui->contentEndGrid(); @@ -153,12 +157,10 @@ class Agent { $ui->contentEndCollapsible(); $events = new Events(); - $filters = array('id_agent' => $this->id); - $events->setFilters($filters); - $events->disabledColumns(array('agent')); - $events->setReadOnly(); $ui->contentBeginCollapsible(sprintf(__('Last %s Events'), $system->getPageSize())); - $ui->contentCollapsibleAddItem($events->listEventsHtml(0, true)); + $tabledata = $events->listEventsHtml(0, true, 'last_agent_events'); + $ui->contentCollapsibleAddItem($tabledata['table']); + $ui->contentCollapsibleAddItem($events->putEventsTableJS($this->id)); $ui->contentEndCollapsible(); } $ui->endContent(); diff --git a/pandora_console/mobile/operation/alerts.php b/pandora_console/mobile/operation/alerts.php index dfc6be1f95..b09d4d239b 100644 --- a/pandora_console/mobile/operation/alerts.php +++ b/pandora_console/mobile/operation/alerts.php @@ -258,7 +258,7 @@ class Alerts { } $row = array(); - if ($this->columns['agent']) { + if (isset($this->columns['agent']) && $this->columns['agent']) { $row[__('Agent')] = sprintf($disabled_style, '' . io_safe_output($alert['agent_name'])) . ''; } diff --git a/pandora_console/mobile/operation/events.php b/pandora_console/mobile/operation/events.php index 203395f897..881be5fef3 100644 --- a/pandora_console/mobile/operation/events.php +++ b/pandora_console/mobile/operation/events.php @@ -59,7 +59,17 @@ class Events { else { switch ($parameter2) { case 'get_events': - $this->eventsGetFilters(); + if ($system->getRequest('agent_events', '0') == 1) { + $this->disabledColumns(array('agent')); + $filters = array('id_agent' => $system->getRequest('id_agent', 0)); + $this->setFilters($filters); + $this->setReadOnly(); + $this->eventsGetFilters(); + } + else { + $this->eventsGetFilters(); + } + $page = $system->getRequest('page', 0); $system = System::getInstance(); @@ -85,7 +95,7 @@ class Events { break; } - if($event['criticity'] == EVENT_CRIT_WARNING) { + if($event['criticity'] == EVENT_CRIT_WARNING || $event['criticity'] == EVENT_CRIT_MAINTENANCE ) { $img_st = str_replace("white.png", "dark.png", $img_st); } @@ -100,7 +110,7 @@ class Events { } $row = array(); - $row[] = $open_link . '' . __('Event Name') . '' . io_safe_output($event['evento']) . $close_link; + $row[] = $open_link . '' . __('Event Name') . '
' . io_safe_output($event['evento']) . '
' . $close_link; if ($event["id_agente"] == 0) { $agent_name = __('System'); @@ -365,12 +375,15 @@ class Events { if ($this->filter > 0) { $this->loadPresetFilter(); } + + $this->limit = $system->getRequest('limit', -1); } public function setFilters($filters) { if (isset($filters['id_agent'])) { $this->id_agent = $filters['id_agent']; } + if (isset($filters['all_events'])) { $this->all_events = $filters['all_events']; } @@ -700,10 +713,17 @@ class Events { } //-------------------------------------------------------------- - + if (isset($this->limit) && $this->limit != -1) { + $offset = 0; + $pagination = $this->limit; + } + else { + $offset = $page * $system->getPageSize(); + $pagination = $system->getPageSize(); + } $events_db = events_get_events_grouped($sql_post, - $page * $system->getPageSize(), $system->getPageSize(), false, false); + $offset, $pagination, false, false); if (empty($events_db)) { $events_db = array(); } @@ -713,7 +733,7 @@ class Events { return array('events' => $events_db, 'total' => $total_events); } - public function listEventsHtml($page = 0, $return = false) { + public function listEventsHtml($page = 0, $return = false, $id_table = 'list_events') { $system = System::getInstance(); $listEvents = $this->getListEvents($page); @@ -732,7 +752,7 @@ class Events { else { // Create an empty table to be filled from ajax $table = new Table(); - $table->id = 'list_events'; + $table->id = $id_table; if (!$return) { $ui->contentAddHtml($table->getHTML()); @@ -747,11 +767,19 @@ class Events { $this->addJavascriptDialog(); } else { - return $table->getHTML(); + $this->addJavascriptAddBottom(); + + return array('table' => $table->getHTML(), 'data' => $events_db); } } } + public function putEventsTableJS($id_agent) { + return ""; + } + private function addJavascriptDialog() { $ui = Ui::getInstance(); @@ -891,14 +919,13 @@ class Events { $ui->contentAddHtml("