Merge branch '20219-log-api' into main. Closes #20219
[arvados-workbench2.git] / src / store / process-logs-panel / process-logs-panel.ts
index 74a18041bcc9e07f9f28000c8ab10588f6be0e50..531d3723c63fb93e97eb3b7e81a9aaf5bfdae186 100644 (file)
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { matchProcessLogRoute, matchProcessRoute } from 'routes/routes';
+import { matchProcessRoute } from 'routes/routes';
 import { RouterState } from 'react-router-redux';
 
 export interface ProcessLogsPanel {
@@ -12,15 +12,15 @@ export interface ProcessLogsPanel {
 }
 
 export interface ProcessLogs {
-    [logType: string]: string[];
+    [logType: string]: {lastByte: number | undefined, contents: string[]};
 }
 
-export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel) => {
-    return logs[selectedFilter];
+export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel): string[] => {
+    return logs[selectedFilter]?.contents || [];
 };
 
 export const getProcessLogsPanelCurrentUuid = (router: RouterState) => {
     const pathname = router.location ? router.location.pathname : '';
-    const match = matchProcessLogRoute(pathname) || matchProcessRoute(pathname);
+    const match = matchProcessRoute(pathname);
     return match ? match.params.id : undefined;
 };