feat(xo-server, xo-web/host): display installed certificates (#5319)

See #5134
This commit is contained in:
badrAZ
2020-10-21 14:36:55 +02:00
committed by GitHub
parent 5e6d5d4eb0
commit 171ecaaf62
4 changed files with 52 additions and 2 deletions

View File

@@ -7,6 +7,8 @@
> Users must be able to say: “Nice enhancement, I'm eager to test it”
- [Host/Advanced] Display installed certificates [#5134](https://github.com/vatesfr/xen-orchestra/issues/5134) (PR [#5319](https://github.com/vatesfr/xen-orchestra/pull/5319))
### Bug fixes
> Users must be able to say: “I had this issue, happy to know it's fixed”
@@ -33,5 +35,5 @@
- vhd-lib minor
- @xen-orchestra/audit-core minor
- xo-server-audit minor
- xo-web patch
- xo-server patch
- xo-web minor
- xo-server minor

View File

@@ -264,6 +264,12 @@ const TRANSFORMS = {
capability.startsWith('hvm')
),
// Only exists on XCP-ng/CH >= 8.2
certificates: obj.$certificates?.map(({ fingerprint, not_after }) => ({
fingerprint,
notAfter: toTimestamp(not_after),
})),
// TODO: dedupe.
PIFs: link(obj, 'PIFs'),
$PIFs: link(obj, 'PIFs'),

View File

@@ -83,6 +83,9 @@ const messages = {
advancedSettings: 'Advanced settings',
txChecksumming: 'TX checksumming',
unknownSize: 'Unknown size',
installedCertificates: 'Installed certificates',
expiry: 'Expiry',
fingerprint: 'Fingerprint',
// ----- Modals -----
alertOk: 'OK',
@@ -908,6 +911,7 @@ const messages = {
hostLicenseExpiry: 'Expiry',
hostRemoteSyslog: 'Remote syslog',
hostIommu: 'IOMMU',
hostNoCertificateInstalled: 'No certificates installed on this host',
supplementalPacks: 'Installed supplemental packs',
supplementalPackNew: 'Install new supplemental pack',
supplementalPackPoolNew: 'Install supplemental pack on every host',

View File

@@ -452,6 +452,44 @@ export default class extends Component {
<Upgrade place='supplementalPacks' available={2} />
</Container>,
]}
{host.certificates !== undefined && (
<div>
<h3>{_('installedCertificates')}</h3>
{host.certificates.length > 0 ? (
<ul className='list-group'>
{host.certificates.map(({ fingerprint, notAfter }) => (
<li className='list-group-item' key={fingerprint}>
<Container>
<Row>
<Col mediumSize={2}>
<strong>{_('fingerprint')}</strong>
</Col>
<Col mediumSize={10}>
<Copiable tagName='pre'>{fingerprint}</Copiable>
</Col>
</Row>
<Row>
<Col mediumSize={2}>
<strong>{_('expiry')}</strong>
</Col>
<Col mediumSize={10}>
<FormattedTime
value={notAfter * 1e3}
day='numeric'
month='long'
year='numeric'
/>
</Col>
</Row>
</Container>
</li>
))}
</ul>
) : (
<span>{_('hostNoCertificateInstalled')}</span>
)}
</div>
)}
</Col>
</Row>
</Container>