]> git.proxmox.com Git - pmg-gui.git/commitdiff
MainView: make UserName a button/menu
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 16 Apr 2020 13:39:51 +0000 (15:39 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 16 Apr 2020 13:42:02 +0000 (15:42 +0200)
with logout as only option.

This makes the header style again consistent between
pmg quarantine/pmg admin/pve

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
js/MainView.js

index d568f1acfc3525e5aa42f65495b8302f92b47c8d..d9a48205d26c3313aec5d4418cc1784ce2b333e0 100644 (file)
@@ -92,7 +92,7 @@ Ext.define('PMG.MainView', {
        },
 
        control: {
-           'button[reference=logoutButton]': {
+           '[reference=logoutButton]': {
                click: 'logout'
            }
        },
@@ -101,7 +101,7 @@ Ext.define('PMG.MainView', {
            var me = this;
 
            // load username
-           me.lookupReference('usernameinfo').update({username:Proxmox.UserName});
+           me.lookupReference('usernameinfo').setText(Proxmox.UserName);
 
            // show login on requestexception
            // fixme: what about other errors
@@ -169,12 +169,6 @@ Ext.define('PMG.MainView', {
                {
                    flex: 1
                },
-               {
-                   baseCls: 'x-plain',
-                   reference: 'usernameinfo',
-                   padding: '0 5',
-                   tpl: Ext.String.format(gettext("You are logged in as {0}"), "'{username}'")
-               },
                {
                    xtype: 'proxmoxHelpButton',
                    text: gettext('Documentation'),
@@ -186,11 +180,23 @@ Ext.define('PMG.MainView', {
                    onlineHelp: 'pmg_documentation_index'
                },
                {
-                   reference: 'logoutButton',
                    xtype: 'button',
-                   iconCls: 'fa fa-sign-out',
-                   text: gettext('Logout')
-               }
+                   reference: 'usernameinfo',
+                   style: {
+                       // proxmox dark grey p light grey as border
+                       backgroundColor: '#464d4d',
+                       borderColor: '#ABBABA'
+                   },
+                   margin: '0 5 0 0',
+                   iconCls: 'fa fa-user',
+                   menu: [
+                       {
+                           reference: 'logoutButton',
+                           iconCls: 'fa fa-sign-out',
+                           text: gettext('Logout')
+                       },
+                   ],
+               },
            ]
        },
        {