If we get the cluster name (successful login with '/' Sys.Audit
permissions) then display it in the resource tree's root node.
This updated on login and all ticket refreshs (every 15 minutes).
I currently have no functionallity to refresh it actively on cluster
create over WebUI, as it's not a straight forward change there.
Further, this is something which does not changes often (in
production), and we cannot detect CLI or API triggered (from non-pve
clients) cluster creations anyway.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Proxmox.CSRFPreventionToken = loginData.CSRFPreventionToken;
Proxmox.UserName = loginData.username;
+ var rt = me.down('pveResourceTree');
+ rt.setDatacenterText(loginData.clustername);
+
if (loginData.cap) {
Ext.state.Manager.set('GuiCap', loginData.cap);
}
me.showLogin();
me.setContent(null);
var rt = me.down('pveResourceTree');
+ rt.setDatacenterText(undefined);
rt.clearTree();
// empty the stores of the StatusPanel child items
me.clearTree();
updateTree();
},
+ setDatacenterText: function(clustername) {
+ var rootnode = me.store.getRootNode();
+
+ var rnodeText = gettext('Datacenter');
+ if (clustername !== undefined) {
+ rnodeText += ' (' + clustername + ')';
+ }
+
+ rootnode.beginEdit();
+ rootnode.data.text = rnodeText;
+ rootnode.commit();
+ },
clearTree: function() {
pdata.updateCount = 0;
var rootnode = me.store.getRootNode();