19231: Add smaller page sizes (10 and 20 items) to load faster
[arvados-workbench2.git] / src / store / process-logs-panel / process-logs-panel.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { matchProcessRoute } from 'routes/routes';
6 import { RouterState } from 'react-router-redux';
7
8 export interface ProcessLogsPanel {
9     filters: string[];
10     selectedFilter: string;
11     logs: ProcessLogs;
12 }
13
14 export interface ProcessLogs {
15     [logType: string]: string[];
16 }
17
18 export const getProcessPanelLogs = ({ selectedFilter, logs }: ProcessLogsPanel) => {
19     return logs[selectedFilter];
20 };
21
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;
26 };