mirror of
https://github.com/supabase/supabase.git
synced 2026-10-12 21:05:06 +03:00
* integrations refine * refactoring * integration page updates * div * clean up * prettier * Couple of minor refactors and fixes * Fix missing base path for integration card image * Fix editing a cron job in the previous job run tab, not updating the cron job details in the page header * Cron job bread crumb to use job name instead of id if available, and add loading state for cron job subtitle * Fixy fix * Small fi * ANother one * Do not reroute after purging queue * nit * Final final final v3 --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
65 lines
1.8 KiB
TypeScript
65 lines
1.8 KiB
TypeScript
import dayjs from 'dayjs'
|
|
import { useRouter } from 'next/router'
|
|
|
|
import { useParams } from 'common'
|
|
import { NavigationItem, PageLayout } from 'components/layouts/PageLayout/PageLayout'
|
|
import { useQueuesQuery } from 'data/database-queues/database-queues-query'
|
|
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
|
|
import { DATETIME_FORMAT } from 'lib/constants'
|
|
import { QueueTab } from './QueueTab'
|
|
|
|
export const QueuePage = () => {
|
|
const router = useRouter()
|
|
const { ref, id, pageId, childId } = useParams()
|
|
const childLabel = router?.query?.['child-label'] as string
|
|
const { data: project } = useSelectedProjectQuery()
|
|
|
|
const { data: queues } = useQueuesQuery({
|
|
projectRef: project?.ref,
|
|
connectionString: project?.connectionString,
|
|
})
|
|
|
|
const currentQueue = queues?.find((queue) => queue.queue_name === childId)
|
|
|
|
const breadcrumbItems = [
|
|
{
|
|
label: 'Integrations',
|
|
href: `/project/${ref}/integrations`,
|
|
},
|
|
{
|
|
label: 'Queues',
|
|
href: pageId
|
|
? `/project/${ref}/integrations/${id}/${pageId}`
|
|
: `/project/${ref}/integrations/${id}`,
|
|
},
|
|
{
|
|
label: childId,
|
|
},
|
|
]
|
|
|
|
const navigationItems: NavigationItem[] = []
|
|
|
|
const pageTitle = childLabel || childId || 'Queue'
|
|
|
|
const getQueueType = (queue: typeof currentQueue) => {
|
|
if (!queue) return 'Unknown'
|
|
return queue.is_partitioned ? 'Partitioned' : queue.is_unlogged ? 'Unlogged' : 'Basic'
|
|
}
|
|
|
|
const pageSubtitle = currentQueue
|
|
? `${getQueueType(currentQueue)} queue created on ${dayjs(currentQueue.created_at).format(DATETIME_FORMAT)}`
|
|
: undefined
|
|
|
|
return (
|
|
<PageLayout
|
|
title={pageTitle}
|
|
subtitle={pageSubtitle}
|
|
size="full"
|
|
breadcrumbs={breadcrumbItems}
|
|
navigationItems={navigationItems}
|
|
>
|
|
<QueueTab />
|
|
</PageLayout>
|
|
)
|
|
}
|