import "./certificate-details.scss" import React from "react"; import moment from "moment" import { observer } from "mobx-react"; import { Link } from "react-router-dom"; import { Trans } from "@lingui/macro"; import { DrawerItem, DrawerTitle } from "../../drawer"; import { Badge } from "../../badge"; import { KubeEventDetails } from "../../+events/kube-event-details"; import { KubeObjectDetailsProps } from "../../kube-object"; import { Certificate, certificatesApi } from "../../../api/endpoints/cert-manager.api"; import { cssNames } from "../../../utils"; import { apiManager } from "../../../api/api-manager"; import { KubeObjectMeta } from "../../kube-object/kube-object-meta"; interface Props extends KubeObjectDetailsProps { } @observer export class CertificateDetails extends React.Component { render() { const { object: cert, className } = this.props; if (!cert) return; const { spec, status } = cert; const { acme, isCA, commonName, secretName, dnsNames, duration, ipAddresses, keyAlgorithm, keySize, organization, renewBefore } = spec; const { lastFailureTime, notAfter } = status; return (
Issuer}> {cert.getIssuerName()} Secret Name}> {secretName} {isCA ? Yes : No} {commonName && ( Common Name}> {commonName} )} {dnsNames && ( DNS names} labelsOnly> {dnsNames.map(name => )} )} {ipAddresses && ( IP addresses}> {ipAddresses.join(", ")} )} {organization && ( Organization}> {organization.join(", ")} )} {duration && ( Duration}> {duration} )} {renewBefore && ( Renew Before}> {renewBefore} )} {keySize && ( Key Size}> {keySize} )} {keyAlgorithm && ( Key Algorithm}> {keyAlgorithm} )} Not After}> {moment(notAfter).format("LLL")} {lastFailureTime && ( Last Failure Time}> {lastFailureTime} )} Status} labelsOnly> {cert.getConditions().map(({ type, tooltip, isReady }) => { return ( ) })} {acme && ( <> {acme.config.map(({ domains, http01, dns01 }, index) => { return (
Domains} labelsOnly> {domains.map(domain => )} Http01}> {Object.entries(http01).map(([key, val]) => `${key}: ${val}`)[0]} {dns01 && ( DNS Provider} labelsOnly> {dns01.provider} )}
) })} )}
); } } apiManager.registerViews(certificatesApi, { Details: CertificateDetails })