forked from AdguardTeam/AdGuardHome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ client: handle fields for certificate path and private key path
- Loading branch information
1 parent
4445c4b
commit 6d63450
Showing
7 changed files
with
311 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
client/src/components/Settings/Encryption/CertificateStatus.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import React, { Fragment } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { withNamespaces, Trans } from 'react-i18next'; | ||
import format from 'date-fns/format'; | ||
|
||
import { EMPTY_DATE } from '../../../helpers/constants'; | ||
|
||
const CertificateStatus = ({ | ||
validChain, | ||
validCert, | ||
subject, | ||
issuer, | ||
notAfter, | ||
dnsNames, | ||
}) => ( | ||
<Fragment> | ||
<div className="form__label form__label--bold"> | ||
<Trans>encryption_status</Trans>: | ||
</div> | ||
<ul className="encryption__list"> | ||
<li | ||
className={validChain ? 'text-success' : 'text-danger'} | ||
> | ||
{validChain ? ( | ||
<Trans>encryption_chain_valid</Trans> | ||
) : ( | ||
<Trans>encryption_chain_invalid</Trans> | ||
)} | ||
</li> | ||
{validCert && ( | ||
<Fragment> | ||
{subject && ( | ||
<li> | ||
<Trans>encryption_subject</Trans>: | ||
{subject} | ||
</li> | ||
)} | ||
{issuer && ( | ||
<li> | ||
<Trans>encryption_issuer</Trans>: | ||
{issuer} | ||
</li> | ||
)} | ||
{notAfter && notAfter !== EMPTY_DATE && ( | ||
<li> | ||
<Trans>encryption_expire</Trans>: | ||
{format(notAfter, 'YYYY-MM-DD HH:mm:ss')} | ||
</li> | ||
)} | ||
{dnsNames && ( | ||
<li> | ||
<Trans>encryption_hostnames</Trans>: | ||
{dnsNames} | ||
</li> | ||
)} | ||
</Fragment> | ||
)} | ||
</ul> | ||
</Fragment> | ||
); | ||
|
||
CertificateStatus.propTypes = { | ||
validChain: PropTypes.bool.isRequired, | ||
validCert: PropTypes.bool.isRequired, | ||
subject: PropTypes.string, | ||
issuer: PropTypes.string, | ||
notAfter: PropTypes.string, | ||
dnsNames: PropTypes.string, | ||
}; | ||
|
||
export default withNamespaces()(CertificateStatus); |
Oops, something went wrong.