mirror of
https://github.com/supabase/supabase.git
synced 2026-10-07 18:35:07 +03:00
* feat: groundwork for disabling features * update to use profile endpoint & disable features * fix ts error * add useIsFeatureEnabled mock * fix merge conflicts * fix test * upgrade to pro * prettier * add more billing enabled feature checks * disable more stuff * update useIsFeatureEnabled hook * Fix database reports disk size * Fix database reports disk size * disable log sources * disable moar things * Tiny fix --------- Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com> Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
86 lines
2.3 KiB
TypeScript
86 lines
2.3 KiB
TypeScript
import { Project } from 'types'
|
|
import { ProductMenuGroup, ProductMenuGroupItem } from 'components/ui/ProductMenu/ProductMenu.types'
|
|
import { IS_PLATFORM } from 'lib/constants'
|
|
|
|
export const generateLogsMenu = (
|
|
project?: Project,
|
|
features?: { auth?: boolean; storage?: boolean }
|
|
): ProductMenuGroup[] => {
|
|
const ref = project?.ref ?? 'default'
|
|
|
|
const authEnabled = features?.auth ?? true
|
|
const storageEnabled = features?.storage ?? true
|
|
|
|
return [
|
|
{
|
|
title: 'Logs Explorer',
|
|
items: (
|
|
[
|
|
{ key: 'explorer', name: 'Query', root: true },
|
|
IS_PLATFORM ? { key: 'saved', name: 'Saved Queries' } : null,
|
|
{ key: 'recent', name: 'Recent Queries' },
|
|
{ key: 'templates', name: 'Templates' },
|
|
].filter((item) => item) as { name: string; key: string; root: boolean }[]
|
|
).map(({ key, name, root }) => ({
|
|
name,
|
|
key,
|
|
url: `/project/${ref}/logs/explorer${root ? '' : '/' + key}`,
|
|
items: [],
|
|
})),
|
|
},
|
|
{
|
|
items: [
|
|
{
|
|
name: IS_PLATFORM ? 'API Edge Network' : 'Kong API',
|
|
key: 'edge-logs',
|
|
url: `/project/${ref}/logs/edge-logs`,
|
|
items: [],
|
|
},
|
|
{
|
|
name: 'Postgres',
|
|
key: 'postgres-logs',
|
|
url: `/project/${ref}/logs/postgres-logs`,
|
|
items: [],
|
|
},
|
|
{
|
|
name: 'PostgREST',
|
|
key: 'postgrest-logs',
|
|
url: `/project/${ref}/logs/postgrest-logs`,
|
|
items: [],
|
|
},
|
|
IS_PLATFORM
|
|
? {
|
|
name: 'Pooler',
|
|
key: 'pooler-logs',
|
|
url: `/project/${ref}/logs/pooler-logs`,
|
|
items: [],
|
|
}
|
|
: null,
|
|
,
|
|
authEnabled
|
|
? {
|
|
name: 'Auth',
|
|
key: 'auth-logs',
|
|
url: `/project/${ref}/logs/auth-logs`,
|
|
items: [],
|
|
}
|
|
: null,
|
|
storageEnabled
|
|
? {
|
|
name: 'Storage',
|
|
key: 'storage-logs',
|
|
url: `/project/${ref}/logs/storage-logs`,
|
|
items: [],
|
|
}
|
|
: null,
|
|
{
|
|
name: 'Realtime',
|
|
key: 'realtime-logs',
|
|
url: `/project/${ref}/logs/realtime-logs`,
|
|
items: [],
|
|
},
|
|
].filter((item) => item) as ProductMenuGroupItem[],
|
|
},
|
|
]
|
|
}
|