diff --git a/ui/src/App.tsx b/ui/src/App.tsx index 062218a1..a64b337c 100644 --- a/ui/src/App.tsx +++ b/ui/src/App.tsx @@ -32,7 +32,7 @@ const router = createBrowserRouter([ element: , }, { - path: "logs/:namespace/:layerId?/:runId?", + path: "logs/:namespace?/:layerId?/:runId?", element: , }, ], diff --git a/ui/src/clients/layers/types.ts b/ui/src/clients/layers/types.ts index ea5def8f..2836cd02 100644 --- a/ui/src/clients/layers/types.ts +++ b/ui/src/clients/layers/types.ts @@ -3,7 +3,6 @@ export type Layers = { }; export type Layer = { - id: string; namespace: string; name: string; state: LayerState; diff --git a/ui/src/pages/Logs.tsx b/ui/src/pages/Logs.tsx index 2f3f8045..98c64f3d 100644 --- a/ui/src/pages/Logs.tsx +++ b/ui/src/pages/Logs.tsx @@ -22,7 +22,7 @@ import { Layer } from "@/clients/layers/types"; const Logs: React.FC = () => { const { theme } = useContext(ThemeContext); - const { layerId, runId } = useParams(); + const { namespace, layerId, runId } = useParams(); const [searchParams, setSerchParams] = useSearchParams(); const navigate = useNavigate(); @@ -113,7 +113,7 @@ const Logs: React.FC = () => { run ? `/${run}` : layer.latestRuns.length > 0 - ? `/${layer.lastRun}` + ? `/${layer.lastRun.id}` : "" }`, search: searchParams.toString(), @@ -249,7 +249,7 @@ const Logs: React.FC = () => { handleActive(layer)} handleActive={handleActive} layer={layer} @@ -273,7 +273,7 @@ const Logs: React.FC = () => { {layersQuery.isSuccess && layersQuery.data.results.length > 0 && (layerId && - layersQuery.data.results.some((layer) => layer.id === layerId) ? ( + layersQuery.data.results.some((layer) => layer.name === layerId) ? ( runId ? ( ((activeLayerObject) => activeLayerObject && ( @@ -284,7 +284,7 @@ const Logs: React.FC = () => { variant={theme} /> ))( - layersQuery.data.results.find((layer) => layer.id === layerId) + layersQuery.data.results.find((layer) => layer.name === layerId) ) ) : (