Compare commits

...

4 Commits

Author SHA1 Message Date
Mohamedox
af55e0341b memorize selected vms pool ids 2019-09-27 10:03:54 +02:00
Mohamedox
3a4f1f78ce adapt PR to comments 2019-09-27 10:03:53 +02:00
Mohamedox
1d765ebf49 update changelog 2019-09-27 10:03:21 +02:00
Mohamedox
3d416d75e9 feat(xo-web/home): enhance sort of bulk VM Migrate selector
Fixes #4462
2019-09-27 10:01:33 +02:00
2 changed files with 12 additions and 0 deletions

View File

@@ -13,6 +13,7 @@
- [Servers] IPv6 addresses can be used [#4520](https://github.com/vatesfr/xen-orchestra/issues/4520) (PR [#4521](https://github.com/vatesfr/xen-orchestra/pull/4521)) \
Note: They must enclosed in brackets to differentiate with the port, e.g.: `[2001:db8::7334]` or `[ 2001:db8::7334]:4343`
- [HUB] VM template store [#1918](https://github.com/vatesfr/xen-orchestra/issues/1918) (PR [#4442](https://github.com/vatesfr/xen-orchestra/pull/4442))
- [Home/bulk vm migration] Display same-pool hosts first in the selector [#4462](https://github.com/vatesfr/xen-orchestra/issues/4462) (PR [#4474](https://github.com/vatesfr/xen-orchestra/pull/4474))
### Bug fixes

View File

@@ -119,6 +119,11 @@ export default class MigrateVmsModalBody extends BaseComponent {
return network => networks[network.id]
}
)
this._getSelectedVmsPoolIds = createSelector(
() => this.props.vms,
vms => map(vms, '$pool')
)
}
componentDidMount() {
@@ -262,6 +267,11 @@ export default class MigrateVmsModalBody extends BaseComponent {
_toggleSmartVifMapping = () =>
this.setState({ smartVifMapping: !this.state.smartVifMapping })
compareContainers = (pool1, pool2) => {
const poolIds = this._getSelectedVmsPoolIds()
return poolIds.includes(pool1.id) ? -1 : poolIds.includes(pool2.id) ? 1 : 0
}
render() {
const {
defaultSrConnectedToHost,
@@ -281,6 +291,7 @@ export default class MigrateVmsModalBody extends BaseComponent {
<Col size={6}>{_('migrateVmSelectHost')}</Col>
<Col size={6}>
<SelectHost
compareContainers={this.compareContainers}
onChange={this._selectHost}
predicate={this._getHostPredicate()}
value={host}