18128: Adds logs panel to process view. WIP
[arvados-workbench2.git] / src / store / process-logs-panel / process-logs-panel.ts
index 65ed78d73d7bd322e9243d51b2d649f9f2a0c144..87b50bd2f97ff89f1a7d057e580aa3093a13bf80 100644 (file)
@@ -2,6 +2,9 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
+import { RootState } from '../store';
+import { matchProcessLogRoute, matchProcessRoute } from 'routes/routes';
+
 export interface ProcessLogsPanel {
     filters: string[];
     selectedFilter: string;
@@ -15,3 +18,9 @@ export interface ProcessLogs {
 export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel) => {
     return logs[selectedFilter];
 };
+
+export const getProcessLogsPanelCurrentUuid = ({ router }: RootState) => {
+    const pathname = router.location ? router.location.pathname : '';
+    const match = matchProcessLogRoute(pathname) || matchProcessRoute(pathname);
+    return match ? match.params.id : undefined;
+};