Mikesch-mp / icingaweb2-module-grafana

Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
https://icinga.com/community/
GNU General Public License v2.0
241 stars 95 forks source link

Graph with in iFrame is much smaller after update #328

Open mdicss opened 1 year ago

mdicss commented 1 year ago

After the update of icinga2, icingaweb2 and all modules to the actual version, the with of the grafana-graphs is much smaller now. Changing the height works but the width stays the same. I use icingadb and iFrame for embedding the graphs. Before the update, the width was 100%. In the html-output, width is still defined as 100%. I think, the change comes from the new icingaweb2 and the updated php-libraries.

Your Environment

Icinga Web 2 Version 2.12.1 Git commit cd2daeb2cb8537c633d343a29eb76c54cd2ebbf2 PHP Version 8.0.30 Git commit date 2023-11-15

Loaded Libraries icinga/icinga-php-library 0.13.1 icinga/icinga-php-thirdparty 0.12.0 Loaded Modules icingadb 1.1.1 Configure cube 1.3.2 Configure director 1.11.0 Configure doc 2.12.1 Configure fileshipper 1.2.0 Configure grafana 2.0.3 Configure incubator 0.20.0 Configure theme-solarized 1.0.0 Configure x509 1.3.2 Configure

Former Environment before update

Icinga Web 2 Version 2.11.4 Git commit 11453bfa92a70a44efbf7f966f5e7f27e9300a28 PHP Version 8.0.29 Git commit date 2023-01-26

Loaded Libraries icinga/icinga-php-library 0.12.0 icinga/icinga-php-thirdparty 0.11.0 Loaded Modules icingadb 1.0.2 Configure cube 1.3.0 Configure director 1.10.2 Configure doc 2.11.4 Configure fileshipper 1.2.0 Configure grafana 2.0.3 Configure incubator 0.20.0 Configure theme-solarized 1.0.0 Configure x509 1.2.1 Configure

mdicss commented 12 months ago

I found a solution. In https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php , I had to change line 329: "style" => "width: 100%; border: none;" to "width" => "100%", "style" => "border: none;" With this change, the width of the graphs is set to 100% again.

I added this change to my pull request https://github.com/Mikesch-mp/icingaweb2-module-grafana/pull/318