Closed puseidr closed 1 year ago
+1
@puseidr See here #268 - same issue, including a workaround
@puseidr I don't know if this is still of interest, but here's what is happening in your examples: The width of the div (content) in which the iframe is embedded is determined by other output on that page. In the first screenshot the Plugin Output is so llong that the div is extended to all of the right, same with the debug output. The module declares the iframe to use a width 100%, that is 100% of the containing module div not the content div.
To make the graph always use the complete width of the content div you'd need to change the this:
diff --git a/library/Grafana/ProvidedHook/Grapher.php b/library/Grafana/ProvidedHook/Grapher.php
index 2fa799d..a618c39 100644
--- a/library/Grafana/ProvidedHook/Grapher.php
+++ b/library/Grafana/ProvidedHook/Grapher.php
@@ -444,6 +444,6 @@ class Grapher extends GrapherHook
$return_html .= " </tbody></table>";
}
- return '<div class="icinga-module module-grafana" style="display: inline-block;">' . $this->title . $menu . $return_html . '</div>';
+ return '<div class="icinga-module module-grafana" style="display: inline-block; width: 100%">' . $this->title . $menu . $return_html . '</div>';
}
}
@ecm75 thank you for the explanation, i didn't noticed this before
your fix is exactly the solution i wanted for this problem, hopefully this will be implemented in the next version
will be in 2.0.0
i've noticesd that the graphes are (mostly but not everytime) not shown in full width (i think, older versions of the module displayed the graphes at 100% of the width on the page)
i'm accessing grafana with the iFrame option and the datasource is influxdb and 98% of the graphes have a fixed width of 613px is this a bug or a feature?
here an example:
but there are also a few checks/graphes wich are using the full width, but i've not configured the width parameter in the graph settings, dont know why this few graphes are displayed with 100% width.
is it possible to show all graphes with 100% available width?
PS: when i enable the debug mode the graphes use nearly 90% of the width