Skip to content

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

clean up preview pages

Jonathan Summers-Muir163fc86b63bf
diff --git a/studio/components/interfaces/Settings/Logs/Logs.constants.ts b/studio/components/interfaces/Settings/Logs/Logs.constants.ts
index fd1f3341fcd..813c1feac1e 100644
--- a/studio/components/interfaces/Settings/Logs/Logs.constants.ts
+++ b/studio/components/interfaces/Settings/Logs/Logs.constants.ts
@@ -212,7 +212,7 @@ LIMIT 100
break
case 'function_edge_logs':
- return `select id, ${table}.timestamp, event_message, response.status_code, response, request, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.time, m.version from ${table}
+ return `select id, ${table}.timestamp, event_message, response.status_code, response, request, request.method, m.function_id, m.execution_time_ms, m.deployment_id, m.version from ${table}
cross join unnest(metadata) as m
cross join unnest(m.response) as response
cross join unnest(m.request) as request
diff --git a/studio/components/interfaces/Settings/Logs/Logs.helpers.ts b/studio/components/interfaces/Settings/Logs/Logs.helpers.ts
index 9345977cfff..81cd791cd49 100644
--- a/studio/components/interfaces/Settings/Logs/Logs.helpers.ts
+++ b/studio/components/interfaces/Settings/Logs/Logs.helpers.ts
@@ -4,7 +4,7 @@ import { FilterObject, Override } from './Logs.types'
export function filterSqlWhereBuilder(
filters: FilterObject | any,
table: LogsTableName,
- override: Override
+ override?: Override
) {
let count = 0
@@ -21,7 +21,7 @@ export function filterSqlWhereBuilder(
if (filtersSanitized.length === 0 && !hasOverride) return whereArray
- if (override.key && override) {
+ if (hasOverride) {
console.log('override', override)
count = +1
const sql = `${override.key}='${override.value}'`
diff --git a/studio/pages/project/[ref]/functions/[id]/invocations.tsx b/studio/pages/project/[ref]/functions/[id]/invocations.tsx
index 97efe358221..03d57ea3ee4 100644
--- a/studio/pages/project/[ref]/functions/[id]/invocations.tsx
+++ b/studio/pages/project/[ref]/functions/[id]/invocations.tsx
@@ -1,34 +1,9 @@
-// import React, { useState } from 'react'
-// import { NextPage } from 'next'
-// import { withAuth } from 'hooks'
-
-// import { observer } from 'mobx-react-lite'
-
-// // import LogWrapper from 'components/interfaces/Settings/Logs/LogWrapper'
-
-// import { Button, Toggle } from '@supabase/ui'
-// import { QueryType, Mode } from 'components/interfaces/Settings/Logs'
-// import FunctionLayout from '../interfaces/FunctionLayout'
-
-// export const LogPage: NextPage = () => {
-// // ! custom is SQL only logging !
-
-// return (
-// <>
-// <FunctionLayout>{/* <LogWrapper type={'fn_edge'} mode={'simple'} /> */}</FunctionLayout>
-// </>
-// )
-// }
-
-// export default withAuth(observer(LogPage))
-
import React from 'react'
import { NextPage } from 'next'
import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
import { withAuth } from 'hooks'
-import { SettingsLayout } from 'components/layouts/'
-import { LOG_TYPE_LABEL_MAPPING, QueryType } from 'components/interfaces/Settings/Logs'
+import { LOG_TYPE_LABEL_MAPPING } from 'components/interfaces/Settings/Logs'
import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer'
import FunctionLayout from '../interfaces/FunctionLayout'
@@ -39,15 +14,13 @@ export const LogPage: NextPage = () => {
const router = useRouter()
const { ref, type, id } = router.query
- const title = `Logs - ${LOG_TYPE_LABEL_MAPPING[type as keyof typeof LOG_TYPE_LABEL_MAPPING]}`
+ const title = `Invocation Logs - ${
+ LOG_TYPE_LABEL_MAPPING[type as keyof typeof LOG_TYPE_LABEL_MAPPING]
+ }`
return (
<FunctionLayout title={title}>
- <LogsPreviewer
- projectRef={ref as string}
- queryType={'fn_edge'}
- override={{ key: 'metadata.function_id', value: id }}
- />
+ <LogsPreviewer projectRef={ref as string} queryType={'fn_edge'} />
</FunctionLayout>
)
}
diff --git a/studio/pages/project/[ref]/functions/[id]/logs.tsx b/studio/pages/project/[ref]/functions/[id]/logs.tsx
index 8d27ced48c0..22ec95b12c8 100644
--- a/studio/pages/project/[ref]/functions/[id]/logs.tsx
+++ b/studio/pages/project/[ref]/functions/[id]/logs.tsx
@@ -1,34 +1,9 @@
-// import React, { useState } from 'react'
-// import { NextPage } from 'next'
-// import { withAuth } from 'hooks'
-
-// import { observer } from 'mobx-react-lite'
-
-// // import LogWrapper from 'components/interfaces/Settings/Logs/LogWrapper'
-
-// import { Button, Toggle } from '@supabase/ui'
-// import { QueryType, Mode } from 'components/interfaces/Settings/Logs'
-// import FunctionLayout from '../interfaces/FunctionLayout'
-
-// export const LogPage: NextPage = () => {
-// // ! custom is SQL only logging !
-
-// return (
-// <>
-// <FunctionLayout>{/* <LogWrapper type={'functions'} mode={'simple'} /> */}</FunctionLayout>
-// </>
-// )
-// }
-
-// export default withAuth(observer(LogPage))
-
import React from 'react'
import { NextPage } from 'next'
import { useRouter } from 'next/router'
import { observer } from 'mobx-react-lite'
-import { useStore, withAuth } from 'hooks'
-import { SettingsLayout } from 'components/layouts/'
-import { LOG_TYPE_LABEL_MAPPING, QueryType } from 'components/interfaces/Settings/Logs'
+import { withAuth } from 'hooks'
+import { LOG_TYPE_LABEL_MAPPING } from 'components/interfaces/Settings/Logs'
import LogsPreviewer from 'components/interfaces/Settings/Logs/LogsPreviewer'
import FunctionLayout from '../interfaces/FunctionLayout'
@@ -39,11 +14,9 @@ export const LogPage: NextPage = () => {
const router = useRouter()
const { ref, type, id } = router.query
- const { functions } = useStore()
-
- console.log('id', id)
-
- const title = `Logs - ${LOG_TYPE_LABEL_MAPPING[type as keyof typeof LOG_TYPE_LABEL_MAPPING]}`
+ const title = `Function Logs - ${
+ LOG_TYPE_LABEL_MAPPING[type as keyof typeof LOG_TYPE_LABEL_MAPPING]
+ }`
return (
<FunctionLayout title={title}>