Merge branch 'jszlenk/create_new_subproject' refs #21937
[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 }
16
17 export interface CUDAFeatures {
18     DriverVersion: string;
19     HardwareCapability: string;
20     DeviceCount: number;
21 }
22
23 export interface NodeInstanceType {
24     Name: string;
25     ProviderType: string;
26     VCPUs: number;
27     RAM: number;
28     Scratch: number;
29     IncludedScratch: number;
30     AddedScratch: number;
31     Price: number;
32     Preemptible: boolean;
33     CUDA: CUDAFeatures;
34 };
35
36 export interface NodeInfo {
37     nodeInfo: NodeInstanceType | null;
38 };
39
40 export interface UsageReport {
41     usageReport: CollectionFile | null;
42 };
43
44 export interface ProcessPanel {
45     containerRequestUuid: string;
46     filters: { [status: string]: boolean };
47     inputRaw: WorkflowInputsData | null;
48     inputParams: ProcessIOParameter[] | null;
49     outputData: OutputDetails | null;
50     outputDefinitions: CommandOutputParameter[];
51     outputParams: ProcessIOParameter[] | null;
52     nodeInfo: NodeInstanceType | null;
53     usageReport: CollectionFile | null;
54 }
55
56 export const getProcessPanelCurrentUuid = (router: RouterState) => {
57     const pathname = router.location ? router.location.pathname : '';
58     const match = matchProcessRoute(pathname);
59     return match ? match.params.id : undefined;
60 };