Skip to content

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

added logs path to projects settings

TzeYiingf7fc87df25c7
diff --git a/studio/pages/project/[ref]/settings/logs/[type].tsx b/studio/pages/project/[ref]/settings/logs/[type].tsx
new file mode 100644
index 00000000000..9108b76e6cf
--- /dev/null
+++ b/studio/pages/project/[ref]/settings/logs/[type].tsx
@@ -0,0 +1,36 @@
+import React, { useEffect, useState } from 'react'
+import { SettingsLayout } from 'components/layouts'
+import { useRouter } from 'next/router'
+import LogPanel from 'components/ui/Logs/LogPanel'
+import { LOG_TYPE_LABEL_MAPPING } from 'lib/constants'
+import { observer } from 'mobx-react-lite'
+import { withAuth } from 'hooks'
+import { get } from "lib/common/fetch"
+/**
+ * Acts as a container component for the entire log display
+ */
+const LogPage = () => {
+ const router = useRouter()
+ const { ref, type } = router.query
+ const title = LOG_TYPE_LABEL_MAPPING[type]
+ const [loading, setLoading] = useState(false)
+ const [data, setData] = useState(null)
+
+ useEffect(() => {
+ handleFetch()
+ }, [])
+ const handleFetch = async () => {
+ setLoading(true)
+ const result = await get(`${process.env.NEXT_PUBLIC_PLATFORM_API_URL}/projects/${ref}/logs?type=${type}`)
+ console.log('handleFetch', data)
+ setData(result)
+ setLoading(false)
+ }
+ return (
+ <SettingsLayout title={title}>
+ <LogPanel isLoading={loading} onRefresh={handleFetch} />
+ </SettingsLayout>
+ )
+}
+
+export default withAuth(observer(LogPage))
\ No newline at end of file