@patternfly/react-core#DescriptionListGroup JavaScript Examples
The following examples show how to use
@patternfly/react-core#DescriptionListGroup.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: certificateList.jsx From cockpit-certificates with GNU Lesser General Public License v2.1 | 6 votes |
keyDetails = ({ idPrefix, cert }) => (
<DescriptionList isHorizontal>
{cert["key-nickname"] && cert["key-nickname"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Nickname")}</DescriptionListTerm>
<span id={`${idPrefix}-key-nickname`}>{cert["key-nickname"].v}</span>
</DescriptionListGroup>}
{cert["key-type"] && cert["key-type"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Type")}</DescriptionListTerm>
<span id={`${idPrefix}-key-type`}>{cert["key-type"].v}</span>
</DescriptionListGroup>}
{cert["key-token"] && cert["key-token"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Token")}</DescriptionListTerm>
<span id={`${idPrefix}-key-token`}>{cert["key-token"].v}</span>
</DescriptionListGroup>}
{cert["key-storage"] && cert["key-storage"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Storage")}</DescriptionListTerm>
<span id={`${idPrefix}-key-storage`}>{cert["key-storage"].v}</span>
</DescriptionListGroup>}
{((cert["key-database"] && cert["key-database"].v) || (cert["key-file"] && cert["key-file"].v)) && <DescriptionListGroup>
<DescriptionListTerm>{_("Location")}</DescriptionListTerm>
{cert["key-storage"].v === "FILE"
? <span id={`${idPrefix}-key-location`}>{cert["key-file"].v}</span>
: <span id={`${idPrefix}-key-location`}>{cert["key-database"].v}</span>
}
</DescriptionListGroup>}
</DescriptionList>
)
Example #2
Source File: certificateList.jsx From cockpit-certificates with GNU Lesser General Public License v2.1 | 6 votes |
certDetails = ({ idPrefix, cert }) => (
<DescriptionList isHorizontal>
{cert["cert-nickname"] && cert["cert-nickname"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Nickname")}</DescriptionListTerm>
<span id={`${idPrefix}-cert-nickname`}>{cert["cert-nickname"].v}</span>
</DescriptionListGroup>}
{cert["cert-token"] && cert["cert-token"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Token")}</DescriptionListTerm>
<span id={`${idPrefix}-cert-token`}>{cert["cert-token"].v}</span>
</DescriptionListGroup>}
{cert["cert-storage"] && cert["cert-storage"].v && <DescriptionListGroup>
<DescriptionListTerm>{_("Storage")}</DescriptionListTerm>
<span id={`${idPrefix}-cert-storage`}>{cert["cert-storage"].v}</span>
</DescriptionListGroup>}
{((cert["cert-database"] && cert["cert-database"].v) || (cert["cert-file"] && cert["cert-file"].v)) && <DescriptionListGroup>
<DescriptionListTerm>{_("Location")}</DescriptionListTerm>
{cert["cert-storage"].v === "FILE"
? <span id={`${idPrefix}-cert-location`}>{cert["cert-file"].v}</span>
: <span id={`${idPrefix}-cert-location`}>{cert["cert-database"].v}</span>
}
</DescriptionListGroup>}
</DescriptionList>
)
Example #3
Source File: certificateList.jsx From cockpit-certificates with GNU Lesser General Public License v2.1 | 4 votes |
generalDetails = ({ idPrefix, cas, cert, certPath, onAutorenewChanged }) => {
const caName = getCAName(cas, cert);
return (<Flex justifyContent={{ default: "justifyContentCenter" }}>
<Flex direction={{ default:"column" }} flex={{ default: 'flex_1' }}>
<DescriptionList isHorizontal>
{cert.status && cert.status.v && <DescriptionListGroup>
<DescriptionListTerm>{_("Status")}</DescriptionListTerm>
<DescriptionListDescription id={`${idPrefix}-general-status`}>
{cert.stuck.v && (
<Flex alignItems={{ default: 'alignItemsCenter' }} spaceItems={{ default: 'spaceItemsSm' }}>
<ExclamationTriangleIcon className="ct-icon-exclamation-triangle" />
<span id={`${idPrefix}-general-stuck`}>{_("Stuck: ")}</span>
</Flex>
)}
<Flex alignItems={{ default: 'alignItemsCenter' }} spaceItems={{ default: 'spaceItemsSm' }}>
<FlexItem>
{cert.status.v.includes('_')
? cert.status.v
: cert.status.v.charAt(0) + cert.status.v.slice(1).toLowerCase()}
</FlexItem>
<Tooltip position={TooltipPosition.top}
entryDelay={0}
content={certificateStates[cert.status.v]}>
<span className="info-circle">
<InfoAltIcon />
</span>
</Tooltip>
</Flex>
</DescriptionListDescription>
</DescriptionListGroup>}
{cert.ca && cert.ca.v && <DescriptionListGroup>
<DescriptionListTerm>{_("Certificate authority")}</DescriptionListTerm>
<DescriptionListDescription id={`${idPrefix}-general-ca`}>{caName == "SelfSign" ? _("Self-signed") : caName}</DescriptionListDescription>
</DescriptionListGroup>}
{cert["not-valid-after"] && cert["not-valid-after"].v !== 0 && <DescriptionListGroup>
<DescriptionListTerm>
{_("Valid")}
</DescriptionListTerm>
<DescriptionListDescription id={`${idPrefix}-general-validity`}>
{prettyTime(cert["not-valid-before"].v) +
_(" to ") + prettyTime(cert["not-valid-after"].v)}
</DescriptionListDescription>
</DescriptionListGroup>}
{cert.autorenew && <DescriptionListGroup>
<DescriptionListTerm>
{_("Auto-renewal")}
</DescriptionListTerm>
<DescriptionListDescription>
<Checkbox id={`${idPrefix}-general-autorenewal`}
isChecked={cert.autorenew.v}
label={_("Renew before expiration")}
onChange={() => onAutorenewChanged(cert, certPath)} />
</DescriptionListDescription>
</DescriptionListGroup>}
</DescriptionList>
</Flex>
<Flex direction={{ default:"column" }} flex={{ default: 'flex_1' }}>
<DescriptionList isHorizontal>
{cert.subject && cert.subject.v && <DescriptionListGroup>
<DescriptionListTerm>
{_("Subject name")}
</DescriptionListTerm>
<DescriptionListDescription>
<span id={`${idPrefix}-general-subject`}>{cert.subject.v}</span>
</DescriptionListDescription>
</DescriptionListGroup>}
{cert.principal && cert.principal.v.length > 0 && <DescriptionListGroup>
<DescriptionListTerm>
{_("Principal name")}
</DescriptionListTerm>
<DescriptionListDescription>
<span id={`${idPrefix}-general-principal`}>{cert.principal.v.join(", ")}</span>
</DescriptionListDescription>
</DescriptionListGroup>}
{cert.hostname && cert.hostname.v.length > 0 && <DescriptionListGroup>
<DescriptionListTerm>
{_("DNS name")}
</DescriptionListTerm>
<DescriptionListDescription>
<span id={`${idPrefix}-general-dns`}>{cert.hostname.v.join(", ")}</span>
</DescriptionListDescription>
</DescriptionListGroup>}
</DescriptionList>
</Flex>
</Flex>);
}