[Perl] DAQ system for the FAPG.
feat replace probe unit subtitle with change indicator
Remove the 'Unit: ...' line from probe card headers. The percentage change (e.g. '+2.3% over last day') is now the subtitle, displayed as its own line below the probe title.
Changed files
roles/dashboard/public/js/dashboard/charts.js
@@ -144,7 +144,7 @@
144
144
const color = percent > 0 ? "text-success" : percent < 0 ? "text-danger" : "text-body-secondary";
145
145
const periodText = timeframeLabel ? ` over last ${timeframeLabel}` : "";
146
146
147
Removed:
element.className = `small fw-normal ${color}`;
147
Added:
element.className = `small mb-0 mt-1 fw-semibold ${color}`;
148
148
element.textContent = `${sign}${percent.toFixed(1)}%${periodText}`;
149
149
element.setAttribute("aria-label", `${sign}${percent.toFixed(1)} percent change${periodText}`);
150
150
}
roles/dashboard/templates/dashboard/probe-card.html.ep
@@ -3,11 +3,8 @@
3
3
<div class="probe-card-title min-w-0">
4
4
<h1 class="h5 mb-0">
5
5
<a class="text-body text-decoration-none" href="/probes/<%= $probe->{key} %>"><%= $probe->{label} %></a>
6
Removed:
<span class="small fw-normal text-body-secondary" data-variation="<%= $probe->{key} %>"></span>
7
6
</h1>
8
Removed:
<p class="text-body-secondary small mb-0 mt-1">
9
Removed:
Unit: <strong><%= $probe->{unit} %></strong>
10
Removed:
</p>
7
Added:
<p class="small mb-0 mt-1" data-variation="<%= $probe->{key} %>"></p>
11
8
</div>
12
9
<div class="dropdown flex-shrink-0">
13
10
<button