diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 5f99f4d78eb..ed5ca82272d 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -19,7 +19,9 @@ - [Backup/Restore] Fix restore via a proxy showing as interupted (PR [#6702](https://github.com/vatesfr/xen-orchestra/pull/6702)) - [REST API] Backup logs are now available at `/rest/v0/backups/logs` - [Plugin/auth-oidc] Fix empty user names when using default config [Forum#59587](https://xcp-ng.org/forum/post/59587) +- [Pool/Pro License] Fix handling of licenses with no expiration date (PR [#6730](https://github.com/vatesfr/xen-orchestra/pull/6730)) - [ESXI import] Fix failing imports when using non default datacenter name [Forum#59543](https://xcp-ng.org/forum/post/59543) PR [#6729](https://github.com/vatesfr/xen-orchestra/pull/6729) +- [Pool/Pro License] Fix handling of licenses with no expiration date (PR [#6730](https://github.com/vatesfr/xen-orchestra/pull/6730)) ### Packages to release diff --git a/packages/xo-web/src/common/intl/messages.js b/packages/xo-web/src/common/intl/messages.js index 134973298a4..d1fc2251355 100644 --- a/packages/xo-web/src/common/intl/messages.js +++ b/packages/xo-web/src/common/intl/messages.js @@ -52,6 +52,7 @@ const messages = { browseFiles: 'Browse files', showLogs: 'Show logs', noValue: 'None', + noExpiration: 'No expiration', compression: 'Compression', core: 'Core', cpu: 'CPU', diff --git a/packages/xo-web/src/xo-app/home/pool-item.js b/packages/xo-web/src/xo-app/home/pool-item.js index 066ff3b6457..f1de855892e 100644 --- a/packages/xo-web/src/xo-app/home/pool-item.js +++ b/packages/xo-web/src/xo-app/home/pool-item.js @@ -84,7 +84,10 @@ export default class PoolItem extends Component { tooltip = _('poolSupportSourceUsers') } if (supportLevel === 'total') { - tooltip = _('earliestExpirationDate', { dateString: }) + tooltip = _('earliestExpirationDate', { + dateString: + earliestExpirationDate === Infinity ? _('noExpiration') : , + }) } if (supportLevel === 'partial') { tooltip = _('poolPartialSupport', { nHostsLicense: nHostsUnderLicense, nHosts }) diff --git a/packages/xo-web/src/xo-app/index.js b/packages/xo-web/src/xo-app/index.js index 030e25c81bf..c4ce37970ae 100644 --- a/packages/xo-web/src/xo-app/index.js +++ b/packages/xo-web/src/xo-app/index.js @@ -195,7 +195,12 @@ export const ICON_POOL_LICENSE = { for (const host of hosts) { const license = xcpngLicenseByBoundObjectId[host.id] - if (license !== undefined && license.expires > Date.now()) { + if (license === undefined) { + continue + } + license.expires = license.expires ?? Infinity + + if (license.expires > Date.now()) { nHostsUnderLicense++ if (earliestExpirationDate === undefined || license.expires < earliestExpirationDate) { earliestExpirationDate = license.expires