feat(xo-web/migrate/vm): allow to select private network for VIFs network (#6200)
This commit is contained in:
parent
50d144bf93
commit
3c1239cfb8
@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
- [VM export] Feat export to `ova` format (PR [#6006](https://github.com/vatesfr/xen-orchestra/pull/6006))
|
- [VM export] Feat export to `ova` format (PR [#6006](https://github.com/vatesfr/xen-orchestra/pull/6006))
|
||||||
- [Backup] Add _Restore Health Check_: ensure a backup is viable by doing an automatic test restore (requires guest tools in the VM) [#6148](https://github.com/vatesfr/xen-orchestra/pull/6148)
|
- [Backup] Add _Restore Health Check_: ensure a backup is viable by doing an automatic test restore (requires guest tools in the VM) [#6148](https://github.com/vatesfr/xen-orchestra/pull/6148)
|
||||||
|
- [VM migrate] Allow to choose a private network for VIFs network (PR [#6200](https://github.com/vatesfr/xen-orchestra/pull/6200))
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@ import BaseComponent from 'base-component'
|
|||||||
import every from 'lodash/every'
|
import every from 'lodash/every'
|
||||||
import find from 'lodash/find'
|
import find from 'lodash/find'
|
||||||
import forEach from 'lodash/forEach'
|
import forEach from 'lodash/forEach'
|
||||||
|
import isEmpty from 'lodash/isEmpty'
|
||||||
import map from 'lodash/map'
|
import map from 'lodash/map'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import store from 'store'
|
import store from 'store'
|
||||||
@ -81,21 +82,16 @@ export default class MigrateVmModalBody extends BaseComponent {
|
|||||||
)
|
)
|
||||||
|
|
||||||
this._getTargetNetworkPredicate = createSelector(
|
this._getTargetNetworkPredicate = createSelector(
|
||||||
createPicker(
|
() => this.props.networks,
|
||||||
() => this.props.pifs,
|
() => this.state.host.$poolId,
|
||||||
() => this.state.host.$PIFs
|
(networks, poolId) => {
|
||||||
),
|
const _networks = {}
|
||||||
pifs => {
|
forEach(networks, network => {
|
||||||
if (!pifs) {
|
if (network.$poolId === poolId) {
|
||||||
return false
|
_networks[network.id] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const networks = {}
|
|
||||||
forEach(pifs, pif => {
|
|
||||||
networks[pif.$network] = true
|
|
||||||
})
|
})
|
||||||
|
return isEmpty(_networks) ? false : network => _networks[network.id]
|
||||||
return network => networks[network.id]
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -68,21 +68,16 @@ export default class MigrateVmsModalBody extends BaseComponent {
|
|||||||
)
|
)
|
||||||
|
|
||||||
this._getTargetNetworkPredicate = createSelector(
|
this._getTargetNetworkPredicate = createSelector(
|
||||||
createPicker(
|
() => this.props.networks,
|
||||||
() => this.props.pifs,
|
() => this.state.host.$poolId,
|
||||||
() => this.state.host.$PIFs
|
(networks, poolId) => {
|
||||||
),
|
const _networks = {}
|
||||||
pifs => {
|
forEach(networks, network => {
|
||||||
if (!pifs) {
|
if (network.$poolId === poolId) {
|
||||||
return false
|
_networks[network.id] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
const networks = {}
|
|
||||||
forEach(pifs, pif => {
|
|
||||||
networks[pif.$network] = true
|
|
||||||
})
|
})
|
||||||
|
return isEmpty(_networks) ? false : network => _networks[network.id]
|
||||||
return network => networks[network.id]
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user