diff --git a/CHANGELOG.md b/CHANGELOG.md index 73de49911..ace1cb599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - [Hosts] Ability to enable/disable host multipathing [#3659](https://github.com/vatesfr/xen-orchestra/issues/3659) (PR [#3865](https://github.com/vatesfr/xen-orchestra/pull/3865)) - [Login] Add OTP authentication [#2044](https://github.com/vatesfr/xen-orchestra/issues/2044) (PR [#3879](https://github.com/vatesfr/xen-orchestra/pull/3879)) - [Notifications] New notification page to provide important information about XOA (PR [#3904](https://github.com/vatesfr/xen-orchestra/pull/3904)) +- [VM] Ability to export a VM with zstd compression [#3773](https://github.com/vatesfr/xen-orchestra/issues/3773) (PR [#3891](https://github.com/vatesfr/xen-orchestra/pull/3891)) ### Bug fixes diff --git a/packages/xo-web/src/common/xo/export-vm-modal/index.js b/packages/xo-web/src/common/xo/export-vm-modal/index.js new file mode 100644 index 000000000..fb266cc61 --- /dev/null +++ b/packages/xo-web/src/common/xo/export-vm-modal/index.js @@ -0,0 +1,35 @@ +import BaseComponent from 'base-component' +import React from 'react' + +import _ from '../../intl' +import SelectCompression from '../../select-compression' +import { Container, Row, Col } from '../../grid' + +export default class ExportVmModalBody extends BaseComponent { + state = { + compression: '', + } + + get value() { + const compression = this.state.compression + return compression === 'zstd' ? 'zstd' : compression === 'native' + } + + render() { + return ( + + + + {_('compression')} + + + + + + + ) + } +} diff --git a/packages/xo-web/src/common/xo/index.js b/packages/xo-web/src/common/xo/index.js index 190a65006..d2d09832a 100644 --- a/packages/xo-web/src/common/xo/index.js +++ b/packages/xo-web/src/common/xo/index.js @@ -1425,12 +1425,21 @@ export const importVms = (vms, sr) => ) ) -export const exportVm = vm => { - info(_('startVmExport'), vm.id) - return _call('vm.export', { vm: resolveId(vm) }).then(({ $getFrom: url }) => { - window.location = `.${url}` +import ExportVmModalBody from './export-vm-modal' // eslint-disable-line import/first +export const exportVm = vm => + confirm({ + body: , + icon: 'export', + title: _('exportVmLabel'), + }).then(compress => { + const id = resolveId(vm) + info(_('startVmExport'), id) + return _call('vm.export', { vm: id, compress }).then( + ({ $getFrom: url }) => { + window.location = `.${url}` + } + ) }) -} export const exportVdi = vdi => { info(_('startVdiExport'), vdi.id)