diff --git a/pandora_console/include/lib/Dashboard/Widgets/service_map.php b/pandora_console/include/lib/Dashboard/Widgets/service_map.php index 92209fcf93..f89ab78000 100644 --- a/pandora_console/include/lib/Dashboard/Widgets/service_map.php +++ b/pandora_console/include/lib/Dashboard/Widgets/service_map.php @@ -104,6 +104,27 @@ class ServiceMapWidget extends Widget */ protected $gridWidth; + /** + * Cell ID. + * + * @var integer + */ + protected $cellId; + + /** + * Widget ID. + * + * @var integer + */ + protected $widgetId; + + /** + * Dashboard ID. + * + * @var integer + */ + protected $dashboardId; + /** * Construct. @@ -145,6 +166,15 @@ class ServiceMapWidget extends Widget // Grid Width. $this->gridWidth = $gridWidth; + // Cell Id. + $this->cellId = $cellId; + + // Widget ID. + $this->widgetId = $widgetId; + + // Dashboard ID. + $this->dashboardId = $dashboardId; + // Options. $this->values = $this->decoders($this->getOptionsWidget()); @@ -236,6 +266,14 @@ class ServiceMapWidget extends Widget ); } + $inputs[] = [ + 'label' => \ui_print_info_message( + __('ZOOM functionality is only available when there is only one such widget in the dashboard'), + '', + true + ), + ]; + $inputs[] = [ 'label' => __('Service'), 'arguments' => [ @@ -249,8 +287,10 @@ class ServiceMapWidget extends Widget ], ]; - // Show legend. - $inputs[] = [ + // TODO refactoriced services: Hidden legend. + /* + // Show legend. + $inputs[] = [ 'label' => __('Show legend'), 'arguments' => [ 'name' => 'showLegend', @@ -258,7 +298,8 @@ class ServiceMapWidget extends Widget 'type' => 'switch', 'value' => $values['showLegend'], ], - ]; + ]; + */ return $inputs; } @@ -275,8 +316,7 @@ class ServiceMapWidget extends Widget $values = parent::getPost(); $values['serviceId'] = \get_parameter('serviceId', 0); - $values['showLegend'] = \get_parameter_switch('showLegend'); - + // $values['showLegend'] = \get_parameter_switch('showLegend'); return $values; } @@ -314,10 +354,14 @@ class ServiceMapWidget extends Widget return $output; } - $output .= "
"; + $containerId = 'container_servicemap_'.$this->values['serviceId'].'_'.$this->cellId; + $style = 'position: relative; text-align: center;'; + $output .= "
"; - if ($this->values['showLegend'] === 1) { - $output .= "
"; + // TODO refactoriced services: Hidden legend. + /* + if ($this->values['showLegend'] === 1) { + $output .= "
cellId."'>"; $output .= ''; $output .= "'; $output .= ""; @@ -347,6 +391,22 @@ class ServiceMapWidget extends Widget $output .= ''; $output .= '
".__('Legend').'
'; $output .= '
'; + } + */ + + // TODO: removed refactoriced services. Only 1 widget Zoom. + $sql = sprintf( + 'SELECT COUNT(*) + FROM twidget_dashboard + WHERE id_dashboard = %s + AND id_widget = %s', + $this->dashboardId, + $this->widgetId + ); + $countDashboardServices = \db_get_value_sql($sql); + $disableZoom = false; + if ($countDashboardServices > 1) { + $disableZoom = true; } $output .= html_print_input_hidden( @@ -360,7 +420,9 @@ class ServiceMapWidget extends Widget $this->values['serviceId'], false, $size['width'], - $size['height'] + $size['height'], + $this->cellId, + $disableZoom ); $output .= ob_get_clean(); $output .= '
'; diff --git a/pandora_console/include/styles/dashboards.css b/pandora_console/include/styles/dashboards.css index e89e282d6f..39b768bab9 100644 --- a/pandora_console/include/styles/dashboards.css +++ b/pandora_console/include/styles/dashboards.css @@ -477,17 +477,29 @@ div#main_pure { margin-top: 30px; } +#form-config-widget .info_box, .content-widget .info_box { border-radius: 5px; width: 90%; } + +#form-config-widget .info_box { + margin: 0 auto; +} +#form-config-widget .info_box tbody tr td, .content-widget .info_box tbody tr td { padding: 10px; } +#form-config-widget .info_box tbody tr td.icon, .content-widget .info_box tbody tr td.icon { padding-right: 10px !important; } +#form-config-widget .info_box tbody tr td { + font-family: "lato-bolder", "Open Sans", sans-serif; + font-size: 8pt; +} + .content-widget .databox.filters > tbody > tr > td { padding-right: 30px; }