1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { matchProcessRoute } from 'routes/routes';
6 import { RouterState } from 'react-router-redux';
8 export interface ProcessLogsPanel {
10 selectedFilter: string;
14 export interface ProcessLogs {
15 [logType: string]: {lastByte: number | undefined, contents: string[]};
18 export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel): string[] => {
19 return logs[selectedFilter]?.contents || [];
22 export const getProcessLogsPanelCurrentUuid = (router: RouterState) => {
23 const pathname = router.location ? router.location.pathname : '';
24 const match = matchProcessRoute(pathname);
25 return match ? match.params.id : undefined;