This commit is contained in:
Mateusz Gruszczyński committed 2026-10-15 15:36:35 +02:00
1 parent c6486bfe85
commit 5dd802ae83
12 files changed
+295 -26

No files matched your search

+1 -6
View File
@@ -85,14 +85,10 @@ window.rustProxyWideOverview = (() => {
for (const [id, config] of Object.entries(configurations)) {
const node = tile(id);
if (!node) { baselines.delete(id); continue; }
// Keep collecting while hidden so restoring a widget does not restart rates.
const values = config.counters ? counterRates(id, config.counters(status), now, record)
: config.values(status).map(finite);
const series = history.get(id) || config.names.map(() => []);
if (record) {
// Counter rates have no meaningful value on the first sample after a
// paused tab. Do not add null to the path: it would split a live line.
// Still show "-" above the chart until a fresh interval is sampled.
if (!config.counters || values.every(value => value !== null)) {
values.forEach((value, i) => {
series[i].push(value);
@@ -102,8 +98,7 @@ window.rustProxyWideOverview = (() => {
}
last.set(id, values);
}
const peak = Math.max(config.unit === "percent" ? 100 : 1,
...series.flat().filter(n => n !== null));
const peak = Math.max(1, ...series.flat().filter(n => n !== null));
config.names.forEach((key, i) => {
const value = values[i];
const field = $(`overview-wide-${id}-${key}-value`);
+4 -5
View File
@@ -1083,9 +1083,8 @@
</article>
<article class="card activity-card" data-dashboard-widget="traffic_chart">
<div class="card-heading">
<div><span class="small-label" data-i18n="liveTraffic">LIVE TRAFFIC</span>
<h2 data-i18n="requestsPerSecond">Requests per second</h2>
</div><span class="pill live" data-i18n="live">LIVE</span>
<h2 data-i18n="requestsPerSecond">Requests per second</h2>
<span id="chart-peak">max 0.0 req/s</span>
</div><svg preserveAspectRatio="none" aria-label="Recent request rate" id="traffic-chart"
role="img" viewbox="0 0 600 130">
<path class="chart-grid" d="M0 25H600 M0 65H600 M0 105H600"></path>
@@ -1112,7 +1111,7 @@
id="rate-transform">0.0/s</b></span>
</div>
<div class="chart-footer"><span data-i18n="lastMinute">Recent samples / resets on
reload</span><span id="chart-peak">peak 0 req/s</span></div>
reload</span></div>
</article>
<article class="card system-card" data-dashboard-widget="system_chart">
<div class="card-heading">
@@ -1143,7 +1142,7 @@
<div><span class="small-label" data-i18n="connectionActivity">CONNECTION ACTIVITY</span>
<h2><span id="connection-current">0</span> <small data-i18n="connections">Open
connections</small></h2>
</div><span class="pill live" data-i18n="live">LIVE</span>
</div>
</div>
<svg preserveAspectRatio="none" aria-label="Connection activity history"
data-i18n-aria="connectionActivity" id="connection-chart" role="img"
+11
View File
@@ -770,6 +770,17 @@ h1 {
display: block;
}
.activity-card .card-heading {
flex-wrap: wrap;
}
.activity-card #chart-peak {
margin-left: auto;
color: var(--muted);
font: 9px var(--mono);
white-space: nowrap;
}
.pill {
padding: 4px 8px;
border: 1px solid var(--pill-line);