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))
|
||||
- [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
|
||||
|
||||
|
@ -2,6 +2,7 @@ import BaseComponent from 'base-component'
|
||||
import every from 'lodash/every'
|
||||
import find from 'lodash/find'
|
||||
import forEach from 'lodash/forEach'
|
||||
import isEmpty from 'lodash/isEmpty'
|
||||
import map from 'lodash/map'
|
||||
import React from 'react'
|
||||
import store from 'store'
|
||||
@ -81,21 +82,16 @@ export default class MigrateVmModalBody extends BaseComponent {
|
||||
)
|
||||
|
||||
this._getTargetNetworkPredicate = createSelector(
|
||||
createPicker(
|
||||
() => this.props.pifs,
|
||||
() => this.state.host.$PIFs
|
||||
),
|
||||
pifs => {
|
||||
if (!pifs) {
|
||||
return false
|
||||
}
|
||||
|
||||
const networks = {}
|
||||
forEach(pifs, pif => {
|
||||
networks[pif.$network] = true
|
||||
() => this.props.networks,
|
||||
() => this.state.host.$poolId,
|
||||
(networks, poolId) => {
|
||||
const _networks = {}
|
||||
forEach(networks, network => {
|
||||
if (network.$poolId === poolId) {
|
||||
_networks[network.id] = true
|
||||
}
|
||||
})
|
||||
|
||||
return network => networks[network.id]
|
||||
return isEmpty(_networks) ? false : network => _networks[network.id]
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -68,21 +68,16 @@ export default class MigrateVmsModalBody extends BaseComponent {
|
||||
)
|
||||
|
||||
this._getTargetNetworkPredicate = createSelector(
|
||||
createPicker(
|
||||
() => this.props.pifs,
|
||||
() => this.state.host.$PIFs
|
||||
),
|
||||
pifs => {
|
||||
if (!pifs) {
|
||||
return false
|
||||
}
|
||||
|
||||
const networks = {}
|
||||
forEach(pifs, pif => {
|
||||
networks[pif.$network] = true
|
||||
() => this.props.networks,
|
||||
() => this.state.host.$poolId,
|
||||
(networks, poolId) => {
|
||||
const _networks = {}
|
||||
forEach(networks, network => {
|
||||
if (network.$poolId === poolId) {
|
||||
_networks[network.id] = true
|
||||
}
|
||||
})
|
||||
|
||||
return network => networks[network.id]
|
||||
return isEmpty(_networks) ? false : network => _networks[network.id]
|
||||
}
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user