X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/215d0b7a7e1f69765c5f2a1139e52d8c427066eb..b676312f840c3f12855a4392afe90b275dd25b97:/src/views/process-panel/process-resource-card.tsx

diff --git a/src/views/process-panel/process-resource-card.tsx b/src/views/process-panel/process-resource-card.tsx
index c76838fcf8..d25d2a21f7 100644
--- a/src/views/process-panel/process-resource-card.tsx
+++ b/src/views/process-panel/process-resource-card.tsx
@@ -14,24 +14,21 @@ import {
     Tooltip,
     Typography,
     Grid,
-    CircularProgress,
 } from '@material-ui/core';
 import { ArvadosTheme } from 'common/custom-theme';
 import {
     CloseIcon,
     MaximizeIcon,
+    MemoryIcon,
     UnMaximizeIcon,
-    ProcessIcon
 } from 'components/icon/icon';
 import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view';
 import { connect } from 'react-redux';
 import { Process } from 'store/processes/process';
 import { NodeInstanceType } from 'store/process-panel/process-panel';
-import { DefaultView } from 'components/default-view/default-view';
 import { DetailsAttribute } from "components/details-attribute/details-attribute";
 import { formatFileSize } from "common/formatters";
-import { InputCollectionMount } from 'store/processes/processes-actions';
-import { MountKind, TemporaryDirectoryMount } from 'models/mount-types';
+import { MountKind } from 'models/mount-types';
 
 interface ProcessResourceCardDataProps {
     process: Process;
@@ -55,16 +52,16 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
     iconHeader: {
         fontSize: '1.875rem',
-        color: theme.customs.colors.green700,
+        color: theme.customs.colors.greyL,
     },
     content: {
         paddingTop: "0px",
-        maxHeight: `calc(100% - ${theme.spacing.unit * 4.5}px)`,
+        maxHeight: `calc(100% - ${theme.spacing.unit * 7.5}px)`,
         overflow: "auto"
     },
     sectionH3: {
         margin: "0.5em",
-        color: theme.customs.colors.purple,
+        color: theme.customs.colors.greyD,
         fontSize: "0.8125rem",
         textTransform: "uppercase",
     }
@@ -74,9 +71,6 @@ type ProcessResourceCardProps = ProcessResourceCardDataProps & WithStyles<CssRul
 
 export const ProcessResourceCard = withStyles(styles)(connect()(
     ({ classes, nodeInfo, doHidePanel, doMaximizePanel, doUnMaximizePanel, panelMaximized, panelName, process, }: ProcessResourceCardProps) => {
-
-        const loading = false;
-
         let diskRequest = 0;
         if (process.container?.mounts) {
             for (const mnt in process.container.mounts) {
@@ -94,7 +88,7 @@ export const ProcessResourceCard = withStyles(styles)(connect()(
                     content: classes.title,
                     avatar: classes.avatar,
                 }}
-                avatar={<ProcessIcon className={classes.iconHeader} />}
+                avatar={<MemoryIcon className={classes.iconHeader} />}
                 title={
                     <Typography noWrap variant='h6' color='inherit'>
                         Resources
@@ -131,6 +125,20 @@ export const ProcessResourceCard = withStyles(styles)(connect()(
                                 <DetailsAttribute label="Disk" value={formatFileSize(diskRequest)} />
                             </Grid>
 
+                            {process.container?.runtimeConstraints.cuda &&
+                                process.container?.runtimeConstraints.cuda.device_count > 0 ?
+                                <>
+                                    <Grid item xs={12}>
+                                        <DetailsAttribute label="CUDA devices" value={process.container?.runtimeConstraints.cuda.device_count} />
+                                    </Grid>
+                                    <Grid item xs={12}>
+                                        <DetailsAttribute label="CUDA driver version" value={process.container?.runtimeConstraints.cuda.driver_version} />
+                                    </Grid>
+                                    <Grid item xs={12}>
+                                        <DetailsAttribute label="CUDA hardware capability" value={process.container?.runtimeConstraints.cuda.hardware_capability} />
+                                    </Grid>
+                                </> : null}
+
                             {process.container?.runtimeConstraints.keep_cache_ram &&
                                 process.container?.runtimeConstraints.keep_cache_ram > 0 ?
                                 <Grid item xs={12}>
@@ -147,19 +155,6 @@ export const ProcessResourceCard = withStyles(styles)(connect()(
                                 <DetailsAttribute label="API access" value={process.container?.runtimeConstraints.API.toString()} />
                             </Grid> : null}
 
-                            {process.container?.runtimeConstraints.cuda &&
-                                process.container?.runtimeConstraints.cuda.device_count > 0 ?
-                                <>
-                                    <Grid item xs={12}>
-                                        <DetailsAttribute label="CUDA devices" value={process.container?.runtimeConstraints.cuda.device_count} />
-                                    </Grid>
-                                    <Grid item xs={12}>
-                                        <DetailsAttribute label="CUDA driver version" value={process.container?.runtimeConstraints.cuda.driver_version} />
-                                    </Grid>
-                                    <Grid item xs={12}>
-                                        <DetailsAttribute label="CUDA hardware capability" value={process.container?.runtimeConstraints.cuda.hardware_capability} />
-                                    </Grid>
-                                </> : null}
                         </Grid>
                     </Grid>
 
@@ -188,35 +183,31 @@ export const ProcessResourceCard = withStyles(styles)(connect()(
                                 </Grid>
 
                                 <Grid item xs={6}>
-                                    <DetailsAttribute label="Included scratch disk" value={formatFileSize(nodeInfo.IncludedScratch)} />
+                                    <DetailsAttribute label="Disk" value={formatFileSize(nodeInfo.IncludedScratch + nodeInfo.AddedScratch)} />
                                 </Grid>
 
                                 <Grid item xs={6}>
                                     <DetailsAttribute label="Preemptible" value={nodeInfo.Preemptible.toString()} />
                                 </Grid>
 
-                                <Grid item xs={6}>
-                                    <DetailsAttribute label="Added scratch disk" value={formatFileSize(nodeInfo.AddedScratch)} />
-                                </Grid>
-
-                                {nodeInfo.CUDA.DeviceCount > 0 &&
+                                {nodeInfo.CUDA && nodeInfo.CUDA.DeviceCount > 0 &&
                                     <>
                                         <Grid item xs={6}>
-                                            <DetailsAttribute label="CUDA devices" value={formatFileSize(nodeInfo.CUDA.DeviceCount)} />
+                                            <DetailsAttribute label="CUDA devices" value={nodeInfo.CUDA.DeviceCount} />
                                         </Grid>
 
                                         <Grid item xs={6}>
                                         </Grid>
 
                                         <Grid item xs={6}>
-                                            <DetailsAttribute label="CUDA driver version" value={formatFileSize(nodeInfo.CUDA.DriverVersion)} />
+                                            <DetailsAttribute label="CUDA driver version" value={nodeInfo.CUDA.DriverVersion} />
                                         </Grid>
 
                                         <Grid item xs={6}>
                                         </Grid>
 
                                         <Grid item xs={6}>
-                                            <DetailsAttribute label="CUDA hardware capability" value={formatFileSize(nodeInfo.CUDA.HardwareCapability)} />
+                                            <DetailsAttribute label="CUDA hardware capability" value={nodeInfo.CUDA.HardwareCapability} />
                                         </Grid>
                                     </>
                                 }
