Merge branch '15840-project-page-hang'
[arvados-workbench2.git] / src / views-components / details-panel / process-details.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { ProcessIcon } from '~/components/icon/icon';
7 import { ProcessResource } from '~/models/process';
8 import { formatDate } from '~/common/formatters';
9 import { ResourceKind } from '~/models/resource';
10 import { resourceLabel } from '~/common/labels';
11 import { DetailsData } from "./details-data";
12 import { DetailsAttribute } from "~/components/details-attribute/details-attribute";
13
14 export class ProcessDetails extends DetailsData<ProcessResource> {
15
16     getIcon(className?: string) {
17         return <ProcessIcon className={className} />;
18     }
19
20     getDetails() {
21         return <div>
22             <DetailsAttribute label='Type' value={resourceLabel(ResourceKind.PROCESS)} />
23             <DetailsAttribute label='Size' value='---' />
24             <DetailsAttribute label='Owner' linkToUuid={this.item.ownerUuid} value={this.item.ownerUuid} />
25
26             {/* Missing attr */}
27             <DetailsAttribute label='Status' value={this.item.state} />
28             <DetailsAttribute label='Last modified' value={formatDate(this.item.modifiedAt)} />
29
30             {/* Missing attrs */}
31             <DetailsAttribute label='Started at' value={formatDate(this.item.createdAt)} />
32             <DetailsAttribute label='Finished at' value={formatDate(this.item.expiresAt)} />
33
34             <DetailsAttribute label='Outputs' value={this.item.outputPath} />
35             <DetailsAttribute label='UUID' linkToUuid={this.item.uuid} value={this.item.uuid} />
36             <DetailsAttribute label='Container UUID' value={this.item.containerUuid} />
37
38             <DetailsAttribute label='Priority' value={this.item.priority} />
39             <DetailsAttribute label='Runtime Constraints' value={JSON.stringify(this.item.runtimeConstraints)} />
40
41             <DetailsAttribute label='Docker Image locator' linkToUuid={this.item.containerImage} value={this.item.containerImage} />
42         </div>;
43     }
44 }