]> git.proxmox.com Git - pve-manager.git/commitdiff
ui: lxc resources: support font awesome icons directly
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 1 Apr 2022 08:44:01 +0000 (10:44 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 1 Apr 2022 08:44:03 +0000 (10:44 +0200)
like we do for the VMs hardware view

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
www/manager6/lxc/Resources.js

index 15ee3c67b7f87ce2cd69ddc6b01d9eb87f2996b5..364ecb19f6d6bbc4ff9b6c5fa8fa902925527f30 100644 (file)
@@ -5,14 +5,25 @@ Ext.define('PVE.lxc.RessourceView', {
     onlineHelp: 'pct_configuration',
 
     renderKey: function(key, metaData, rec, rowIndex, colIndex, store) {
-       var me = this;
-       var rowdef = me.rows[key] || {};
+       let me = this;
+       let rowdef = me.rows[key] || {};
+
+       let txt = rowdef.header || key;
+       let icon = '';
 
        metaData.tdAttr = "valign=middle";
        if (rowdef.tdCls) {
            metaData.tdCls = rowdef.tdCls;
+       } else if (rowdef.iconCls) {
+           icon = `<i class='pve-grid-fa fa fa-fw fa-${rowdef.iconCls}'></i>`;
+           metaData.tdCls += " pve-itype-fa";
+       }
+       // only return icons in grid but not remove dialog
+       if (rowIndex !== undefined) {
+           return icon + txt;
+       } else {
+           return txt;
        }
-       return rowdef.header || key;
     },
 
     initComponent: function() {