summaryrefslogtreecommitdiffstats
path: root/public
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:21:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:21:35 +0000
commit8adc969fb08ffab5f8e9e0b05b081046bdc2ad9a (patch)
tree555499bc0262c29210c706b44e0fb23c0ddd8b92 /public
parentAdding debian version 1.2.2-3. (diff)
downloadicingaweb2-module-graphite-8adc969fb08ffab5f8e9e0b05b081046bdc2ad9a.tar.xz
icingaweb2-module-graphite-8adc969fb08ffab5f8e9e0b05b081046bdc2ad9a.zip
Merging upstream version 1.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'public')
-rw-r--r--public/css/module.less19
-rw-r--r--public/js/module.js10
2 files changed, 10 insertions, 19 deletions
diff --git a/public/css/module.less b/public/css/module.less
index bb651e7..cf89fc4 100644
--- a/public/css/module.less
+++ b/public/css/module.less
@@ -1,22 +1,5 @@
-div.images {
- h3 {
- clear: both;
- }
-
- img.svg {
- float: left;
- border: none;
- }
-
-}
-
-div.images.object-detail-view {
- display: block;
-
- img.graphiteImg {
+.images.object-detail-view > img {
width: 100%;
- display: block;
- }
}
.timerangepicker-container {
diff --git a/public/js/module.js b/public/js/module.js
index a2a32f2..89c1a54 100644
--- a/public/js/module.js
+++ b/public/js/module.js
@@ -79,7 +79,15 @@
container.querySelectorAll('img.graphiteImg[data-actualimageurl]').forEach(img => {
let params = { ...this.colorParams }; // Theming ftw!
params.r = (new Date()).getTime(); // To bypass the browser cache
- params.width = img.scrollWidth; // It's either fixed or dependent on parent width
+ params.width = img.scrollWidth;
+ if ('width' in img.dataset) {
+ // If the width is defined in the data attributes, it has been explicitly defined in a template and
+ // therefore must be handled specially. In detail areas the image must not be scaled to 100% and
+ // in the other views it must not exceed the width of the parent container.
+ // Note the `+str` which will convert str to number.
+ params.width = Math.min(+img.dataset.width, img.parentElement.clientWidth);
+ img.style.width = params.width + 'px';
+ }
img.src = this.icinga.utils.addUrlParams(img.dataset.actualimageurl, params);
});