Fixed problems with backgrounds when add visual console in dashboards. Gitlab: #533
This commit is contained in:
parent
def9172bb9
commit
4563ef34a4
|
@ -2434,12 +2434,9 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
|
||||||
$proportion_height = 0;
|
$proportion_height = 0;
|
||||||
$proportion_width = 0;
|
$proportion_width = 0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!is_null($height) && !is_null($width)) {
|
if (!is_null($height) && !is_null($width)) {
|
||||||
$resizedMap = true;
|
$resizedMap = true;
|
||||||
|
|
||||||
|
|
||||||
if ($keep_aspect_ratio) {
|
if ($keep_aspect_ratio) {
|
||||||
$ratio = min($width / $layout['width'], $height / $layout['height']);
|
$ratio = min($width / $layout['width'], $height / $layout['height']);
|
||||||
$mapWidth = $ratio * $layout['width'];
|
$mapWidth = $ratio * $layout['width'];
|
||||||
|
@ -2453,49 +2450,48 @@ function visual_map_print_visual_map ($id_layout, $show_links = true,
|
||||||
$dif_height = $layout["height"] - $mapHeight;
|
$dif_height = $layout["height"] - $mapHeight;
|
||||||
$dif_width = $layout["width"] - $mapWidth;
|
$dif_width = $layout["width"] - $mapWidth;
|
||||||
|
|
||||||
|
|
||||||
$proportion_height = $mapHeight / $layout["height"];
|
$proportion_height = $mapHeight / $layout["height"];
|
||||||
$proportion_width = $mapWidth / $layout["width"];
|
$proportion_width = $mapWidth / $layout["width"];
|
||||||
|
|
||||||
|
if ($layout["background"] != 'None.png' ) {
|
||||||
if (is_metaconsole()) {
|
if (is_metaconsole()) {
|
||||||
$backgroundImage =
|
$backgroundImage =
|
||||||
'/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' .
|
'/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' .
|
||||||
$config['homeurl'] . 'images/console/background/' .
|
$config['homeurl'] . 'images/console/background/' .
|
||||||
$layout["background"];
|
$layout["background"];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$backgroundImage =
|
$backgroundImage =
|
||||||
'/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' .
|
'/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' .
|
||||||
$config['homedir'] . '/images/console/background/' .
|
$config['homedir'] . '/images/console/background/' .
|
||||||
($layout["background"]);
|
($layout["background"]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$mapWidth = $layout["width"];
|
$mapWidth = $layout["width"];
|
||||||
$mapHeight = $layout["height"];
|
$mapHeight = $layout["height"];
|
||||||
$backgroundImage = $metaconsole_hack . 'images/console/background/' .
|
$backgroundImage = '';
|
||||||
$layout["background"];
|
if ($layout["background"] != 'None.png' )
|
||||||
|
$backgroundImage = $metaconsole_hack . 'images/console/background/' .
|
||||||
|
$layout["background"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined('METACONSOLE')) {
|
if (defined('METACONSOLE')) {
|
||||||
echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>";
|
echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<div style="';
|
echo '<div id="background_'.$id_layout.'"
|
||||||
|
|
||||||
if(get_parameter('pure')==1){
|
|
||||||
echo 'width:100%;height:100%;position:absolute;';
|
|
||||||
}
|
|
||||||
|
|
||||||
echo 'background-color:'.$layout["background_color"].';"><div id="background_'.$id_layout.'"
|
|
||||||
style="margin:0px auto;text-align:
|
style="margin:0px auto;text-align:
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
position:relative;
|
position:relative;
|
||||||
width:' . $mapWidth . 'px;
|
width:' . $mapWidth . 'px;
|
||||||
height:' . $mapHeight . 'px;">';
|
height:' . $mapHeight . 'px;
|
||||||
echo "<img src='" .
|
background-color:'.$layout["background_color"].';">';
|
||||||
ui_get_full_url($backgroundImage) . "' width='100%' height='100%' />";
|
|
||||||
|
if ($layout["background"] != 'None.png' )
|
||||||
|
echo "<img src='" .
|
||||||
|
ui_get_full_url($backgroundImage) . "' width='100%' height='100%' />";
|
||||||
|
|
||||||
|
|
||||||
$layout_datas = db_get_all_rows_field_filter('tlayout_data',
|
$layout_datas = db_get_all_rows_field_filter('tlayout_data',
|
||||||
|
|
Loading…
Reference in New Issue