+/*global Proxmox*/
Ext.define('PMG.MainView', {
extend: 'Ext.container.Container',
xtype: 'mainview',
action: 'changePath',
before: 'beforeChangePath',
conditions : {
- ':path' : '(?:([%a-zA-Z0-9\-\_\s,]+))',
- ':subpath' : '(?:(?::)([%a-zA-Z0-9\-\_\s,]+))?'
+ ':path' : '(?:([%a-zA-Z0-9\\-\\_\\s,]+))',
+ ':subpath' : '(?:(?::)([%a-zA-Z0-9\\-\\_\\s,]+))?'
}
}
},
subpath = subpath || 0;
if (lastpanel.getActiveTab) {
// we assume lastpanel is a tabpanel
- if (lastpanel.getActiveTab().getItemId() === subpath) {
- // we are already there
- } else {
+ if (lastpanel.getActiveTab().getItemId() !== subpath) {
// set the active tab
lastpanel.setActiveTab(subpath);
}
+ // else we are already there
}
action.stop();
return;
},
logout: function() {
- var me = this;
- Proxmox.Utils.authClear();
- me.getView().destroy();
- Ext.create({ xtype: 'loginview'});
+ PMG.app.logout();
},
navigate: function(treelist, item) {
plugins: 'viewport',
- layout: 'border',
+ layout: { type: 'border' },
items: [
{
type: 'hbox',
align: 'middle'
},
- margin: '4 5 4 5',
+ margin: '2 5 2 5',
+ height: 38,
items: [
{
xtype: 'proxmoxlogo'
baseCls: 'x-plain',
reference: 'usernameinfo',
padding: '0 5',
- tpl: Ext.String.format(gettext("You are logged in as '{0}'"), '{username}')
+ tpl: Ext.String.format(gettext("You are logged in as {0}"), "'{username}'")
+ },
+ {
+ xtype: 'proxmoxHelpButton',
+ hidden: false,
+ baseCls: 'x-btn',
+ iconCls: 'fa fa-info-circle x-btn-icon-el-default-toolbar-small ',
+ margin: '0 5 0 0',
+ listenToGlobalEvent: false,
+ onlineHelp: 'pmg_documentation_index'
},
{
reference: 'logoutButton',
xtype: 'button',
iconCls: 'fa fa-sign-out',
- text: gettext('Logout'),
+ text: gettext('Logout')
}
]
},
{
- xtype: 'navigationtree',
- reference: 'navtree',
- minWidth: 177,
+ xtype: 'panel',
+ scrollable: 'y',
border: false,
region: 'west',
- // we have to define it here until extjs 6.2
- // because of a bug where a viewcontroller does not detect
- // the selectionchange event of a treelist
- listeners: {
- selectionchange: 'navigate'
- }
+ layout: {
+ type: 'vbox',
+ align: 'stretch'
+ },
+ items: [{
+ xtype: 'navigationtree',
+ minWidth: 180,
+ reference: 'navtree',
+ // we have to define it here until extjs 6.2
+ // because of a bug where a viewcontroller does not detect
+ // the selectionchange event of a treelist
+ listeners: {
+ selectionchange: 'navigate'
+ }
+ }, {
+ xtype: 'box',
+ cls: 'x-treelist-nav',
+ flex: 1
+ }]
},
{
xtype: 'panel',
- layout: 'card',
+ layout: { type: 'card' },
region: 'center',
border: false,
- reference: 'contentpanel',
+ reference: 'contentpanel'
}
]
});