ui: cifs: monitor scan-store errors and show in combobox

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-07-01 11:51:31 +02:00
parent bc13cc36d3
commit fcd95fc1d2

View File

@ -92,6 +92,25 @@ Ext.define('PVE.storage.CIFSScan', {
});
me.callParent();
let picker = me.getPicker();
// don't use monStoreErrors directly, it doesn't copes well with comboboxes
picker.mon(store, 'beforeload', function(s, operation, eOpts) {
picker.unmask();
delete picker.minHeight;
});
picker.mon(store.proxy, 'afterload', function(proxy, request, success) {
if (success) {
Proxmox.Utils.setErrorMask(picker, false);
return;
}
let error = request._operation.getError();
let msg = Proxmox.Utils.getResponseErrorMessage(error);
if (msg) {
picker.minHeight = 100;
}
Proxmox.Utils.setErrorMask(picker, msg);
});
},
});