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 @@ -178,12 +178,15 @@ dispatcher_add(function(sammy) {
178
178
'permissions' : '/permissions' } , 'users' ) ;
179
179
sammy . get ( '#/users/:id' , function ( ) {
180
180
var vhosts = JSON . parse ( sync_get ( '/vhosts' ) ) ;
181
- render ( { 'user' : '/users/' + esc ( this . params [ 'id' ] ) ,
181
+ const current_vhost = get_pref ( 'vhost' ) ;
182
+ let index_vhost = vhosts . findIndex ( v => v . name === current_vhost ) ;
183
+ index_vhost = index_vhost === - 1 ? 0 : index_vhost ;
184
+ render ( { 'user' : '/users/' + esc ( this . params [ 'id' ] ) ,
182
185
'permissions' : '/users/' + esc ( this . params [ 'id' ] ) + '/permissions' ,
183
186
'topic_permissions' : '/users/' + esc ( this . params [ 'id' ] ) + '/topic-permissions' ,
184
187
'vhosts' : '/vhosts/' ,
185
- 'exchanges' : '/exchanges/' + esc ( vhosts [ 0 ] . name ) } , 'user' ,
186
- '#/users' ) ;
188
+ 'exchanges' : '/exchanges/' + esc ( vhosts [ index_vhost ] . name ) } ,
189
+ 'user' , '#/users' ) ;
187
190
} ) ;
188
191
sammy . put ( '#/users-add' , function ( ) {
189
192
res = sync_put ( this , '/users/:username' ) ;
You can’t perform that action at this time.
0 commit comments