feat(xo-web/xoa): notify user when proxies need to be upgraded (#5717)

See xoa-support#3597
This commit is contained in:
Rajaa.BARHTAOUI
2021-04-26 16:38:59 +02:00
committed by GitHub
parent 01ac23162f
commit 233096354c
4 changed files with 27 additions and 1 deletions

View File

@@ -12,6 +12,7 @@
- [Template] Ability to create a template from a snapshot [#4891](https://github.com/vatesfr/xen-orchestra/issues/4891) (PR [#5736](https://github.com/vatesfr/xen-orchestra/pull/5736))
- [PIF] Automatically reconfigure management PIF on host case of IP address change to avoid connection loss [#5730](https://github.com/vatesfr/xen-orchestra/issues/5730) (PR [#5745](https://github.com/vatesfr/xen-orchestra/pull/5745))
- [Backup] Lock VM directory during backup to avoid race conditions (PR [#5746](https://github.com/vatesfr/xen-orchestra/pull/5746))
- [XOA] Notify user when proxies need to be upgraded (PR [#5717](https://github.com/vatesfr/xen-orchestra/pull/5717))
### Bug fixes

View File

@@ -2348,6 +2348,7 @@ const messages = {
proxyUpToDate: 'Your proxy is up-to-date',
proxyRunningBackupsMessage:
'The upgrade will interrupt {nJobs, number} running backup job{nJobs, plural, one {} other {s}}. Do you want to continue?',
upgradeNeededForProxies: 'Some proxies need to be upgraded. Click here to get more information.',
// ----- Utils -----
secondsFormat: '{seconds, plural, one {# second} other {# seconds}}',

View File

@@ -2890,6 +2890,8 @@ export const getApplianceInfo = () => _call('xoa.getApplianceInfo')
// Proxy --------------------------------------------------------------------
export const getAllProxies = () => _call('proxy.getAll')
export const createProxyTrialLicense = () => _call('xoa.licenses.createProxyTrial')
export const deployProxyAppliance = (license, sr, { network, proxy, ...props } = {}) =>

View File

@@ -6,6 +6,7 @@ import Copiable from 'copiable'
import decorate from 'apply-decorators'
import defined, { get } from '@xen-orchestra/defined'
import Icon from 'icon'
import Link from 'link'
import React from 'react'
import Tooltip from 'tooltip'
import xoaUpdater, { exposeTrial, isTrialRunning } from 'xoa-updater'
@@ -15,12 +16,18 @@ import { confirm } from 'modal'
import { Container, Row, Col } from 'grid'
import { error } from 'notification'
import { generateId, linkState, toggleState } from 'reaclette-utils'
import { getApplianceInfo, subscribeBackupNgJobs, subscribeJobs } from 'xo'
import { injectIntl } from 'react-intl'
import { injectState, provideState } from 'reaclette'
import { Input as DebounceInput } from 'debounce-input-decorator'
import { isEmpty, map, pick, some, zipObject } from 'lodash'
import { Password, Select } from 'form'
import {
getAllProxies,
getApplianceInfo,
getProxyApplianceUpdaterState,
subscribeBackupNgJobs,
subscribeJobs,
} from 'xo'
import { getXoaPlan, TryXoa } from '../../../common/utils'
@@ -182,6 +189,12 @@ const Updates = decorate([
jobs !== undefined &&
backupNgJobs !== undefined &&
some(jobs.concat(backupNgJobs), job => job.runId !== undefined),
areProxiesOutOfDate: async () =>
(
await Promise.all(
(await getAllProxies()).map(({ id }) => getProxyApplianceUpdaterState(id).catch(e => ({ state: 'error' })))
)
).some(({ state = '' }) => state.endsWith('-upgrade-needed')),
changelogUrl: ({ consolidatedChannel }) =>
`https://github.com/vatesfr/xen-orchestra/blob/master/CHANGELOG.md#${encodeURIComponent(consolidatedChannel)}`,
channelsFormId: generateId,
@@ -270,6 +283,15 @@ const Updates = decorate([
</Col>
</Row>
)}
{state.areProxiesOutOfDate && (
<Row className='mb-1'>
<Col>
<Link className='text-info' to='/proxies'>
{_('upgradeNeededForProxies')}
</Link>
</Col>
</Row>
)}
<Row>
<Col mediumSize={6}>
<Card>