-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
]), | ||
]) |
12 changes: 12 additions & 0 deletions
12
.../shared/routes/src/lib/routes/organizations/$organizationId/clusters/$clusterId/_logs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
), | ||
}) |
15 changes: 15 additions & 0 deletions
15
...d/routes/src/lib/routes/organizations/$organizationId/clusters/$clusterId/_logs/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}) |