chore: prettier

This commit is contained in:
TzeYiing authored and Ziinc committed 2023-03-01 19:37:06 +08:00
1 parent 818bf0aedf
commit 2494eeea8b
7 files changed
+53 -37

No files matched your search

@@ -73,4 +73,4 @@ export const renderResponseSpeed = (
displayDateInUtc
/>
)
}
}
@@ -1,7 +1,8 @@
import dayjs from 'dayjs'
import { DatetimeHelper, FilterTableSet, LogTemplate } from '.'
export const LOGS_EXPLORER_DOCS_URL = "https://supabase.com/docs/guides/platform/logs#querying-with-the-logs-explorer"
export const LOGS_EXPLORER_DOCS_URL =
'https://supabase.com/docs/guides/platform/logs#querying-with-the-logs-explorer'
export const LOGS_LARGE_DATE_RANGE_DAYS_THRESHOLD = 4
@@ -276,19 +277,19 @@ export const SQL_FILTER_TEMPLATES: any = {
},
auth_logs: {
..._SQL_FILTER_COMMON,
"severity.error": `REGEXP_CONTAINS(event_message, "level.{3}error|level.{3}fatal")`,
"severity.warning": `REGEXP_CONTAINS(event_message, "level.{3}warning")`,
"severity.info": `REGEXP_CONTAINS(event_message, "level.{3}info")`,
"status_code.server_error": `REGEXP_CONTAINS(event_message, "status.{3}5[0-9]{2}")`,
"status_code.client_error": `REGEXP_CONTAINS(event_message, "status.{3}4[0-9]{2}")`,
"status_code.redirection": `REGEXP_CONTAINS(event_message, "status.{3}3[0-9]{2}")`,
"status_code.success": `REGEXP_CONTAINS(event_message, "status.{3}2[0-9]{2}")`,
"endpoints.admin": `REGEXP_CONTAINS(event_message, "path.{3}/admin")`,
"endpoints.signup": `REGEXP_CONTAINS(event_message, "path.{3}/signup|path.{3}/invite|path.{3}/verify")`,
"endpoints.authentication": `REGEXP_CONTAINS(event_message, "path.{3}/token|path.{3}/authorize|path.{3}/callback|path.{3}/otp|path.{3}/magiclink")`,
"endpoints.recover": `REGEXP_CONTAINS(event_message, "path.{3}/recover")`,
"endpoints.user": `REGEXP_CONTAINS(event_message, "path.{3}/user")`,
"endpoints.logout": `REGEXP_CONTAINS(event_message, "path.{3}/logout")`,
'severity.error': `REGEXP_CONTAINS(event_message, "level.{3}error|level.{3}fatal")`,
'severity.warning': `REGEXP_CONTAINS(event_message, "level.{3}warning")`,
'severity.info': `REGEXP_CONTAINS(event_message, "level.{3}info")`,
'status_code.server_error': `REGEXP_CONTAINS(event_message, "status.{3}5[0-9]{2}")`,
'status_code.client_error': `REGEXP_CONTAINS(event_message, "status.{3}4[0-9]{2}")`,
'status_code.redirection': `REGEXP_CONTAINS(event_message, "status.{3}3[0-9]{2}")`,
'status_code.success': `REGEXP_CONTAINS(event_message, "status.{3}2[0-9]{2}")`,
'endpoints.admin': `REGEXP_CONTAINS(event_message, "path.{3}/admin")`,
'endpoints.signup': `REGEXP_CONTAINS(event_message, "path.{3}/signup|path.{3}/invite|path.{3}/verify")`,
'endpoints.authentication': `REGEXP_CONTAINS(event_message, "path.{3}/token|path.{3}/authorize|path.{3}/callback|path.{3}/otp|path.{3}/magiclink")`,
'endpoints.recover': `REGEXP_CONTAINS(event_message, "path.{3}/recover")`,
'endpoints.user': `REGEXP_CONTAINS(event_message, "path.{3}/user")`,
'endpoints.logout': `REGEXP_CONTAINS(event_message, "path.{3}/logout")`,
},
realtime_logs: {
..._SQL_FILTER_COMMON,
@@ -301,7 +302,7 @@ export const SQL_FILTER_TEMPLATES: any = {
},
pgbouncer_logs: {
..._SQL_FILTER_COMMON,
}
},
}
export enum LogsTableName {
@@ -312,8 +313,8 @@ export enum LogsTableName {
AUTH = 'auth_logs',
REALTIME = 'realtime_logs',
STORAGE = 'storage_logs',
PGBOUNCER = "pgbouncer_logs",
POSTGREST = "postgrest_logs"
PGBOUNCER = 'pgbouncer_logs',
POSTGREST = 'postgrest_logs',
}
export const LOGS_TABLES = {
@@ -325,7 +326,7 @@ export const LOGS_TABLES = {
realtime: LogsTableName.REALTIME,
storage: LogsTableName.STORAGE,
postgrest: LogsTableName.POSTGREST,
pgbouncer: LogsTableName.PGBOUNCER
pgbouncer: LogsTableName.PGBOUNCER,
}
export const LOGS_SOURCE_DESCRIPTION = {
@@ -587,7 +588,7 @@ export const FILTER_OPTIONS: FilterTableSet = {
},
{
key: 'recover',
label: "Password Recovery",
label: 'Password Recovery',
description: 'Show all password recovery requests',
},
{
@@ -607,7 +608,7 @@ export const FILTER_OPTIONS: FilterTableSet = {
},
],
},
}
},
}
export const LOGS_TAILWIND_CLASSES = {
@@ -84,8 +84,8 @@ export type QueryType =
| 'auth'
| 'realtime'
| 'storage'
| "pgbouncer"
| "postgrest"
| 'pgbouncer'
| 'postgrest'
export type Mode = 'simple' | 'custom'
@@ -20,15 +20,15 @@ export const generateReportsMenu = (project?: Project): ProductMenuGroup[] => {
},
{
items: [
...(productReports
? [
{
name: 'API',
key: 'api-overview',
url: `/project/${ref}/reports/api-overview`,
items: [],
},
]
...(productReports
? [
{
name: 'API',
key: 'api-overview',
url: `/project/${ref}/reports/api-overview`,
items: [],
},
]
: []),
{
name: 'Database',
@@ -26,8 +26,14 @@ export const AreaChart = () => (
{ title: 'No title', props: { title: undefined } },
{ title: 'Minimal Header', props: { minimalHeader: true } },
{ title: 'Minimal Highlighted Value', props: { minimalHeader: true, highlightedValue: 123 } },
{ title: 'Highlighted Value', props: { highlightedValue: 123, highlightedLabel: "some custom label" } },
{ title: 'Formatter - Auto 2 Precision for floats', props: { data: DATA.map(d=> ({...d, ram_usage: d.ram_usage + 0.1231233})) } },
{
title: 'Highlighted Value',
props: { highlightedValue: 123, highlightedLabel: 'some custom label' },
},
{
title: 'Formatter - Auto 2 Precision for floats',
props: { data: DATA.map((d) => ({ ...d, ram_usage: d.ram_usage + 0.1231233 })) },
},
{ title: 'UTC Dates', props: { displayDateInUtc: true } },
{ title: 'Custom date format', props: { customDateFormat: 'HH:mm' } },
{ title: 'Value format', props: { format: 'c' } },
@@ -26,8 +26,14 @@ export const BarChart = () => (
{ title: 'No title', props: { title: undefined } },
{ title: 'Minimal Header', props: { minimalHeader: true } },
{ title: 'Minimal Highlighted Value', props: { minimalHeader: true, highlightedValue: 123 } },
{ title: 'Highlighted Value', props: { highlightedValue: 123, highlightedLabel: "some custom label" } },
{ title: 'Formatter - Auto 2 Precision for floats', props: { data: DATA.map(d=> ({...d, ram_usage: d.ram_usage + 0.1231233})) } },
{
title: 'Highlighted Value',
props: { highlightedValue: 123, highlightedLabel: 'some custom label' },
},
{
title: 'Formatter - Auto 2 Precision for floats',
props: { data: DATA.map((d) => ({ ...d, ram_usage: d.ram_usage + 0.1231233 })) },
},
{ title: 'UTC Dates', props: { displayDateInUtc: true } },
{ title: 'Custom date format', props: { customDateFormat: 'HH:mm' } },
{ title: 'Value format', props: { format: 'c' } },
+4 -1
View File
@@ -10,7 +10,10 @@ import {
import { useProjectContext } from 'components/layouts/ProjectLayout/ProjectContext'
import { executeSql } from 'data/sql/execute-sql-query'
type UseDbQuery = (sql: ReportQuery["sql"], params?: BaseReportParams) => [DbQueryData, DbQueryHandler]
type UseDbQuery = (
sql: ReportQuery['sql'],
params?: BaseReportParams
) => [DbQueryData, DbQueryHandler]
const useDbQuery: UseDbQuery = (sql, params = DEFAULT_QUERY_PARAMS) => {
const { project } = useProjectContext()