[pve-devel] [PATCH manager 2/2] fix #1358: add cluster name to datacenter and login window
Dominik Csapak
d.csapak at proxmox.com
Wed Jun 21 11:51:47 CEST 2017
this shows the clustername in the datacenter tree node and
the login window title, if a clustername exists
Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
www/manager6/tree/ResourceTree.js | 8 +++++++-
www/manager6/window/LoginWindow.js | 8 ++++++++
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/www/manager6/tree/ResourceTree.js b/www/manager6/tree/ResourceTree.js
index f306e9c5..1d7589b8 100644
--- a/www/manager6/tree/ResourceTree.js
+++ b/www/manager6/tree/ResourceTree.js
@@ -222,12 +222,18 @@ Ext.define('PVE.tree.ResourceTree', {
updateCount: 0
};
+ var dcText = gettext('Datacenter');
+
+ if (PVE.Clustername !== '') {
+ dcText += ' (' + PVE.Clustername + ')';
+ }
+
var store = Ext.create('Ext.data.TreeStore', {
model: 'PVETree',
root: {
expanded: true,
id: 'root',
- text: gettext('Datacenter')
+ text: dcText
}
});
diff --git a/www/manager6/window/LoginWindow.js b/www/manager6/window/LoginWindow.js
index 29fd187f..baa657ca 100644
--- a/www/manager6/window/LoginWindow.js
+++ b/www/manager6/window/LoginWindow.js
@@ -93,6 +93,14 @@ Ext.define('PVE.window.LoginWindow', {
},
'#': {
show: function() {
+ var me = this.getView();
+
+ if (PVE.Clustername !== '') {
+ var title = me.getTitle();
+ title += ' (' + PVE.Clustername + ')';
+ me.setTitle(title);
+ }
+
var sp = Ext.state.Manager.getProvider();
var checkboxField = this.lookupReference('saveunField');
var unField = this.lookupReference('usernameField');
--
2.11.0
More information about the pve-devel
mailing list