ui: refactor get_type_icon_cls

we need this later again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2021-02-02 14:00:35 +01:00 committed by Dietmar Maurer
parent 50a4797fb1
commit f806c0effa
2 changed files with 14 additions and 8 deletions

View File

@ -260,6 +260,18 @@ Ext.define('PBS.Utils', {
return dedup; return dedup;
}, },
get_type_icon_cls: function(btype) {
var cls = '';
if (btype.startsWith('vm')) {
cls = 'fa-desktop';
} else if (btype.startsWith('ct')) {
cls = 'fa-cube';
} else if (btype.startsWith('host')) {
cls = 'fa-building';
}
return cls;
},
constructor: function() { constructor: function() {
var me = this; var me = this;

View File

@ -105,14 +105,8 @@ Ext.define('PBS.DataStoreContent', {
continue; continue;
} }
var cls = ''; var cls = PBS.Utils.get_type_icon_cls(btype);
if (btype === 'vm') { if (cls === "") {
cls = 'fa-desktop';
} else if (btype === 'ct') {
cls = 'fa-cube';
} else if (btype === 'host') {
cls = 'fa-building';
} else {
console.warn(`got unknown backup-type '${btype}'`); console.warn(`got unknown backup-type '${btype}'`);
continue; // FIXME: auto render? what do? continue; // FIXME: auto render? what do?
} }