File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
deps/rabbitmq_management/priv/www/js Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -190,12 +190,15 @@ dispatcher_add(function(sammy) {
190190 'permissions' : '/permissions' } , 'users' ) ;
191191 sammy . get ( '#/users/:id' , function ( ) {
192192 var vhosts = JSON . parse ( sync_get ( '/vhosts' ) ) ;
193- render ( { 'user' : '/users/' + esc ( this . params [ 'id' ] ) ,
193+ const current_vhost = get_pref ( 'vhost' ) ;
194+ let index_vhost = vhosts . findIndex ( v => v . name === current_vhost ) ;
195+ index_vhost = index_vhost === - 1 ? 0 : index_vhost ;
196+ render ( { 'user' : '/users/' + esc ( this . params [ 'id' ] ) ,
194197 'permissions' : '/users/' + esc ( this . params [ 'id' ] ) + '/permissions' ,
195198 'topic_permissions' : '/users/' + esc ( this . params [ 'id' ] ) + '/topic-permissions' ,
196199 'vhosts' : '/vhosts/' ,
197- 'exchanges' : '/exchanges/' + esc ( vhosts [ 0 ] . name ) } , 'user' ,
198- '#/users' ) ;
200+ 'exchanges' : '/exchanges/' + esc ( vhosts [ index_vhost ] . name ) } ,
201+ 'user' , '#/users' ) ;
199202 } ) ;
200203 sammy . put ( '#/users-add' , function ( ) {
201204 res = sync_put ( this , '/users/:username' ) ;
You can’t perform that action at this time.
0 commit comments