Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
b-Nollet committed Sep 19, 2024
1 parent 31afffe commit ec10857
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions packages/xo-web/src/xo-app/home/host-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export default class HostItem extends Component {
isHostTimeConsistentWithXoaTime: true,
}

componentWillMount() {
async componentWillMount() {
await this.props.isPubKeyTooShort.then(isPubKeyTooShort => this.setState({ isPubKeyTooShort }))
Promise.resolve(isHostTimeConsistentWithXoaTime(this.props.item)).then(value =>
this.setState({
isHostTimeConsistentWithXoaTime: value,
Expand Down Expand Up @@ -138,8 +139,7 @@ export default class HostItem extends Component {
() => this.state.isHostTimeConsistentWithXoaTime,
this._getAreHostsVersionsEqual,
() => this.props.state.hostsByPoolId[this.props.item.$pool],
() => this.props.isPubKeyTooShort,
(needsRestart, host, isMaintained, isHostTimeConsistentWithXoaTime, areHostsVersionsEqual, poolHosts, isPubKeyTooShort) => {
(needsRestart, host, isMaintained, isHostTimeConsistentWithXoaTime, areHostsVersionsEqual, poolHosts) => {
const alerts = []

if (needsRestart) {
Expand Down Expand Up @@ -198,19 +198,17 @@ export default class HostItem extends Component {
})
}

if (isPubKeyTooShort) {
console.log("=====> isPubKeyTooShort:", isPubKeyTooShort)
if (this.state.isPubKeyTooShort) {
console.log("=====> isPubKeyTooShort:", this.state.isPubKeyTooShort)
alerts.push({
level: 'warning',
render: (
<span>
<Icon icon='alarm' /> {_('pubKeyTooShort')}
<span>
<ul>
<li>{_('longerCustomCertficate')}</li>
<li>{_('longerDefaultCertificate')}</li>
</ul>
</span>
<ul>
<li>{_('longerCustomCertficate')}</li>
<li>{_('longerDefaultCertificate')}</li>
</ul>
</span>
),
})
Expand Down

0 comments on commit ec10857

Please sign in to comment.