diff --git a/plugins/traefik/templates/traefik/widget_request_chart.html b/plugins/traefik/templates/traefik/widget_request_chart.html index d84112c..0df306c 100644 --- a/plugins/traefik/templates/traefik/widget_request_chart.html +++ b/plugins/traefik/templates/traefik/widget_request_chart.html @@ -30,7 +30,7 @@ var hhmm = function (ms) { return new Date(ms).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); }; - new Chart(ctx.getContext("2d"), { + var chart = new Chart(ctx.getContext("2d"), { type: "line", data: { labels: times, @@ -83,6 +83,14 @@ } } }); + // The chart is built while the dashboard may still be placing this cell, + // and a chart sized then can stay blank until a window resize (#5214). + // Measure and draw again once layout has settled. + setTimeout(function () { + if (!ctx.isConnected) return; + chart.resize(); + chart.update("none"); + }, 250); } catch (err) { fail(err && err.message ? err.message : String(err)); } diff --git a/steward/core/widgets.py b/steward/core/widgets.py index 8fa3fec..5c15d22 100644 --- a/steward/core/widgets.py +++ b/steward/core/widgets.py @@ -131,6 +131,7 @@ WIDGET_REGISTRY: dict[str, dict] = { "detail_url": "/plugins/traefik/", "plugin": "traefik", "poll": True, + "poll_seconds": 300, # buckets are minutes wide; each refresh redraws the chart "params": [ { "key": "hours",