From 1f21b9ffee12d157844427e47f4d573089a293cb Mon Sep 17 00:00:00 2001 From: m-lopez-f Date: Mon, 24 Oct 2016 11:58:19 +0200 Subject: [PATCH] Add new option in mobile version. (cherry picked from commit 09671dcb1d83ab23d182ba97d5ce8bd7cd0b05b7) --- .../include/graphs/flot/pandora.flot.js | 6 +++- .../include/style/jquery.mobile-1.3.1.css | 18 +++++++++- pandora_console/mobile/include/style/main.css | 13 ++++++-- .../mobile/include/system.class.php | 2 ++ pandora_console/mobile/index.php | 33 ++++++++++++++++++- pandora_console/mobile/operation/home.php | 30 ----------------- 6 files changed, 66 insertions(+), 36 deletions(-) diff --git a/pandora_console/include/graphs/flot/pandora.flot.js b/pandora_console/include/graphs/flot/pandora.flot.js index bf5482bf21..6a333b6e81 100644 --- a/pandora_console/include/graphs/flot/pandora.flot.js +++ b/pandora_console/include/graphs/flot/pandora.flot.js @@ -1576,7 +1576,11 @@ function pandoraFlotArea(graph_id, values, labels, labels_long, legend, // Re-calculate the graph height with the legend height if (dashboard || vconsole) { var hDiff = $('#'+graph_id).height() - $('#legend_'+graph_id).height(); - $('#'+graph_id).css('height', hDiff); + if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ){ + } + else { + $('#'+graph_id).css('height', hDiff); + } } if (vconsole) { diff --git a/pandora_console/mobile/include/style/jquery.mobile-1.3.1.css b/pandora_console/mobile/include/style/jquery.mobile-1.3.1.css index 17ffe785c3..3d226a605e 100755 --- a/pandora_console/mobile/include/style/jquery.mobile-1.3.1.css +++ b/pandora_console/mobile/include/style/jquery.mobile-1.3.1.css @@ -1913,23 +1913,39 @@ div.ui-mobile-viewport { overflow-x: hidden; } .ui-grid-solo .ui-block-a { display: block; float: none; } /* Lower percentages for older browsers (i.e. IE7) to prevent wrapping. -.5px to fix BB5 wrap issue. */ /* grid a: 50/50 */ +/* .ui-grid-a .ui-block-a, .ui-grid-a .ui-block-b { width: 49.95%; } +*/ +/* .ui-grid-a > :nth-child(n) { width: 50%; margin-right: -.5px; } +*/ .ui-grid-a .ui-block-a { clear: left; } /* grid b: 33/33/33 */ +/* .ui-grid-b .ui-block-a, .ui-grid-b .ui-block-b, .ui-grid-b .ui-block-c { width: 33.25%; } +*/ +/* .ui-grid-b > :nth-child(n) { width: 33.333%; margin-right: -.5px; } +*/ .ui-grid-b .ui-block-a { clear: left; } /* grid c: 25/25/25/25 */ +/* .ui-grid-c .ui-block-a, .ui-grid-c .ui-block-b, .ui-grid-c .ui-block-c, .ui-grid-c .ui-block-d { width: 24.925%; } +*/ +/* .ui-grid-c > :nth-child(n) { width: 25%; margin-right: -.5px; } +*/ .ui-grid-c .ui-block-a { clear: left; } /* grid d: 20/20/20/20/20 */ +/* .ui-grid-d .ui-block-a, .ui-grid-d .ui-block-b, .ui-grid-d .ui-block-c, .ui-grid-d .ui-block-d, .ui-grid-d .ui-block-e { width: 19.925%; } +*/ +/* .ui-grid-d > :nth-child(n) { width: 20%; } +*/ .ui-grid-d .ui-block-a { clear: left; } /* preset breakpoint to switch to stacked grid styles below 25em (560px) */ -@media all and (max-width: 25em) { +@media all { .ui-responsive .ui-block-a, .ui-responsive .ui-block-b, .ui-responsive .ui-block-c, diff --git a/pandora_console/mobile/include/style/main.css b/pandora_console/mobile/include/style/main.css index 2405960996..0c123564a7 100755 --- a/pandora_console/mobile/include/style/main.css +++ b/pandora_console/mobile/include/style/main.css @@ -1123,10 +1123,15 @@ table.tactical_bars { background-image: url(../../../images/visual_console.menu.png) !important; } +.ui-icon-dashboard { + background-image: url(../../../images/dashboard.menu.png) !important; +} + .ui-icon-tactical_view, .ui-icon-events, .ui-icon-groups, .ui-icon-alerts, .ui-icon-agents, .ui-icon-modules, -.ui-icon-network_maps, .ui-icon-visual_console { +.ui-icon-network_maps, .ui-icon-visual_console, +.ui-icon-dashboard { background-color: #333 !important; background-position: center; border-radius: 15px !important; @@ -1145,7 +1150,8 @@ table.tactical_bars { .ui-icon-tactical_view, .ui-icon-events, .ui-icon-groups, .ui-icon-alerts, .ui-icon-agents, .ui-icon-modules, - .ui-icon-network_maps, .ui-icon-visual_console { + .ui-icon-network_maps, .ui-icon-visual_console, + .ui-icon-dashboard { width: 22px !important; height: 22px !important; margin-top: -13px !important; @@ -1158,7 +1164,8 @@ table.tactical_bars { .ui-icon-tactical_view, .ui-icon-events, .ui-icon-groups, .ui-icon-alerts, .ui-icon-agents, .ui-icon-modules, - .ui-icon-network_maps, .ui-icon-visual_console { + .ui-icon-network_maps, .ui-icon-visual_console, + .ui-icon-dashboard { width: 32px !important; height: 32px !important; margin-top: -17px !important; diff --git a/pandora_console/mobile/include/system.class.php b/pandora_console/mobile/include/system.class.php index 85feae39ad..4c98ee9f63 100644 --- a/pandora_console/mobile/include/system.class.php +++ b/pandora_console/mobile/include/system.class.php @@ -45,6 +45,8 @@ class System { private function loadConfig() { global $config; + $config['mobile'] = true; + $this->config = &$config; } diff --git a/pandora_console/mobile/index.php b/pandora_console/mobile/index.php index 55b84a724c..e252d2c796 100644 --- a/pandora_console/mobile/index.php +++ b/pandora_console/mobile/index.php @@ -39,6 +39,7 @@ require_once('operation/networkmap.php'); require_once('operation/visualmaps.php'); require_once('operation/visualmap.php'); $enterpriseHook = enterprise_include('mobile/include/enterprise.class.php'); +$enterpriseHook = enterprise_include('mobile/operation/dashboard.php'); $enterpriseHook = enterprise_include('mobile/operation/home.php'); if (!empty ($config["https"]) && empty ($_SERVER['HTTPS'])) { @@ -157,6 +158,11 @@ switch ($action) { $tactical = new Tactical(); $tactical->ajax($parameter2); break; + default: + if (class_exists("Enterprise")) { + $enterprise->enterpriseAjax($parameter1, $parameter2); + } + break; } return; break; @@ -226,7 +232,6 @@ switch ($action) { default: if (class_exists("Enterprise")) { $enterprise = Enterprise::getInstance(); - if ($page != "home") { $permission = $enterprise->checkEnterpriseACL($page); @@ -302,6 +307,32 @@ switch ($action) { $visualmap = new Visualmap(); $visualmap->show(); break; + case 'dashboard_list': + if (class_exists("Dashboards")) { + $dashboard = new Dashboards(); + $dashboard->showDashboards(); + } + else { + if (class_exists("HomeEnterprise")) + $home = new HomeEnterprise(); + else + $home = new Home(); + $home->show(); + } + break; + case 'dashboard': + if (class_exists("Dashboards")) { + $dashboard = new Dashboards(); + $dashboard->show(); + } + else { + if (class_exists("HomeEnterprise")) + $home = new HomeEnterprise(); + else + $home = new Home(); + $home->show(); + } + break; } break; } diff --git a/pandora_console/mobile/operation/home.php b/pandora_console/mobile/operation/home.php index df01d12b5e..85e487294b 100644 --- a/pandora_console/mobile/operation/home.php +++ b/pandora_console/mobile/operation/home.php @@ -54,12 +54,6 @@ class Home { ); if (!$system->getConfig('metaconsole')) { - $items['alerts'] = array( - 'name' => __('Alerts'), - 'filename' => 'alerts.php', - 'menu_item' => true, - 'icon' => 'alerts' - ); $items['agents'] = array( 'name' => __('Agents'), 'filename' => 'agents.php', @@ -72,18 +66,6 @@ class Home { 'menu_item' => true, 'icon' => 'modules' ); - $items['networkmaps'] = array( - 'name' => __('Networkmaps'), - 'filename' => 'networkmaps.php', - 'menu_item' => true, - 'icon' => 'network_maps' - ); - $items['visualmaps'] = array( - 'name' => __('Visual consoles'), - 'filename' => 'visualmaps.php', - 'menu_item' => true, - 'icon' => 'visual_console' - ); // Not in home $items['agent'] = array( @@ -98,18 +80,6 @@ class Home { 'menu_item' => false, 'icon' => '' ); - $items['networkmap'] = array( - 'name' => __('Networkmap'), - 'filename' => 'networkmap.php', - 'menu_item' => false, - 'icon' => '' - ); - $items['visualmap'] = array( - 'name' => __('Visualmap'), - 'filename' => 'visualmap.php', - 'menu_item' => false, - 'icon' => '' - ); } $this->pagesItems = $items;