Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ctjhoa committed Jan 22, 2024
1 parent 5f705c5 commit d305580
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
42 changes: 42 additions & 0 deletions libs/shared/routes/src/lib/route-tree.gen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// This file is auto-generated by TanStack Router
// Import Routes
import { Route as rootRoute } from './routes/__root'
import { Route as OrganizationsOrganizationIdClustersClusterIdLogsImport } from './routes/organizations/$organizationId/clusters/$clusterId/_logs'
import { Route as OrganizationsOrganizationIdClustersClusterIdLogsIndexImport } from './routes/organizations/$organizationId/clusters/$clusterId/_logs/index'

// Create/Update Routes

const OrganizationsOrganizationIdClustersClusterIdLogsRoute =
OrganizationsOrganizationIdClustersClusterIdLogsImport.update({
path: '/organizations/$organizationId/clusters/$clusterId/logs',
getParentRoute: () => rootRoute,
} as any)

const OrganizationsOrganizationIdClustersClusterIdLogsIndexRoute =
OrganizationsOrganizationIdClustersClusterIdLogsIndexImport.update({
path: '/',
getParentRoute: () => OrganizationsOrganizationIdClustersClusterIdLogsRoute,
} as any)

// Populate the FileRoutesByPath interface

declare module '@tanstack/react-router' {
interface FileRoutesByPath {
'/organizations/$organizationId/clusters/$clusterId/_logs': {
preLoaderRoute: typeof OrganizationsOrganizationIdClustersClusterIdLogsImport
parentRoute: typeof rootRoute
}
'/organizations/$organizationId/clusters/$clusterId/_logs/': {
preLoaderRoute: typeof OrganizationsOrganizationIdClustersClusterIdLogsIndexImport
parentRoute: typeof OrganizationsOrganizationIdClustersClusterIdLogsImport
}
}
}

// Create and export the route tree

export const routeTree = rootRoute.addChildren([
OrganizationsOrganizationIdClustersClusterIdLogsRoute.addChildren([
OrganizationsOrganizationIdClustersClusterIdLogsIndexRoute,
]),
])
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { FileRoute, Outlet } from '@tanstack/react-router'
import { DarkModeEnabler, Layout } from '@qovery/pages/layout'

export const Route = new FileRoute('/organizations/$organizationId/clusters/$clusterId/_logs').createRoute({
component: () => (
<DarkModeEnabler isDarkMode>
<Layout topBar>
<Outlet />
</Layout>
</DarkModeEnabler>
),
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { FileRoute } from '@tanstack/react-router'
import { PageInfraLogs } from '@qovery/pages/logs/infra'
import { queries } from '@qovery/state/util-queries'

export const Route = new FileRoute('/organizations/$organizationId/clusters/$clusterId/_logs/').createRoute({
loader: async ({ context: { queryClient }, params: { organizationId, clusterId } }) => {
const clusters = await queryClient.ensureQueryData({ ...queries.clusters.list({ organizationId }) })
const cluster = (clusters ?? []).find(({ id }) => id === clusterId)
if (!cluster) {
throw Error('Unknown cluster')
}
return cluster
},
component: PageInfraLogs,
})

0 comments on commit d305580

Please sign in to comment.