The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
feat: add timestamp filling, handle empty search params
TzeYiing2387768658fa
diff --git a/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx b/studio/components/interfaces/Reports/renderers/ApiRenderers.tsxindex 4db02f05d25..643700b4c15 100644--- a/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx+++ b/studio/components/interfaces/Reports/renderers/ApiRenderers.tsx@@ -8,6 +8,7 @@ import {import { Button, Collapsible, IconChevronRight } from 'ui'import { queryParamsToObject } from '../Reports.utils'import { Fragment } from 'react'+import useFillTimeseriesSorted from 'hooks/analytics/useFillTimeseriesSorted'export const renderTotalRequests = (props: ReportWidgetProps<{@@ -18,13 +19,21 @@ export const renderTotalRequests = (const total = props.data.reduce((acc, datum) => {return acc + datum.count}, 0)+ const data = useFillTimeseriesSorted(+ props.data,+ 'timestamp',+ 'count',+ 0,+ props.params?.iso_timestamp_start,+ props.params?.iso_timestamp_end+ )return (<BarChartsize="small"minimalHeaderhighlightedValue={total}className="w-full"- data={props.data}+ data={data}yAxisKey="count"xAxisKey="timestamp"displayDateInUtc@@ -92,13 +101,23 @@ export const renderErrorCounts = (const total = props.data.reduce((acc, datum) => {return acc + datum.count}, 0)++ const data = useFillTimeseriesSorted(+ props.data,+ 'timestamp',+ 'count',+ 0,+ props.params?.iso_timestamp_start,+ props.params?.iso_timestamp_end+ )+return (<BarChartsize="small"minimalHeaderclassName="w-full"highlightedValue={total}- data={props.data}+ data={data}yAxisKey="count"xAxisKey="timestamp"displayDateInUtc@@ -116,6 +135,16 @@ export const renderResponseSpeed = (timestamp: datum.timestamp,avg: datum.avg,}))++ const data = useFillTimeseriesSorted(+ transformedData,+ 'timestamp',+ 'avg',+ 0,+ props.params?.iso_timestamp_start,+ props.params?.iso_timestamp_end+ )+const lastAvg = props.data[props.data.length - 1]?.avgreturn (<BarChart@@ -124,7 +153,7 @@ export const renderResponseSpeed = (format="ms"minimalHeaderclassName="w-full"- data={transformedData}+ data={data}yAxisKey="avg"xAxisKey="timestamp"displayDateInUtc@@ -171,14 +200,18 @@ const RouteTdContent = (datum: RouteTdContentProps) => (</div></Collapsible.Trigger><Collapsible.Content className="pt-2">- <pre className={`syntax-highlight overflow-auto rounded bg-scale-300 p-2 !text-xs`}>- <div- className="text-wrap"- dangerouslySetInnerHTML={{- __html: jsonSyntaxHighlight(queryParamsToObject(datum.search)),- }}- />- </pre>+ {datum.search ? (+ <pre className={`syntax-highlight overflow-auto rounded bg-scale-300 p-2 !text-xs`}>+ <div+ className="text-wrap"+ dangerouslySetInnerHTML={{+ __html: jsonSyntaxHighlight(queryParamsToObject(datum.search)),+ }}+ />+ </pre>+ ) : (+ <p className="text-xs text-scale-900">No query paramters in this request</p>+ )}</Collapsible.Content></Collapsible>)