export interface ContainerRequestResource
extends Resource,
ResourceWithProperties {
- kind: ResourceKind.CONTAINER_REQUEST;
- name: string;
- description: string;
- state: ContainerRequestState;
- requestingContainerUuid: string | null;
- cumulativeCost: number;
- containerUuid: string | null;
+ command: string[];
containerCountMax: number;
- mounts: { [path: string]: MountType };
- runtimeConstraints: RuntimeConstraints;
- schedulingParameters: SchedulingParameters;
+ containerCount: number;
containerImage: string;
- environment: any;
+ containerUuid: string | null;
+ cumulativeCost: number;
cwd: string;
- command: string[];
- outputPath: string;
+ description: string;
+ environment: any;
+ expiresAt: string;
+ filters: string;
+ kind: ResourceKind.CONTAINER_REQUEST;
+ logUuid: string | null;
+ mounts: { [path: string]: MountType };
+ name: string;
outputName: string;
+ outputPath: string;
outputTtl: number;
+ outputUuid: string | null;
priority: number | null;
- expiresAt: string;
+ requestingContainerUuid: string | null;
+ runtimeConstraints: RuntimeConstraints;
+ schedulingParameters: SchedulingParameters;
+ state: ContainerRequestState;
useExisting: boolean;
- logUuid: string | null;
- outputUuid: string | null;
- filters: string;
- containerCount: number;
}
import { VirtualMachinesResource } from 'models/virtual-machines';
import { CopyToClipboardSnackbar } from 'components/copy-to-clipboard-snackbar/copy-to-clipboard-snackbar';
import { ProjectResource } from 'models/project';
+import { ProcessResource } from 'models/process';
-const renderName = (dispatch: Dispatch, item: GroupContentsResource) => {
+const renderName = (dispatch: Dispatch, item: GroupContentsResource) => {
const navFunc = ("groupClass" in item && item.groupClass === GroupClass.ROLE ? navigateToGroupDetails : navigateTo);
return <Grid container alignItems="center" wrap="nowrap" spacing={16}>
<Grid item>
</Grid>;
};
+
const FrozenProject = (props: {item: ProjectResource}) => {
const [fullUsername, setFullusername] = React.useState<any>(null);
const getFullName = React.useCallback(() => {
return resource;
})((resource: GroupContentsResource & DispatchProp<any>) => renderName(resource.dispatch, resource));
+
const renderIcon = (item: GroupContentsResource) => {
switch (item.kind) {
case ResourceKind.PROJECT:
{(item.uuid && <CopyToClipboardSnackbar value={item.uuid} />) || '-' }
</Typography>;
+const renderUuidCopyIcon = (item: { uuid: string }) =>
+ <Typography data-cy="uuid" noWrap>
+ {(item.uuid && <CopyToClipboardSnackbar value={item.uuid} />) || '-' }
+ </Typography>;
+
export const ResourceUuid = connect((state: RootState, props: { uuid: string }) => (
getResource<UserResource>(props.uuid)(state.resources) || { uuid: '' }
))(renderUuid);
return { uuid: process?.container?.uuid ? process?.container?.uuid : '' };
})((props: { uuid: string }) => renderUuid({ uuid: props.uuid }));
+enum ColumnSelection {
+ OUTPUT_UUID = 'outputUuid',
+ LOG_UUID = 'logUuid'
+}
+
+const renderUuidLinkWithCopyIcon = (dispatch: Dispatch, item: ProcessResource, column: string) => {
+ const selectedColumnUuid = item[column]
+ return <Grid container alignItems="center" wrap="nowrap" >
+ <Grid item>
+ {selectedColumnUuid ?
+ <Typography color="primary" style={{ width: 'auto', cursor: 'pointer' }} noWrap
+ onClick={() => dispatch<any>(navigateTo(selectedColumnUuid))}>
+ {selectedColumnUuid}
+ </Typography>
+ : '-' }
+ </Grid>
+ <Grid item>
+ {selectedColumnUuid && renderUuidCopyIcon({ uuid: selectedColumnUuid })}
+ </Grid>
+ </Grid>;
+};
+
export const ResourceOutputUuid = connect(
(state: RootState, props: { uuid: string }) => {
- const process = getProcess(props.uuid)(state.resources)
- return { uuid: process?.containerRequest.outputUuid || '' };
- })((props: { uuid: string }) => renderUuid({ uuid: props.uuid }));
+ const resource = getResource<ProcessResource>(props.uuid)(state.resources);
+ return resource;
+ })((process: ProcessResource & DispatchProp<any>) => renderUuidLinkWithCopyIcon(process.dispatch, process, ColumnSelection.OUTPUT_UUID));
export const ResourceLogUuid = connect(
(state: RootState, props: { uuid: string }) => {
- const process = getProcess(props.uuid)(state.resources)
- return { uuid: process?.containerRequest.logUuid || '' };
- })((props: { uuid: string }) => renderUuid({ uuid: props.uuid }));
+ const resource = getResource<ProcessResource>(props.uuid)(state.resources);
+ return resource;
+ })((process: ProcessResource & DispatchProp<any>) => renderUuidLinkWithCopyIcon(process.dispatch, process, ColumnSelection.LOG_UUID));
export const ResourceParentProcess = connect(
(state: RootState, props: { uuid: string }) => {
userFromID
);
+
+
+
+
const _resourceWithName =
withStyles({}, { withTheme: true })
((props: { uuid: string, userFullname: string, dispatch: Dispatch, theme: ArvadosTheme }) => {
const { uuid, userFullname, dispatch, theme } = props;
-
if (userFullname === '') {
dispatch<any>(loadResource(uuid, false));
return <Typography style={{ color: theme.palette.primary.main }} inline noWrap>
export const ResourceWithName = userFromID(_resourceWithName);
+
+
export const UserNameFromID =
compose(userFromID)(
(props: { uuid: string, displayAsText?: string, userFullname: string, dispatch: Dispatch }) => {