Merge branch '21838-picker-search-race' into main. Closes #21838
[arvados.git] / services / workbench2 / src / store / process-panel / process-panel.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { WorkflowInputsData } from 'models/workflow';
6 import { RouterState } from "react-router-redux";
7 import { matchProcessRoute } from "routes/routes";
8 import { ProcessIOParameter } from "views/process-panel/process-io-card";
9 import { CommandOutputParameter } from 'cwlts/mappings/v1.0/CommandOutputParameter';
10 import { CollectionFile } from 'models/collection-file';
11
12 export type OutputDetails = {
13     raw?: any;
14     pdh?: string;
15     failedToLoadOutputCollection?: boolean;
16 }
17
18 export interface CUDAFeatures {
19     DriverVersion: string;
20     HardwareCapability: string;
21     DeviceCount: number;
22 }
23
24 export interface NodeInstanceType {
25     Name: string;
26     ProviderType: string;
27     VCPUs: number;
28     RAM: number;
29     Scratch: number;
30     IncludedScratch: number;
31     AddedScratch: number;
32     Price: number;
33     Preemptible: boolean;
34     CUDA: CUDAFeatures;
35 };
36
37 export interface NodeInfo {
38     nodeInfo: NodeInstanceType | null;
39 };
40
41 export interface UsageReport {
42     usageReport: CollectionFile | null;
43 };
44
45 export interface ProcessPanel {
46     containerRequestUuid: string;
47     filters: { [status: string]: boolean };
48     inputRaw: WorkflowInputsData | null;
49     inputParams: ProcessIOParameter[] | null;
50     outputData: OutputDetails | null;
51     outputDefinitions: CommandOutputParameter[];
52     outputParams: ProcessIOParameter[] | null;
53     nodeInfo: NodeInstanceType | null;
54     usageReport: CollectionFile | null;
55 }
56
57 export const getProcessPanelCurrentUuid = (router: RouterState) => {
58     const pathname = router.location ? router.location.pathname : '';
59     const match = matchProcessRoute(pathname);
60     return match ? match.params.id : undefined;
61 };