You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2020/03/16 13:37:43 UTC
[qpid-dispatch] branch master updated: DISPATCH-1604: Display
correct user name in console
This is an automated email from the ASF dual-hosted git repository.
eallen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
The following commit(s) were added to refs/heads/master by this push:
new 5605ee0 DISPATCH-1604: Display correct user name in console
5605ee0 is described below
commit 5605ee0172853819bd6078c1a12b8f9e63559ea2
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Mon Mar 16 09:37:28 2020 -0400
DISPATCH-1604: Display correct user name in console
---
console/react/src/overview/dashboard/layout.js | 35 ++++++++++++++++++++------
1 file changed, 28 insertions(+), 7 deletions(-)
diff --git a/console/react/src/overview/dashboard/layout.js b/console/react/src/overview/dashboard/layout.js
index 1a0eef2..5a58c37 100644
--- a/console/react/src/overview/dashboard/layout.js
+++ b/console/react/src/overview/dashboard/layout.js
@@ -213,13 +213,34 @@ class PageLayout extends React.PureComponent {
);
//this.redirect = true;
- this.props.history.replace(connectPath);
- this.setState({
- activeItem,
- activeGroup,
- connected: true,
- isConnectFormOpen: false
- });
+ let user = "anonymous";
+ let parts = this.service.management.connection.getReceiverAddress().split("/");
+ parts[parts.length - 1] = "$management";
+ let router = parts.join("/");
+ // get connections for router to which console is connected
+ this.service.management.topology.fetchEntity(
+ router,
+ "connection",
+ [],
+ (_nodeId, _entity, response) => {
+ response.results.some(result => {
+ let c = utils.flatten(response.attributeNames, result);
+ if (utils.isConsole(c)) {
+ user = c.user;
+ return true;
+ }
+ return false;
+ });
+ this.props.history.replace(connectPath);
+ this.setState({
+ user,
+ activeItem,
+ activeGroup,
+ connected: true,
+ isConnectFormOpen: false
+ });
+ }
+ );
}
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org