forked from chabad360/cockpit-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageDetails.jsx
47 lines (43 loc) · 2.01 KB
/
ImageDetails.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import React from 'react';
import cockpit from 'cockpit';
import * as utils from './util.js';
import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList";
import ImageUsedBy from './ImageUsedBy.jsx';
const _ = cockpit.gettext;
const ImageDetails = ({ containers, image, showAll }) => {
return (
<DescriptionList className='image-details' isAutoFit>
{image.Command !== "" &&
<DescriptionListGroup>
<DescriptionListTerm>{_("Command")}</DescriptionListTerm>
<DescriptionListDescription>{utils.quote_cmdline(image.Command)}</DescriptionListDescription>
</DescriptionListGroup>
}
{image.Entrypoint &&
<DescriptionListGroup>
<DescriptionListTerm>{_("Entrypoint")}</DescriptionListTerm>
<DescriptionListDescription>{image.Entrypoint.join(" ")}</DescriptionListDescription>
</DescriptionListGroup>
}
{image.RepoTags &&
<DescriptionListGroup>
<DescriptionListTerm>{_("Tags")}</DescriptionListTerm>
<DescriptionListDescription>{image.RepoTags ? image.RepoTags.join(" ") : ""}</DescriptionListDescription>
</DescriptionListGroup>
}
{containers &&
<DescriptionListGroup>
<DescriptionListTerm>{_("Used by")}</DescriptionListTerm>
<DescriptionListDescription><ImageUsedBy containers={containers} showAll={showAll} /></DescriptionListDescription>
</DescriptionListGroup>
}
{image.Ports.length !== 0 &&
<DescriptionListGroup>
<DescriptionListTerm>{_("Ports")}</DescriptionListTerm>
<DescriptionListDescription>{image.Ports.join(', ')}</DescriptionListDescription>
</DescriptionListGroup>
}
</DescriptionList>
);
};
export default ImageDetails;