ui: pool view: fix editing nested pools
for nested pools we have to provide the pool id via a get parameter instead of in the path, and also we have to extract the data from the returned array. To do this, changet the cbind url handler, remove the autoLoad one, and handle the load ourselves. Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
parent
38d153d6c7
commit
cb92b114f3
@ -11,8 +11,7 @@ Ext.define('PVE.dc.PoolEdit', {
|
||||
},
|
||||
|
||||
cbind: {
|
||||
autoLoad: get => !get('isCreate'),
|
||||
url: get => `/api2/extjs/pools/${get('poolid')}`,
|
||||
url: get => `/api2/extjs/pools/${!get('isCreate') ? '?poolid=' + get('poolid') : ''}`,
|
||||
method: get => get('isCreate') ? 'POST' : 'PUT',
|
||||
},
|
||||
|
||||
@ -34,4 +33,21 @@ Ext.define('PVE.dc.PoolEdit', {
|
||||
allowBlank: true,
|
||||
},
|
||||
],
|
||||
|
||||
initComponent: function() {
|
||||
let me = this;
|
||||
me.callParent();
|
||||
if (me.poolid) {
|
||||
me.load({
|
||||
success: function(response) {
|
||||
let data = response.result.data;
|
||||
if (Ext.isArray(data)) {
|
||||
me.setValues(data[0]);
|
||||
} else {
|
||||
me.setValues(data);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user