-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[UI] [Serve Replica] Making the log link works (#36659)
Perviously, the log link could not jump to the task page. Now, add a React Route in ServeReplicaDetailPage to make the log link jumping works
- Loading branch information
1 parent
fb087d6
commit 00d4461
Showing
3 changed files
with
59 additions
and
26 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
47 changes: 47 additions & 0 deletions
47
dashboard/client/src/pages/serve/ServeReplicaDetailLayout.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,47 @@ | ||
import { Typography } from "@material-ui/core"; | ||
import React from "react"; | ||
import { Outlet, useParams } from "react-router-dom"; | ||
import Loading from "../../components/Loading"; | ||
import { MainNavPageInfo } from "../layout/mainNavContext"; | ||
import { useServeReplicaDetails } from "./hook/useServeApplications"; | ||
|
||
export const ServeReplicaDetailLayout = () => { | ||
const { applicationName, deploymentName, replicaId } = useParams(); | ||
const { loading, application, deployment, replica, error } = | ||
useServeReplicaDetails(applicationName, deploymentName, replicaId); | ||
|
||
if (error) { | ||
return <Typography color="error">{error.toString()}</Typography>; | ||
} | ||
|
||
if (loading) { | ||
return <Loading loading />; | ||
} else if (!replica || !deployment || !application) { | ||
return ( | ||
<Typography color="error"> | ||
{applicationName} / {deploymentName} / {replicaId} not found. | ||
</Typography> | ||
); | ||
} | ||
|
||
const appName = application.name ? application.name : "-"; | ||
const { replica_id } = replica; | ||
|
||
return ( | ||
<div> | ||
<MainNavPageInfo | ||
pageInfo={{ | ||
id: "serveReplicaDetail", | ||
title: replica_id, | ||
pageTitle: `${replica_id} | Serve Replica`, | ||
path: `/serve/applications/${encodeURIComponent( | ||
appName, | ||
)}/${encodeURIComponent(deployment.name)}/${encodeURIComponent( | ||
replica_id, | ||
)}`, | ||
}} | ||
/> | ||
<Outlet /> | ||
</div> | ||
); | ||
}; |
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