diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index e414053df0..c76fad8098 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,15 @@ +2014-02-10 Sergio Martin + + * mobile/include/style/main.css + mobile/index.php + mobile/operation/visualmap.php + mobile/operation/tactical.php + mobile/operation/module_graph.php + mobile/operation/modules.php + mobile/operation/agent.php: More improvements on + visual styles in mobile console. Layouts, adaption + of graphs dinamically to the screen using ajax, etc. + 2014-02-10 Sergio Martin * mobile/operation/agents.php diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index f3833e8895..8fef3f8e81 100644 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -28,6 +28,12 @@ body { /*INIT----------Tactical styles-----------------------------------------*/ /* Common */ + +#tactical1, #tactical2, #agent_graphs, #agent_details { + border-radius: 6px; + +} + #tactical1 *, #tactical2 * { font-weight: bold; } @@ -527,7 +533,7 @@ table.event_details td.cell_event_name { } #list_agents td:hover, #list_networkmaps td:hover, -#list_events td:hover, #list_Modules td:hover, +#list_events td:hover, #list_Modules td:hover, #list_agent_Modules td:hover, #list_visualmaps td:hover, #last_agent_events td:hover { cursor: pointer; } @@ -777,99 +783,13 @@ table.event_details td.cell_event_name { } @media screen and (max-width: 25em) { - #list_Modules_Embedded .cell_1 .ui-table-cell-label, - #list_Modules_Embedded .cell_4 .ui-table-cell-label { - min-width: auto !important; - } - - #list_Modules_Embedded .cell_4 .ui-table-cell-label { - padding-left: 10px; - } - - #list_Modules_Embedded .cell_3 { - display: none !important - } - #list_Modules_Embedded .cell_4 { - display: inline !important; - float: none !important; - } - - #list_Modules_Embedded .cell_0 .ui-table-cell-label, - #list_Modules_Embedded .cell_1 .ui-table-cell-label, - #list_Modules_Embedded .cell_3 .ui-table-cell-label, - #list_Modules_Embedded .cell_4 .ui-table-cell-label { + #list_agent_Modules .ui-table-cell-label, + #list_agent_Modules .cell_2, + #list_agent_Modules .cell_3 { display: none; } - - #list_Modules_Embedded .show_collapside { - display: inline !important; - } - - #list_Modules_Embedded .data { -/* - white-space: nowrap; -*/ - } - - #list_Modules_Embedded .cell_2, - #list_Modules_Embedded .cell_4 { - display: none !important; - } - - #list_Modules_Embedded .show_collapside > img { - display: none !important; - } - #list_Modules_Embedded .cell_3 .show_collapside { - display: none !important; - } } -#list_Modules_Embedded .cell_4 a, -#list_Modules_Embedded .cell_1 a { - color: #000000 !important; -} -/* - -@media screen and (max-width: 320px) { - #list_Modules_Embedded .cell_1 .ui-table-cell-label, - #list_Modules_Embedded .cell_6 .ui-table-cell-label { - min-width: auto !important; - } - - #list_Modules_Embedded .cell_6 .ui-table-cell-label { - padding-left: 10px; - } - - #list_Modules_Embedded .cell_3, - #list_Modules_Embedded .cell_4 { - display: inline !important; - float: none !important; - } - - #list_Modules_Embedded .cell_0 .ui-table-cell-label, - #list_Modules_Embedded .cell_1 .ui-table-cell-label, - #list_Modules_Embedded .cell_3 .ui-table-cell-label, - #list_Modules_Embedded .cell_4 .ui-table-cell-label { - display: none; - } - - #list_Modules_Embedded .show_collapside { - display: inline !important; - } - - #list_Modules_Embedded .data { - white-space: nowrap; - } - - #list_Modules_Embedded .cell_2 { - display: none !important; - } -} - -#list_Modules_Embedded .cell_4 a { - color: #000000 !important; -} -*/ /*END------------Modules styles---------------------------------------*/ @@ -918,16 +838,21 @@ li.ui-btn { .cell_0 { border-top: solid 1px #666; - margin-top: 4px; + margin-top: 0px; } #list_events .cell_0 { border: 0px; } +/* Hack to align table titles in mobile mode */ +.ui-table-cell-label { + float: left; +} + @media screen and (max-width: 25em) { .ui-table th, .ui-table td { - padding: 3px !important; + padding: 8px !important; padding-left: 3px; } @@ -1245,7 +1170,7 @@ span.nobold * { display: block !important; } -#list_Modules *, #list_agents *, #list_alerts *, #list_networkmaps *, #list_visualmaps * { +#list_Modules *, #list_agent_Modules *, #list_agents *, #list_alerts *, #list_networkmaps *, #list_visualmaps * { color: #222; } diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index 339ac37a6f..624e995a42 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -72,6 +72,10 @@ switch ($action) { $agents = new Agents(); $agents->ajax($parameter2); break; + case 'agent': + $agent = new Agent(); + $agent->ajax($parameter2); + break; case 'modules': $modules = new Modules(); $modules->ajax($parameter2); diff --git a/pandora_console/mobile/operation/agent.php b/pandora_console/mobile/operation/agent.php index 9339f4a843..63509b6002 100644 --- a/pandora_console/mobile/operation/agent.php +++ b/pandora_console/mobile/operation/agent.php @@ -60,6 +60,25 @@ class Agent { $home->show($error); } + + public function ajax($parameter2 = false) { + $system = System::getInstance(); + + if (!$this->correct_acl) { + return; + } + else { + switch ($parameter2) { + case 'render_events_bar': + $agent_id = $system->getRequest('agent_id', '0'); + $width = $system->getRequest('width', '400'); + graph_graphic_agentevents( + $this->id, $width, 30, 86400, ui_get_full_url(false)); + exit; + } + } + } + private function show_agent() { $ui = Ui::getInstance(); $system = System::getInstance(); @@ -132,7 +151,7 @@ class Agent { $html .= $description; $html .= ''; - $ui->contentGridAddCell($html); + $ui->contentGridAddCell($html, 'agent_details'); ob_start(); $html = '
'; $html .= "" . __('Modules by status') . "
"; @@ -142,11 +161,10 @@ class Agent { unset($this->agent['fired_count']); $html .= '' . reporting_tiny_stats($this->agent, true) . '
'; $html .= "" . __('Events (24h)') . "

"; - $html .= graph_graphic_agentevents( - $this->id, 250, 15, 86400, ui_get_full_url(false), true); + $html .= '
'; $html .= '
'; $html .= '
'; - $ui->contentGridAddCell($html); + $ui->contentGridAddCell($html, 'agent_graphs'); $ui->contentEndGrid(); @@ -187,7 +205,7 @@ class Agent { $ui->contentAddLinkListener('last_agent_events'); $ui->contentAddLinkListener('list_events'); - $ui->contentAddLinkListener('list_Modules'); + $ui->contentAddLinkListener('list_agent_Modules'); $ui->contentAddHtml(""); diff --git a/pandora_console/mobile/operation/module_graph.php b/pandora_console/mobile/operation/module_graph.php index 1453e674a9..04f21736d0 100644 --- a/pandora_console/mobile/operation/module_graph.php +++ b/pandora_console/mobile/operation/module_graph.php @@ -277,7 +277,9 @@ class ModuleGraph { "); $ui->endContent(); $ui->showPage(); } diff --git a/pandora_console/mobile/operation/visualmap.php b/pandora_console/mobile/operation/visualmap.php index 7239f8ec5a..75c510c4fe 100644 --- a/pandora_console/mobile/operation/visualmap.php +++ b/pandora_console/mobile/operation/visualmap.php @@ -101,7 +101,7 @@ class Visualmap { $ui->contentAddHtml($rendered_map); $ui->contentAddHtml(""); $ui->endContent();