Extract DirectoryInput format function
[arvados-workbench2.git] / src / store / process-logs-panel / process-logs-panel.ts
index 65ed78d73d7bd322e9243d51b2d649f9f2a0c144..e0753cde7bfb7e2cee14f9a305d30d3979851049 100644 (file)
@@ -1,3 +1,5 @@
+import { RootState } from '../store';
+import { matchProcessLogRoute } from '~/routes/routes';
 // Copyright (C) The Arvados Authors. All rights reserved.
 //
 // SPDX-License-Identifier: AGPL-3.0
@@ -15,3 +17,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);
+    return match ? match.params.id : undefined;
+};