From 9976783266017f4419d629c3efabacc355395a01 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Fri, 15 Oct 2021 11:43:43 +0200 Subject: [PATCH] #8041 Fixed module graph height --- .../models/VisualConsole/Items/ModuleGraph.php | 4 ++++ visual_console_client/src/items/ModuleGraph.ts | 14 -------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php b/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php index 6f5a248a78..77a62b4a45 100644 --- a/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php +++ b/pandora_console/include/rest-api/models/VisualConsole/Items/ModuleGraph.php @@ -327,6 +327,10 @@ final class ModuleGraph extends Item $width = (int) $data['width']; $height = (int) $data['height']; + if ($height == 0) { + $height = 15; + } + // Custom graph. if (empty($customGraphId) === false) { $customGraph = \db_get_row('tgraph', 'id_graph', $customGraphId); diff --git a/visual_console_client/src/items/ModuleGraph.ts b/visual_console_client/src/items/ModuleGraph.ts index 2529a72fb7..0de3d2fd68 100644 --- a/visual_console_client/src/items/ModuleGraph.ts +++ b/visual_console_client/src/items/ModuleGraph.ts @@ -88,12 +88,6 @@ export function moduleGraphPropsDecoder( export default class ModuleGraph extends Item { protected createDomElement(): HTMLElement { const element = document.createElement("div"); - //element.className = "module-graph"; - //element.style.backgroundImage = `url(${this.props.html})`; - //element.style.backgroundRepeat = "no-repeat"; - //element.style.backgroundSize = `${this.props.width}px ${ - // this.props.height - //}px`; element.innerHTML = this.props.html; element.className = "module-graph"; @@ -128,18 +122,10 @@ export default class ModuleGraph extends Item { } } - // element.innerHTML = this.props.html; - return element; } protected updateDomElement(element: HTMLElement): void { - //element.style.backgroundImage = `url(${this.props.html})`; - //element.style.backgroundRepeat = "no-repeat"; - //element.style.backgroundSize = `${this.props.width}px ${ - // this.props.height - //}px`; - element.innerHTML = this.props.html; // Remove the overview graph.