fix(xo-web/license): fix undefined expiration date (#6730)
Fix zammad#13319 The Pro support icon displayed in "Home/pool" considered that the licenses without expiration date had expired
This commit is contained in:
@@ -19,7 +19,9 @@
|
|||||||
- [Backup/Restore] Fix restore via a proxy showing as interupted (PR [#6702](https://github.com/vatesfr/xen-orchestra/pull/6702))
|
- [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`
|
- [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)
|
- [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)
|
- [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
|
### Packages to release
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ const messages = {
|
|||||||
browseFiles: 'Browse files',
|
browseFiles: 'Browse files',
|
||||||
showLogs: 'Show logs',
|
showLogs: 'Show logs',
|
||||||
noValue: 'None',
|
noValue: 'None',
|
||||||
|
noExpiration: 'No expiration',
|
||||||
compression: 'Compression',
|
compression: 'Compression',
|
||||||
core: 'Core',
|
core: 'Core',
|
||||||
cpu: 'CPU',
|
cpu: 'CPU',
|
||||||
|
|||||||
@@ -84,7 +84,10 @@ export default class PoolItem extends Component {
|
|||||||
tooltip = _('poolSupportSourceUsers')
|
tooltip = _('poolSupportSourceUsers')
|
||||||
}
|
}
|
||||||
if (supportLevel === 'total') {
|
if (supportLevel === 'total') {
|
||||||
tooltip = _('earliestExpirationDate', { dateString: <ShortDate timestamp={earliestExpirationDate} /> })
|
tooltip = _('earliestExpirationDate', {
|
||||||
|
dateString:
|
||||||
|
earliestExpirationDate === Infinity ? _('noExpiration') : <ShortDate timestamp={earliestExpirationDate} />,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (supportLevel === 'partial') {
|
if (supportLevel === 'partial') {
|
||||||
tooltip = _('poolPartialSupport', { nHostsLicense: nHostsUnderLicense, nHosts })
|
tooltip = _('poolPartialSupport', { nHostsLicense: nHostsUnderLicense, nHosts })
|
||||||
|
|||||||
@@ -195,7 +195,12 @@ export const ICON_POOL_LICENSE = {
|
|||||||
|
|
||||||
for (const host of hosts) {
|
for (const host of hosts) {
|
||||||
const license = xcpngLicenseByBoundObjectId[host.id]
|
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++
|
nHostsUnderLicense++
|
||||||
if (earliestExpirationDate === undefined || license.expires < earliestExpirationDate) {
|
if (earliestExpirationDate === undefined || license.expires < earliestExpirationDate) {
|
||||||
earliestExpirationDate = license.expires
|
earliestExpirationDate = license.expires
|
||||||
|
|||||||
Reference in New Issue
Block a user