diff --git a/cmd/server/assets/apikeys/show.html b/cmd/server/assets/apikeys/show.html index b6722ebb7..8ebc724c6 100644 --- a/cmd/server/assets/apikeys/show.html +++ b/cmd/server/assets/apikeys/show.html @@ -126,6 +126,9 @@ diff --git a/cmd/server/assets/static/js/application.js b/cmd/server/assets/static/js/application.js index 3fa38bdef..38bc770b9 100644 --- a/cmd/server/assets/static/js/application.js +++ b/cmd/server/assets/static/js/application.js @@ -1021,3 +1021,34 @@ function showSuccessfulCode(request, code, line) { $row.append($('').text(code.uuid)); $successTableBody.append($row); } + +function redrawCharts(chartsData, timeout) { + let redrawPending = false; + let windowWidth = 0; + $(window).resize(function() { + let w = $(window).width(); + if (w != windowWidth) { + windowWidth = w; + } else { + return; + } + + if (!redrawPending) { + redrawPending = true; + setTimeout(function() { + redraw(); + redrawPending = false; + }, timeout); + } + }); + + function redraw() { + let c; + for (c of chartsData) { + if (c.options) { + c.options.animation = null; + } + c.chart.draw(c.data, c.options); + } + } +} \ No newline at end of file diff --git a/cmd/server/assets/users/show.html b/cmd/server/assets/users/show.html index 374328aa2..22d7d6071 100644 --- a/cmd/server/assets/users/show.html +++ b/cmd/server/assets/users/show.html @@ -127,6 +127,9 @@