diff --git a/apix-admin/src/main/resources/META-INF/resources/admin.js b/apix-admin/src/main/resources/META-INF/resources/admin.js index 0234481..7e2272a 100644 --- a/apix-admin/src/main/resources/META-INF/resources/admin.js +++ b/apix-admin/src/main/resources/META-INF/resources/admin.js @@ -214,18 +214,6 @@ return Math.min(Math.round(sum * (60000 / CHART_TICK)), rateLimit); } - // Redraw: historical buf + live bucket at right edge, with smooth transition - function redraw() { - var view = buf.slice(1).concat([liveRpm()]); - path.transition().duration(900).ease(d3.easeLinear).attr('d', areaFn(view)); - } - - // Every 1 s: snapshot the sliding-window rate into the history buffer - // Smaller buckets (1 s each, 72 s total) so the chart scrolls visibly every second - setInterval(function () { - buf.push(liveRpm()); buf.shift(); - }, 1000); - async function poll() { try { var r = await fetch('/sandbox/' + sid + '/poll'); @@ -240,7 +228,9 @@ } var rpm = liveRpm(); updateLabel(rpm); - redraw(); + // Flush + redraw in one step — no separate timer, no competing transitions + buf.push(rpm); buf.shift(); + path.transition().duration(950).ease(d3.easeLinear).attr('d', areaFn(buf)); } lastTotal = total; currentInterval = (Date.now() - lastActivity > IDLE_AFTER_MS) ? IDLE_INTERVAL : FAST_INTERVAL; diff --git a/apix-admin/src/main/resources/templates/DashboardResource/global.html b/apix-admin/src/main/resources/templates/DashboardResource/global.html index 1d66d87..22b49e0 100644 --- a/apix-admin/src/main/resources/templates/DashboardResource/global.html +++ b/apix-admin/src/main/resources/templates/DashboardResource/global.html @@ -106,6 +106,6 @@ nav { - + diff --git a/apix-admin/src/main/resources/templates/DashboardResource/sandbox.html b/apix-admin/src/main/resources/templates/DashboardResource/sandbox.html index 2b3e271..42da7b7 100644 --- a/apix-admin/src/main/resources/templates/DashboardResource/sandbox.html +++ b/apix-admin/src/main/resources/templates/DashboardResource/sandbox.html @@ -151,6 +151,6 @@ button.promote:hover { background: #2ea043; } - +