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) {
190
190
'permissions' : '/permissions' } , 'users' ) ;
191
191
sammy . get ( '#/users/:id' , function ( ) {
192
192
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' ] ) ,
194
197
'permissions' : '/users/' + esc ( this . params [ 'id' ] ) + '/permissions' ,
195
198
'topic_permissions' : '/users/' + esc ( this . params [ 'id' ] ) + '/topic-permissions' ,
196
199
'vhosts' : '/vhosts/' ,
197
- 'exchanges' : '/exchanges/' + esc ( vhosts [ 0 ] . name ) } , 'user' ,
198
- '#/users' ) ;
200
+ 'exchanges' : '/exchanges/' + esc ( vhosts [ index_vhost ] . name ) } ,
201
+ 'user' , '#/users' ) ;
199
202
} ) ;
200
203
sammy . put ( '#/users-add' , function ( ) {
201
204
res = sync_put ( this , '/users/:username' ) ;
You can’t perform that action at this time.
0 commit comments