X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/08ac60f877d6495a748747a3a0d30ca9f0e289d5..082c1782d96a4b1c897df64d9b325d102a5c1144:/src/views/process-panel/process-details-card.tsx diff --git a/src/views/process-panel/process-details-card.tsx b/src/views/process-panel/process-details-card.tsx index d3349c3a..59d0b61b 100644 --- a/src/views/process-panel/process-details-card.tsx +++ b/src/views/process-panel/process-details-card.tsx @@ -12,14 +12,17 @@ import { IconButton, CardContent, Tooltip, + Typography, } from '@material-ui/core'; import { ArvadosTheme } from 'common/custom-theme'; -import { CloseIcon } from 'components/icon/icon'; +import { CloseIcon, MoreOptionsIcon, ProcessIcon } from 'components/icon/icon'; import { Process } from 'store/processes/process'; import { MPVPanelProps } from 'components/multi-panel-view/multi-panel-view'; import { ProcessDetailsAttributes } from './process-details-attributes'; +import { ProcessStatus } from 'views-components/data-explorer/renderers'; +import { ContainerState } from 'models/container'; -type CssRules = 'card' | 'content' | 'title' | 'header'; +type CssRules = 'card' | 'content' | 'title' | 'header' | 'cancelButton' | 'avatar' | 'iconHeader'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ card: { @@ -29,6 +32,14 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ paddingTop: theme.spacing.unit, paddingBottom: theme.spacing.unit, }, + iconHeader: { + fontSize: '1.875rem', + color: theme.customs.colors.green700, + }, + avatar: { + alignSelf: 'flex-start', + paddingTop: theme.spacing.unit * 0.5 + }, content: { '&:last-child': { paddingBottom: theme.spacing.unit * 2, @@ -38,31 +49,71 @@ const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ overflow: 'hidden', paddingTop: theme.spacing.unit * 0.5 }, + cancelButton: { + paddingRight: theme.spacing.unit * 2, + fontSize: '14px', + color: theme.customs.colors.red900, + "&:hover": { + cursor: 'pointer' + } + }, }); export interface ProcessDetailsCardDataProps { process: Process; + cancelProcess: (uuid: string) => void; + onContextMenu: (event: React.MouseEvent) => void; } type ProcessDetailsCardProps = ProcessDetailsCardDataProps & WithStyles & MPVPanelProps; export const ProcessDetailsCard = withStyles(styles)( - ({ classes, process, doHidePanel, panelName }: ProcessDetailsCardProps) => { + ({ cancelProcess, onContextMenu, classes, process, doHidePanel, panelName }: ProcessDetailsCardProps) => { return } + title={ + + + {process.containerRequest.name} + + + } + subheader={ + + + {getDescription(process)} + + } + action={ +
+ {process.container && process.container.state === ContainerState.RUNNING && + cancelProcess(process.containerRequest.uuid)}>Cancel} + + + onContextMenu(event)}> + + + + { doHidePanel && - } /> + } +
+ } /> - +
; } ); +const getDescription = (process: Process) => + process.containerRequest.description || '(no-description)';