feat(xo-web/VM,SR): export VDI content (#3194)

See #2432
This commit is contained in:
Pierre Donias
2018-07-17 13:38:23 +02:00
committed by Julien Fontanet
parent 19b3c207c7
commit 4c73cfa423
5 changed files with 25 additions and 0 deletions

View File

@@ -4,6 +4,8 @@
### Enhancements
- Export VDI content [#2432](https://github.com/vatesfr/xen-orchestra/issues/2432) (PR [#3194](https://github.com/vatesfr/xen-orchestra/pull/3194))
### Bug fixes
- [Backup Reports] Report not sent if reportWhen failure and at least a VM is successfull [#3181](https://github.com/vatesfr/xen-orchestra/issues/3181) (PR [#3185](https://github.com/vatesfr/xen-orchestra/pull/3185))

View File

@@ -917,6 +917,7 @@ const messages = {
resetBootOption: 'Reset',
deleteSelectedVdis: 'Delete selected VDIs',
deleteSelectedVdi: 'Delete selected VDI',
exportVdi: 'Export VDI content',
useQuotaWarning:
'Creating this disk will use the disk space quota from the resource set {resourceSet} ({spaceLeft} left)',
notEnoughSpaceInResourceSet:
@@ -1244,6 +1245,7 @@ const messages = {
setVmFailed: 'Error on setting the VM: {vm}',
startVmImport: 'Import starting…',
startVmExport: 'Export starting…',
startVdiExport: 'VDI export starting…',
nCpus: 'N CPUs',
vmMemory: 'Memory',
diskInfo: 'Disk {position} ({capacity})',

View File

@@ -1270,6 +1270,15 @@ export const exportVm = vm => {
})
}
export const exportVdi = vdi => {
info(_('startVdiExport'), vdi.id)
return _call('disk.exportContent', { id: resolveId(vdi) }).then(
({ $getFrom: url }) => {
window.location = `.${url}`
}
)
}
export const insertCd = (vm, cd, force = false) =>
_call('vm.insertCd', {
id: resolveId(vm),

View File

@@ -30,6 +30,7 @@ import {
deleteVdis,
disconnectVbd,
editVdi,
exportVdi,
isVmRunning,
} from 'xo'
@@ -185,6 +186,11 @@ const GROUPED_ACTIONS = [
]
const INDIVIDUAL_ACTIONS = [
{
handler: exportVdi,
icon: 'export',
label: _('exportVdi'),
},
{
handler: vdi => copy(vdi.uuid),
icon: 'clipboard',

View File

@@ -44,6 +44,7 @@ import {
deleteVdis,
disconnectVbd,
editVdi,
exportVdi,
isSrWritable,
isVmRunning,
migrateVdi,
@@ -652,6 +653,11 @@ export default class TabDisks extends Component {
)
individualActions = [
{
handler: exportVdi,
icon: 'export',
label: _('exportVdi'),
},
{
handler: this._migrateVdi,
icon: 'vdi-migrate',