feat(xo-web/vm/attachDisk): warning when VDI already attached (#4366)
Fixes #3381
This commit is contained in:
committed by
Pierre Donias
parent
5d7af94abf
commit
4eb0101c5b
@@ -9,6 +9,7 @@
|
||||
|
||||
- [VM/copy, VM/export] Only show zstd option when it's supported [#3892](https://github.com/vatesfr/xen-orchestra/issues/3892) (PRs [#4326](https://github.com/vatesfr/xen-orchestra/pull/4326) [#4368](https://github.com/vatesfr/xen-orchestra/pull/4368))
|
||||
- [SDN Controller] Let the user choose on which PIF to create a private network (PR [#4379](https://github.com/vatesfr/xen-orchestra/pull/4379))
|
||||
- [VM/Attach disk] Display confirmation modal when VDI is already attached [#3381](https://github.com/vatesfr/xen-orchestra/issues/3381) (PR [#4366](https://github.com/vatesfr/xen-orchestra/pull/4366))
|
||||
|
||||
### Bug fixes
|
||||
|
||||
|
||||
@@ -1827,7 +1827,7 @@ export default {
|
||||
vdiAction: 'Acción',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: 'Adjuntar disco',
|
||||
vdiAttachDevice: 'Adjuntar disco',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: 'Nuevo disco',
|
||||
|
||||
@@ -1865,7 +1865,7 @@ export default {
|
||||
vdiAction: 'Action',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: 'Attacher un disque',
|
||||
vdiAttachDevice: 'Attacher un disque',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: 'Nouveau disque',
|
||||
|
||||
@@ -1557,7 +1557,7 @@ export default {
|
||||
vdiAction: undefined,
|
||||
|
||||
// Original text: 'Attach disk'
|
||||
vdiAttachDeviceButton: undefined,
|
||||
vdiAttachDevice: undefined,
|
||||
|
||||
// Original text: 'New disk'
|
||||
vbdCreateDeviceButton: undefined,
|
||||
|
||||
@@ -1773,7 +1773,7 @@ export default {
|
||||
vdiAction: 'Művelet',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: 'Diszk Hozzácsatolás',
|
||||
vdiAttachDevice: 'Diszk Hozzácsatolás',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: 'Új diszk',
|
||||
|
||||
@@ -1567,7 +1567,7 @@ export default {
|
||||
vdiAction: 'Akcja',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: 'Dołącz dysk',
|
||||
vdiAttachDevice: 'Dołącz dysk',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: 'Nowy dysk',
|
||||
|
||||
@@ -1564,7 +1564,7 @@ export default {
|
||||
vdiAction: 'Ação',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: 'Anexar disco',
|
||||
vdiAttachDevice: 'Anexar disco',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: 'Novo disco',
|
||||
|
||||
@@ -2303,7 +2303,7 @@ export default {
|
||||
vdiAction: 'Aksiyon',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: 'Disk tak',
|
||||
vdiAttachDevice: 'Disk tak',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: 'Yeni disk',
|
||||
|
||||
@@ -1176,7 +1176,7 @@ export default {
|
||||
vdiAction: '操作',
|
||||
|
||||
// Original text: "Attach disk"
|
||||
vdiAttachDeviceButton: '附加磁盘',
|
||||
vdiAttachDevice: '附加磁盘',
|
||||
|
||||
// Original text: "New disk"
|
||||
vbdCreateDeviceButton: '新建磁盘',
|
||||
|
||||
@@ -1001,8 +1001,10 @@ const messages = {
|
||||
containerRestart: 'Restart this container',
|
||||
|
||||
// ----- VM disk tab -----
|
||||
vdiAttachDeviceButton: 'Attach disk',
|
||||
vbdCreateDeviceButton: 'New disk',
|
||||
vdiAttachDevice: 'Attach disk',
|
||||
vdiAttachDeviceConfirm:
|
||||
'The selected VDI is already attached to this VM. Are you sure you want to continue?',
|
||||
vdiBootOrder: 'Boot order',
|
||||
vdiNameLabel: 'Name',
|
||||
vdiNameDescription: 'Description',
|
||||
|
||||
@@ -453,10 +453,21 @@ class AttachDisk extends Component {
|
||||
const vbd = vbds[id]
|
||||
return !vbd || !vbd.attached || vbd.read_only
|
||||
})
|
||||
return attachDiskToVm(vdi, vm, {
|
||||
bootable,
|
||||
mode: readOnly || !_isFreeForWriting(vdi) ? 'RO' : 'RW',
|
||||
}).then(onClose)
|
||||
|
||||
const _attachDisk = () =>
|
||||
attachDiskToVm(vdi, vm, {
|
||||
bootable,
|
||||
mode: readOnly || !_isFreeForWriting(vdi) ? 'RO' : 'RW',
|
||||
}).then(onClose)
|
||||
|
||||
// check if the selected VDI is already attached to this VM.
|
||||
return some(vbds, { VDI: vdi.id, VM: vm.id })
|
||||
? confirm({
|
||||
body: _('vdiAttachDeviceConfirm'),
|
||||
icon: 'alarm',
|
||||
title: _('vdiAttachDevice'),
|
||||
}).then(_attachDisk)
|
||||
: _attachDisk()
|
||||
}
|
||||
|
||||
render() {
|
||||
@@ -886,7 +897,7 @@ export default class TabDisks extends Component {
|
||||
btnStyle={attachDisk ? 'info' : 'primary'}
|
||||
handler={this._toggleAttachDisk}
|
||||
icon='disk'
|
||||
labelId='vdiAttachDeviceButton'
|
||||
labelId='vdiAttachDevice'
|
||||
/>
|
||||
)}
|
||||
{vm.virtualizationMode !== 'pv' && (
|
||||
|
||||
Reference in New Issue
Block a user