info widget: code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-05-03 09:33:08 +02:00
parent fc0a18e6c2
commit 713a7f9379

View File

@ -63,11 +63,8 @@ Ext.define('Proxmox.widget.Info', {
var label = me.getComponent('label');
label.update(Ext.apply(label.data, { title: me.title, usage: text }));
if (usage !== undefined &&
me.printBar &&
Ext.isNumeric(usage) &&
usage >= 0) {
var progressBar = me.getComponent('progress');
if (usage !== undefined && me.printBar && Ext.isNumeric(usage) && usage >= 0) {
let progressBar = me.getComponent('progress');
progressBar.updateProgress(usage, '');
if (usage > me.criticalThreshold) {
progressBar.removeCls('warning');