diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2018-10-25 22:19:05 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2018-10-25 22:19:05 +0000 |
commit | bcbaccb9408b899369b0f779f23f4e80de70368a (patch) | |
tree | c0258efdde944fed415c2c403af61f397a67f677 | |
parent | 5c166337860a3734fa4d73db53b16b09af5566c5 (diff) | |
parent | 07f15f9adca9d922057599d9cc064c8ebfdf41f7 (diff) | |
download | gitlab-ce-bcbaccb9408b899369b0f779f23f4e80de70368a.tar.gz |
Merge branch '40372-prometheus-dashboard-broken-on-firefox' into 'master'
Resolve "Prometheus dashboard broken on Firefox"
Closes #40372
See merge request gitlab-org/gitlab-ce!22400
-rw-r--r-- | app/assets/javascripts/monitoring/components/graph.vue | 5 | ||||
-rw-r--r-- | changelogs/unreleased/40372-prometheus-dashboard-broken-on-firefox.yml | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/monitoring/components/graph.vue b/app/assets/javascripts/monitoring/components/graph.vue index ed5c8b15945..5c6e2e09e46 100644 --- a/app/assets/javascripts/monitoring/components/graph.vue +++ b/app/assets/javascripts/monitoring/components/graph.vue @@ -121,6 +121,7 @@ export default { draw() { const breakpointSize = bp.getBreakpointSize(); const query = this.graphData.queries[0]; + const svgWidth = this.$refs.baseSvg.getBoundingClientRect().width; this.margin = measurements.large.margin; if (this.smallGraph || breakpointSize === 'xs' || breakpointSize === 'sm') { this.graphHeight = 300; @@ -130,13 +131,13 @@ export default { this.unitOfDisplay = query.unit || ''; this.yAxisLabel = this.graphData.y_label || 'Values'; this.legendTitle = query.label || 'Average'; - this.graphWidth = this.$refs.baseSvg.clientWidth - this.margin.left - this.margin.right; + this.graphWidth = svgWidth - this.margin.left - this.margin.right; this.graphHeight = this.graphHeight - this.margin.top - this.margin.bottom; this.baseGraphHeight = this.graphHeight - 50; this.baseGraphWidth = this.graphWidth; // pixel offsets inside the svg and outside are not 1:1 - this.realPixelRatio = this.$refs.baseSvg.clientWidth / this.baseGraphWidth; + this.realPixelRatio = svgWidth / this.baseGraphWidth; this.renderAxesPaths(); this.formatDeployments(); diff --git a/changelogs/unreleased/40372-prometheus-dashboard-broken-on-firefox.yml b/changelogs/unreleased/40372-prometheus-dashboard-broken-on-firefox.yml new file mode 100644 index 00000000000..8376fac7abf --- /dev/null +++ b/changelogs/unreleased/40372-prometheus-dashboard-broken-on-firefox.yml @@ -0,0 +1,5 @@ +--- +title: Fix prometheus graphs in firefox +merge_request: 22400 +author: +type: fixed |