@@ -17,7 +17,11 @@ import { JobDetailInfoPage } from "./pages/job/JobDetailInfoPage";
1717import { JobDetailLayout , JobPage } from "./pages/job/JobDetailLayout" ;
1818import { MainNavLayout } from "./pages/layout/MainNavLayout" ;
1919import { SideTabPage } from "./pages/layout/SideTabLayout" ;
20- import { LogsLayout } from "./pages/log/Logs" ;
20+ import {
21+ LogsLayout ,
22+ StateApiLogsListPage ,
23+ StateApiLogViewerPage ,
24+ } from "./pages/log/Logs" ;
2125import { Metrics } from "./pages/metrics" ;
2226import { DashboardUids , getMetricsInfo } from "./pages/metrics/utils" ;
2327import Nodes , { ClusterMainPageLayout } from "./pages/node" ;
@@ -50,13 +54,11 @@ dayjs.extend(duration);
5054// lazy loading fro prevent loading too much code at once
5155const Actors = React . lazy ( ( ) => import ( "./pages/actor" ) ) ;
5256const CMDResult = React . lazy ( ( ) => import ( "./pages/cmd/CMDResult" ) ) ;
53- const Logs = React . lazy ( ( ) => import ( "./pages/log/Logs" ) ) ;
5457
5558// a global map for relations
5659export type GlobalContextType = {
5760 nodeMap : { [ key : string ] : string } ;
5861 nodeMapByIp : { [ key : string ] : string } ;
59- ipLogMap : { [ key : string ] : string } ;
6062 namespaceMap : { [ key : string ] : string [ ] } ;
6163 /**
6264 * Whether the initial metrics context has been fetched or not.
@@ -89,7 +91,6 @@ export type GlobalContextType = {
8991export const GlobalContext = React . createContext < GlobalContextType > ( {
9092 nodeMap : { } ,
9193 nodeMapByIp : { } ,
92- ipLogMap : { } ,
9394 namespaceMap : { } ,
9495 metricsContextLoaded : false ,
9596 grafanaHost : undefined ,
@@ -103,7 +104,6 @@ const App = () => {
103104 const [ context , setContext ] = useState < GlobalContextType > ( {
104105 nodeMap : { } ,
105106 nodeMapByIp : { } ,
106- ipLogMap : { } ,
107107 namespaceMap : { } ,
108108 metricsContextLoaded : false ,
109109 grafanaHost : undefined ,
@@ -117,17 +117,14 @@ const App = () => {
117117 if ( res ?. data ?. data ?. summary ) {
118118 const nodeMap = { } as { [ key : string ] : string } ;
119119 const nodeMapByIp = { } as { [ key : string ] : string } ;
120- const ipLogMap = { } as { [ key : string ] : string } ;
121- res . data . data . summary . forEach ( ( { hostname, raylet, ip, logUrl } ) => {
120+ res . data . data . summary . forEach ( ( { hostname, raylet, ip } ) => {
122121 nodeMap [ hostname ] = raylet . nodeId ;
123122 nodeMapByIp [ ip ] = raylet . nodeId ;
124- ipLogMap [ ip ] = logUrl ;
125123 } ) ;
126124 setContext ( ( existingContext ) => ( {
127125 ...existingContext ,
128126 nodeMap,
129127 nodeMapByIp,
130- ipLogMap,
131128 namespaceMap : { } ,
132129 } ) ) ;
133130 }
@@ -285,12 +282,8 @@ const App = () => {
285282 </ Route >
286283 </ Route >
287284 < Route element = { < LogsLayout /> } path = "logs" >
288- { /* TODO(aguo): Refactor Logs component to use optional query
289- params since react-router 6 doesn't support optional path params... */ }
290- < Route element = { < Logs /> } path = "" />
291- < Route element = { < Logs /> } path = ":host" >
292- < Route element = { < Logs /> } path = ":path" />
293- </ Route >
285+ < Route element = { < StateApiLogsListPage /> } path = "" />
286+ < Route element = { < StateApiLogViewerPage /> } path = "viewer" />
294287 </ Route >
295288 </ Route >
296289 < Route element = { < CMDResult /> } path = "/cmd/:cmd/:ip/:pid" />
0 commit comments