Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Project Homepage Charts: fix range and add product type (#36132)

Jordi Enricee5279e335fa
diff --git a/apps/studio/components/interfaces/Home/ProjectUsage.tsx b/apps/studio/components/interfaces/Home/ProjectUsage.tsx
index c681a870c78..5ecdfb3e224 100644
--- a/apps/studio/components/interfaces/Home/ProjectUsage.tsx
+++ b/apps/studio/components/interfaces/Home/ProjectUsage.tsx
@@ -105,14 +105,27 @@ const ProjectUsage = () => {
const handleBarClick = (
value: UsageApiCounts,
- // TODO (ziinc): link to edge logs with correct filter applied
_type: 'rest' | 'realtime' | 'storage' | 'auth'
) => {
const unit = selectedInterval.startUnit
const selectedStart = dayjs(value?.timestamp)
const selectedEnd = selectedStart.add(1, unit)
+
+ if (_type === 'rest') {
+ router.push(
+ `/project/${projectRef}/logs/edge-logs?its=${selectedStart.toISOString()}&ite=${selectedEnd.toISOString()}`
+ )
+ return
+ }
+
router.push(
- `/project/${projectRef}/logs/edge-logs?ite=${encodeURIComponent(selectedEnd.toISOString())}`
+ `/project/${projectRef}/logs/edge-logs?its=${selectedStart.toISOString()}&ite=${selectedEnd.toISOString()}&f=${JSON.stringify(
+ {
+ product: {
+ [_type]: true,
+ },
+ }
+ )}`
)
}