X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=www%2Fmanager6%2Fwindow%2FGuestDiskReassign.js;h=f6d08b32b39791ceff6f1a07f443babc20751f3e;hb=f0535b036dba565412f0b736c536fd8dcfe0c9c9;hp=6ae168cae7890588ae90ca943073e3e8b408220e;hpb=d72ad78bd41c4bf31ebf8ef7573e5374da2cc462;p=pve-manager.git diff --git a/www/manager6/window/GuestDiskReassign.js b/www/manager6/window/GuestDiskReassign.js index 6ae168ca..f6d08b32 100644 --- a/www/manager6/window/GuestDiskReassign.js +++ b/www/manager6/window/GuestDiskReassign.js @@ -72,8 +72,9 @@ Ext.define('PVE.window.GuestDiskReassign', { }, onMpTypeChange: function(value) { - this.getView().getViewModel().set('mpType', value.getValue()); - this.getView().lookup('mpIdSelector').validate(); + let view = this.getView(); + view.getViewModel().set('mpType', value.getValue()); + view.lookup('mpIdSelector').validate(); }, onTargetVMChange: function(f, vmid) { @@ -86,22 +87,20 @@ Ext.define('PVE.window.GuestDiskReassign', { return; } - let type = view.qemu ? 'qemu' : 'lxc'; - - let url = `/nodes/${view.nodename}/${type}/${vmid}/config`; + let url = `/nodes/${view.nodename}/${view.type}/${vmid}/config`; Proxmox.Utils.API2Request({ url: url, method: 'GET', failure: response => Ext.Msg.alert(gettext('Error'), response.htmlStatus), - success: function(response, options) { + success: function({ result }, options) { if (view.qemu) { - diskSelector.setVMConfig(response.result.data); + diskSelector.setVMConfig(result.data); diskSelector.setDisabled(false); } else { let mpIdSelector = view.lookup('mpIdSelector'); let mpType = view.lookup('mpType'); - view.VMConfig = response.result.data; + view.VMConfig = result.data; mpIdSelector.setValue( PVE.Utils.nextFreeMP( @@ -133,13 +132,9 @@ Ext.define('PVE.window.GuestDiskReassign', { }, { xtype: 'vmComboSelector', - reference: 'targetVMID', name: 'targetVmid', allowBlank: false, fieldLabel: gettext('Target Guest'), - bind: { - value: '{targetVMID}', - }, store: { model: 'PVEResources', autoLoad: true, @@ -148,22 +143,17 @@ Ext.define('PVE.window.GuestDiskReassign', { filters: [ { property: 'type', - cbind: { - value: get => get('isQemu') ? 'qemu' : 'lxc', - }, + cbind: { value: '{type}' }, }, { property: 'node', - cbind: { - value: '{nodename}', - }, + cbind: { value: '{nodename}' }, }, + // FIXME: remove, artificial restriction that doesn't gains us anything.. { property: 'vmid', operator: '!=', - cbind: { - value: '{vmid}', - }, + cbind: { value: '{vmid}' }, }, { property: 'template', @@ -205,7 +195,6 @@ Ext.define('PVE.window.GuestDiskReassign', { editConfig: { xtype: 'proxmoxKVComboBox', name: 'mpTypeCombo', - reference: 'mpTypeCombo', deleteEmpty: false, cbind: { hidden: '{isQemu}',