]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/window/Settings.js
gui: let users choose the number of columns
[pve-manager.git] / www / manager6 / window / Settings.js
index 35b320f1f1b4a6af461686ca7ca724d626c2ac67..cb3f54467075b8ae94793e01005a14ac019511c5 100644 (file)
@@ -42,6 +42,9 @@ Ext.define('PVE.window.Settings', {
                me.lookupReference('noVNCScalingGroup').setValue({ noVNCScalingField: vncMode });
            }
 
+           let summarycolumns = sp.get('summarycolumns');
+           me.lookup('summarycolumns').setValue(summarycolumns || 'auto');
+
            var settings = ['fontSize', 'fontFamily', 'letterSpacing', 'lineHeight'];
            settings.forEach(function(setting) {
                var val = localStorage.getItem('pve-xterm-' + setting);
@@ -163,6 +166,12 @@ Ext.define('PVE.window.Settings', {
                    me.getSelectionModel().select(items);
                    me.resumeEvent('selectionchange');
                }
+           },
+           'field[reference=summarycolumns]': {
+               change: function(el, newValue) {
+                   var sp = Ext.state.Manager.getProvider();
+                   sp.set('summarycolumns', newValue);
+               }
            }
        }
     },
@@ -261,6 +270,23 @@ Ext.define('PVE.window.Settings', {
                    },
                ]
            },
+           {
+               xtype: 'box',
+               autoEl: { tag: 'hr'}
+           },
+           {
+               xtype: 'proxmoxKVComboBox',
+               fieldLabel: gettext('Summary columns') + ':',
+               labelWidth: 150,
+               stateId: 'summarycolumns',
+               reference: 'summarycolumns',
+               comboItems: [
+                   ['auto', 'auto'],
+                   ['1', '1'],
+                   ['2', '2'],
+                   ['3', '3'],
+               ],
+           },
        ]
     },
     {
@@ -386,9 +412,4 @@ Ext.define('PVE.window.Settings', {
            },
        ]
     }],
-
-    onShow: function() {
-       var me = this;
-       me.callParent();
-    }
 });