aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-07-05 21:23:35 -0500
committerJP Dillingham <jp@dillingham.me>2026-07-05 21:23:35 -0500
commit555da1c27697059fa5d96f9d062608772880c720 (patch)
tree628cb2fc848f4b3c3250d17ea38d7011f09e386d /src
parentc4d87a3c25a9b1376ed3252f09fbec83303057f1 (diff)
downloadslskd-555da1c27697059fa5d96f9d062608772880c720.tar.gz
use buckets
Diffstat (limited to 'src')
-rw-r--r--src/web/src/components/Dashboard/Dashboard.jsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/web/src/components/Dashboard/Dashboard.jsx b/src/web/src/components/Dashboard/Dashboard.jsx
index 302e0f0a..4554d6d0 100644
--- a/src/web/src/components/Dashboard/Dashboard.jsx
+++ b/src/web/src/components/Dashboard/Dashboard.jsx
@@ -5,13 +5,13 @@ import SearchBar from './SearchBar';
import React, { useEffect, useMemo, useState } from 'react';
const HISTORY_RANGES = [
- { label: '24h', days: 1, interval: 60 },
- { label: '7d', days: 7, interval: 360 },
- { label: '30d', days: 30, interval: 1_440 },
- { label: '90d', days: 90, interval: 1_440 },
- { label: '180d', days: 180, interval: 2_880 },
- { label: '1y', days: 365, interval: 10_080 },
- { label: 'All', days: null, interval: 43_200 },
+ { label: '24h', days: 1, buckets: 24 },
+ { label: '7d', days: 7, buckets: 84 },
+ { label: '30d', days: 30, buckets: 60 },
+ { label: '90d', days: 90, buckets: 90 },
+ { label: '180d', days: 180, buckets: 90 },
+ { label: '1y', days: 365, buckets: 100 },
+ { label: 'All', days: null, buckets: 100 },
];
const initialState = {
@@ -45,8 +45,8 @@ const Dashboard = ({ server } = {}) => {
HISTORY_RANGES.find((r) => r.label === historyLabel) ?? HISTORY_RANGES[2];
const now = new Date();
return {
+ buckets: range.buckets,
end: now.toISOString(),
- interval: range.interval,
start:
range.days != null
? new Date(now - range.days * 86_400_000).toISOString()
@@ -76,7 +76,7 @@ const Dashboard = ({ server } = {}) => {
return {};
}),
reports
- .getHistogram({ end, interval: parameters.interval, start })
+ .getHistogram({ buckets: parameters.buckets, end, start })
.catch((error) => {
console.error(error);
return {};