Display correct user name in console
@@ -213,14 +213,35 @@ class PageLayout extends React.PureComponent {
);
//this.redirect = true;
+ 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
});
}
+ );
+ }
};
onNavSelect = result => {
