diff --git a/packages/dashboard/src/pages/index.js b/packages/dashboard/src/pages/index.js index 1c15465f..5e07f33f 100644 --- a/packages/dashboard/src/pages/index.js +++ b/packages/dashboard/src/pages/index.js @@ -9,8 +9,6 @@ dayjs.extend(relativeTime); const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); -const currentPeriodDownload = Math.floor(Math.random() * 1000000000000) + 1; -const currentPeriodUpload = Math.floor(Math.random() * 1000000000000) + 1; export default function Home() { const { data: user } = useSWR("/user", fetcher); @@ -20,8 +18,7 @@ export default function Home() { return (
- {/* change to lg:grid-cols-3 when we have more stats */} -
+
@@ -94,7 +91,7 @@ export default function Home() {
- {/*
+
@@ -114,17 +111,21 @@ export default function Home() {
-
Current period usage
+
Bandwidth used
-
{prettyBytes(currentPeriodDownload)}
-
/
-
{prettyBytes(currentPeriodUpload)}
+
{prettyBytes(user?.bandwidthUsed ?? 0)}
-
-
*/} +
+ +
+
{/* ============ */}