Add new option in mobile version.

This commit is contained in:
m-lopez-f 2016-10-24 11:58:19 +02:00
parent 28fa292472
commit 09671dcb1d
6 changed files with 66 additions and 36 deletions

View File

@ -1571,7 +1571,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) {

View File

@ -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,

View File

@ -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;

View File

@ -45,6 +45,8 @@ class System {
private function loadConfig() {
global $config;
$config['mobile'] = true;
$this->config = &$config;
}

View File

@ -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;
}

View File

@ -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;