Skip to content

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

Added sidebar menu items for logs

TzeYiinge90411ae0609
diff --git a/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts b/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
index 9d3d998a8b8..047fd38ce6a 100644
--- a/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
+++ b/studio/components/layouts/SettingsLayout/SettingsMenu.utils.ts
@@ -1,6 +1,15 @@
import { ProductMenuGroup } from 'components/ui/ProductMenu/ProductMenu.types'
-
+import { LOG_TYPE_LABEL_MAPPING } from "lib/constants"
export const generateSettingsMenu = (ref: string): ProductMenuGroup[] => {
+ const logItems = ['rest', 'realtime', 'auth', 'storage', 'database'].map((type: string) => {
+ return {
+ name: LOG_TYPE_LABEL_MAPPING[type],
+ key: `logs-${type}`,
+ url: `/project/${ref}/settings/logs/${type}`,
+ items: []
+ }
+ })
+
return [
{
title: 'Project settings',
@@ -17,5 +26,9 @@ export const generateSettingsMenu = (ref: string): ProductMenuGroup[] => {
},
],
},
+ {
+ title: 'Logs',
+ items: logItems,
+ },
]
}
diff --git a/studio/lib/constants.js b/studio/lib/constants.tsx
similarity index 96%
rename from studio/lib/constants.js
rename to studio/lib/constants.tsx
index 99549324a8a..773ba9a9f21 100644
--- a/studio/lib/constants.js
+++ b/studio/lib/constants.tsx
@@ -1,3 +1,4 @@
+// @ts-nocheck
import { IconArchive, IconDatabase, IconHeart, IconKey } from '@supabase/ui'
import { concat, sortBy } from 'lodash'
@@ -360,28 +361,28 @@ export const METRIC_CATEGORIES = {
// },
API_DATABASE: {
label: 'Database API',
- icon: <IconDatabase size={METRIC_CATEGORIES_ICON_SIZE} />,
- key: 'api_database',
- },
- API_AUTH: {
- label: 'Auth API',
- icon: <IconKey size={METRIC_CATEGORIES_ICON_SIZE} />,
- key: 'api_auth',
- },
- API_STORAGE: {
- label: 'Storage API',
- icon: <IconArchive size={METRIC_CATEGORIES_ICON_SIZE} />,
- key: 'api_storage',
- },
- // API_REALTIME: {
- // label: 'Realtime API',
- // icon: '',
- // key: 'api_realtime',
- // },
- INSTANCE: {
- label: 'Instance health',
- icon: <IconHeart size={METRIC_CATEGORIES_ICON_SIZE} />,
- key: 'instance',
+ icon: <IconDatabase size={ METRIC_CATEGORIES_ICON_SIZE } />,
+key: 'api_database',
+ },
+API_AUTH: {
+ label: 'Auth API',
+ icon: <IconKey size={ METRIC_CATEGORIES_ICON_SIZE } />,
+ key: 'api_auth',
+ },
+API_STORAGE: {
+ label: 'Storage API',
+ icon: <IconArchive size={ METRIC_CATEGORIES_ICON_SIZE } />,
+ key: 'api_storage',
+ },
+// API_REALTIME: {
+// label: 'Realtime API',
+// icon: '',
+// key: 'api_realtime',
+// },
+INSTANCE: {
+ label: 'Instance health',
+ icon: <IconHeart size={ METRIC_CATEGORIES_ICON_SIZE } />,
+ key: 'instance',
},
// POSTGRES: {
// label: 'Postgres usage',
@@ -800,3 +801,11 @@ export const PASSWORD_STRENGTH_PERCENTAGE = {
3: '80%',
4: '100%',
}
+
+export const LOG_TYPE_LABEL_MAPPING: { [k: string]: string } = {
+ rest: 'Edge - PostgREST',
+ realtime: 'Edge - Realtime',
+ auth: 'Edge - Auth',
+ storage: 'Edge - Storage',
+ database: 'Database',
+}
\ No newline at end of file