diff --git a/studio/components/interfaces/Settings/Logs/LogSelection.tsx b/studio/components/interfaces/Settings/Logs/LogSelection.tsx index 6794ac639b8..576113e9012 100644 --- a/studio/components/interfaces/Settings/Logs/LogSelection.tsx +++ b/studio/components/interfaces/Settings/Logs/LogSelection.tsx @@ -16,9 +16,10 @@ interface Props { log: LogData | null onClose: () => void queryType?: QueryType + isLoading?: boolean } -const LogSelection: FC = ({ log, onClose, queryType }) => { +const LogSelection: FC = ({ log, onClose, queryType, isLoading }) => { const Formatter = () => { switch (queryType) { case 'api': @@ -59,13 +60,13 @@ const LogSelection: FC = ({ log, onClose, queryType }) => { className={[ 'relative h-full flex flex-col flex-grow border border-l', 'border-panel-border-light dark:border-panel-border-dark', - 'bg-gray-200', + 'bg-gray-200 overflow-y-scroll', ].join(' ')} >
@@ -73,7 +74,7 @@ const LogSelection: FC = ({ log, onClose, queryType }) => { className={ `transition-all duration-500 - delay-200 + delay-300 w-full flex flex-col @@ -81,7 +82,8 @@ const LogSelection: FC = ({ log, onClose, queryType }) => { items-center gap-6 max-w-sm - text-center ` + (log ? 'mt-0 opacity-0 scale-95' : 'mt-8 opacity-100 scale-100') + text-center scale-95 opacity-0 ` + + (log || isLoading ? 'mt-0 opacity-0 scale-95' : 'mt-8 opacity-100 scale-100') } >
@@ -112,23 +114,21 @@ const LogSelection: FC = ({ log, onClose, queryType }) => {
-
+
-
- -
-
{log && }
+
+
{log && }
) diff --git a/studio/components/interfaces/Settings/Logs/LogTable.tsx b/studio/components/interfaces/Settings/Logs/LogTable.tsx index 76a51f7c79a..15738955037 100644 --- a/studio/components/interfaces/Settings/Logs/LogTable.tsx +++ b/studio/components/interfaces/Settings/Logs/LogTable.tsx @@ -1,6 +1,15 @@ import dayjs from 'dayjs' import { useEffect, useState, useMemo } from 'react' -import { Button, IconDownloadCloud, IconEye, IconEyeOff, Typography } from '@supabase/ui' +import { + Alert, + Button, + IconDownloadCloud, + IconEye, + IconEyeOff, + IconLoader, + Input, + Typography, +} from '@supabase/ui' import DataGrid from '@supabase/react-data-grid' import LogSelection from './LogSelection' @@ -16,6 +25,8 @@ interface Props { queryType?: QueryType onHistogramToggle?: () => void isHistogramShowing?: boolean + isLoading?: boolean + error?: any } type LogMap = { [id: string]: LogData } @@ -24,7 +35,14 @@ type LogMap = { [id: string]: LogData } * * When in custom data display mode, the side panel will not open when focusing on logs. */ -const LogTable = ({ data = [], queryType, onHistogramToggle, isHistogramShowing }: Props) => { +const LogTable = ({ + data = [], + queryType, + onHistogramToggle, + isHistogramShowing, + isLoading, + error, +}: Props) => { const [focusedLog, setFocusedLog] = useState(null) const columnNames = Object.keys(data[0] || {}) const hasId = columnNames.includes('id') @@ -183,7 +201,7 @@ const LogTable = ({ data = [], queryType, onHistogramToggle, isHistogramShowing return ( <>
{!queryType && ( @@ -197,6 +215,7 @@ const LogTable = ({ data = [], queryType, onHistogramToggle, isHistogramShowing border-l border-r + flex items-center justify-between px-5 py-2 " @@ -228,7 +247,9 @@ const LogTable = ({ data = [], queryType, onHistogramToggle, isHistogramShowing )} -
+
- - No data returned from query - -
+ !isLoading ? ( + <> +
+
+
+
+
+
+ + + +
+
+
+
+

No results

+

+ Try another search, or adjusting the filters +

+
+
+ {error && ( +
+ + + +
+ )} +
+ + ) : null } columns={columns as any} rowClass={(r) => { @@ -269,19 +356,24 @@ const LogTable = ({ data = [], queryType, onHistogramToggle, isHistogramShowing }} onRowClick={(r) => setFocusedLog(r)} /> - {/* {focusedLog && ( */} -
- setFocusedLog(null)} - log={focusedLog} - queryType={queryType} - /> -
- {/* )} */} + {logDataRows.length > 0 ? ( +
+ setFocusedLog(null)} + log={focusedLog} + queryType={queryType} + /> +
+ ) : null}
diff --git a/studio/components/interfaces/Settings/Logs/LogsPreviewer.tsx b/studio/components/interfaces/Settings/Logs/LogsPreviewer.tsx index da23e27deef..4fa7164ee1c 100644 --- a/studio/components/interfaces/Settings/Logs/LogsPreviewer.tsx +++ b/studio/components/interfaces/Settings/Logs/LogsPreviewer.tsx @@ -166,7 +166,9 @@ export const LogsPreviewer: React.FC = ({ projectRef, queryType, override
0 + ? 'opacity-100 h-48 pt-4 mb-4' + : 'opacity-0 h-0') } >
@@ -182,6 +184,7 @@ export const LogsPreviewer: React.FC = ({ projectRef, queryType, override = ({
} loading={isLoading} + disabled={isLoading} onClick={onRefresh} > Refresh diff --git a/studio/pages/project/[ref]/functions/[id]/index.tsx b/studio/pages/project/[ref]/functions/[id]/index.tsx index 647b5b3fc5c..21b286dd1cd 100644 --- a/studio/pages/project/[ref]/functions/[id]/index.tsx +++ b/studio/pages/project/[ref]/functions/[id]/index.tsx @@ -119,25 +119,32 @@ const PageLayout = () => { return ( -
+
- - {CHART_INTERVALS.map((i) => ( - - {i.label} - - ))} - - } - > - - +
+ {CHART_INTERVALS.map((item, i) => { + const classes = [] + + if (i === 0) { + classes.push('rounded-tr-none rounded-br-none') + } else if (i === CHART_INTERVALS.length - 1) { + classes.push('rounded-tl-none rounded-bl-none') + } else { + classes.push('rounded-none') + } + + return ( + + ) + })} +
Statistics for past {selectedInterval.label} @@ -170,7 +177,7 @@ const PageLayout = () => { /> - + {
+ + + handleBarClick(v, '/auth')} + /> + + )}
diff --git a/studio/pages/project/[ref]/logs-explorer/index.tsx b/studio/pages/project/[ref]/logs-explorer/index.tsx index 309cd947dc1..bc6a563ece8 100644 --- a/studio/pages/project/[ref]/logs-explorer/index.tsx +++ b/studio/pages/project/[ref]/logs-explorer/index.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react' import { NextPage } from 'next' import { useRouter } from 'next/router' import { observer } from 'mobx-react-lite' -import { Typography, IconAlertCircle, Card, Input } from '@supabase/ui' +import { Typography, IconAlertCircle, Card, Input, Alert } from '@supabase/ui' import { withAuth } from 'hooks' import CodeEditor from 'components/ui/CodeEditor' import { @@ -88,32 +88,12 @@ export const LogsExplorerPage: NextPage = () => { />
-
- +
- - {error && ( -
- -
- - - Sorry! An error occured when fetching data. - -
- -
-
- )}