}
],
- layout: {
- type: 'hbox',
- align: 'top'
- },
+ layout: 'hbox',
controller: {
xclass: 'Ext.app.ViewController',
var sp = Ext.state.Manager.getProvider();
var username = sp.get('login-username') || Proxmox.Utils.noneText;
- me.lookupReference('savedUserName').setValue(username);
+ me.lookupReference('savedUserName').setValue(Ext.String.htmlEncode(username));
var vncMode = sp.get('novnc-scaling');
if (vncMode !== undefined) {
- me.lookupReference('noVNCScalingGroup').setValue(vncMode);
+ me.lookupReference('noVNCScalingGroup').setValue({ noVNCScalingField: vncMode });
}
+ let summarycolumns = sp.get('summarycolumns', 'auto');
+ me.lookup('summarycolumns').setValue(summarycolumns);
+
+ me.lookup('guestNotesCollapse').setValue(sp.get('guest-notes-collapse', 'never'));
+
var settings = ['fontSize', 'fontFamily', 'letterSpacing', 'lineHeight'];
settings.forEach(function(setting) {
var val = localStorage.getItem('pve-xterm-' + setting);
me.getSelectionModel().select(items);
me.resumeEvent('selectionchange');
}
- }
+ },
+ 'field[reference=summarycolumns]': {
+ change: function(el, newValue) {
+ var sp = Ext.state.Manager.getProvider();
+ sp.set('summarycolumns', newValue);
+ }
+ },
+ 'field[reference=guestNotesCollapse]': {
+ change: function(e, v) {
+ Ext.state.Manager.getProvider().set('guest-notes-collapse', v);
+ },
+ },
}
},
items: [{
xtype: 'fieldset',
- width: '50%',
+ flex: 1,
title: gettext('Webinterface Settings'),
margin: '5',
layout: {
items: [
{
xtype: 'displayfield',
- fieldLabel: gettext('Saved User Name:'),
+ fieldLabel: gettext('Saved User Name') + ':',
labelWidth: '150',
stateId: 'login-username',
reference: 'savedUserName',
items: [
{
xtype: 'displayfield',
- fieldLabel: gettext('Layout:'),
+ fieldLabel: gettext('Layout') + ':',
flex: 1,
},
{
},
]
},
+ {
+ 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'],
+ ],
+ },
+ {
+ xtype: 'proxmoxKVComboBox',
+ fieldLabel: gettext('Guest Notes') + ':',
+ labelWidth: 150,
+ stateId: 'guest-notes-collapse',
+ reference: 'guestNotesCollapse',
+ comboItems: [
+ ['never', 'Show by default'],
+ ['always', 'Collapse by default'],
+ ['auto', 'auto (Collapse if empty)'],
+ ],
+ },
]
- },{
+ },
+ {
xtype: 'container',
layout: 'vbox',
- width: '50%',
+ flex: 1,
margin: '5',
defaults: {
width: '100%',
type: 'hbox',
pack: 'end'
},
+ defaults: {
+ margin: '0 0 0 5',
+ },
items: [
{
xtype: 'button',
listeners: {
change: function(el, newValue, undefined) {
var sp = Ext.state.Manager.getProvider();
- sp.set('novnc-scaling', newValue);
+ sp.set('novnc-scaling', newValue.noVNCScalingField);
}
},
},
},
]
}],
-
- onShow: function() {
- var me = this;
- me.callParent();
- }
});