fix(web): show all usage breakdown periods (#7219)
This commit is contained in:
1 parent
33a8b07dd3
commit
a4cc1367b0
1 file changed
+6
-4
@@ -61,8 +61,10 @@ export function UsagePage() {
|
||||
: enumerateHourStarts(window.sinceTime, window.untilTime),
|
||||
[window.sinceTime, window.untilTime],
|
||||
);
|
||||
const recentPeriods = useMemo<readonly (DailyTotals | HourlyTotals)[]>(
|
||||
() => (isPast24Hours ? merged.hourly : merged.daily).toReversed().slice(0, 8),
|
||||
// Newest first: the window can run 90 periods, so the interesting end
|
||||
// belongs at the top of the table.
|
||||
const breakdownPeriods = useMemo<readonly (DailyTotals | HourlyTotals)[]>(
|
||||
() => (isPast24Hours ? merged.hourly : merged.daily).toReversed(),
|
||||
[isPast24Hours, merged.daily, merged.hourly],
|
||||
);
|
||||
|
||||
@@ -393,14 +395,14 @@ export function UsagePage() {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{recentPeriods.length === 0 ? (
|
||||
{breakdownPeriods.length === 0 ? (
|
||||
<tr>
|
||||
<td colSpan={5} className="py-6 text-center text-muted-foreground">
|
||||
No activity in this window.
|
||||
</td>
|
||||
</tr>
|
||||
) : (
|
||||
recentPeriods.map((period) => (
|
||||
breakdownPeriods.map((period) => (
|
||||
<tr
|
||||
key={"hourStart" in period ? period.hourStart : period.day}
|
||||
className="border-b border-border/50"
|
||||
|
||||
Reference in new issue
Block a user