ui: tape/ChangerStatus: reload changer status (cached) every 5000ms

so that we can have an updated drive status without having to
press 'reload'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-02-22 14:25:35 +01:00 committed by Dietmar Maurer
parent 423e3cbd18
commit 076afa6197

View File

@ -395,12 +395,31 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
}).show();
},
scheduleReload: function(time) {
let me = this;
if (me.reloadTimeout === undefined) {
me.reloadTimeout = setTimeout(function() {
me.reload();
}, time);
}
},
reload: function() {
this.reload_full(true);
let me = this;
if (me.reloadTimeout !== undefined) {
clearTimeout(me.reloadTimeout);
me.reloadTimeout = undefined;
}
me.reload_full(true);
},
reload_no_cache: function() {
this.reload_full(false);
let me = this;
if (me.reloadTimeout !== undefined) {
clearTimeout(me.reloadTimeout);
me.reloadTimeout = undefined;
}
me.reload_full(false);
},
reload_full: async function(use_cache) {
@ -496,6 +515,8 @@ Ext.define('PBS.TapeManagement.ChangerStatus', {
}
Proxmox.Utils.setErrorMask(me.lookup('content'), err.toString());
}
me.scheduleReload(5000);
},
renderIsLabeled: function(value, mD, record) {