diff options
author | Michael Klishin <klishinm@vmware.com> | 2021-10-07 03:04:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-07 03:04:52 +0300 |
commit | d16037b419cf5a2e3cbb53594500f27a0b47ff8b (patch) | |
tree | bcd72526b5b9635d1e5b750824e4d700d08dfef4 | |
parent | 862917955b953cc15ab3108912bd299b2c0faf6c (diff) | |
parent | 5f81fff959302d445bc341eb834a8afb529f29b7 (diff) | |
download | rabbitmq-server-git-d16037b419cf5a2e3cbb53594500f27a0b47ff8b.tar.gz |
Merge pull request #3545 from LuisCusihuaman/filter-exchanges-by-vhost-fix
fix: list exchanges in current virtual host in topic permissions
-rw-r--r-- | deps/rabbitmq_management/priv/www/js/dispatcher.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/deps/rabbitmq_management/priv/www/js/dispatcher.js b/deps/rabbitmq_management/priv/www/js/dispatcher.js index feb1974c3c..758a240d30 100644 --- a/deps/rabbitmq_management/priv/www/js/dispatcher.js +++ b/deps/rabbitmq_management/priv/www/js/dispatcher.js @@ -190,12 +190,15 @@ dispatcher_add(function(sammy) { 'permissions': '/permissions'}, 'users'); sammy.get('#/users/:id', function() { var vhosts = JSON.parse(sync_get('/vhosts')); - render({'user': '/users/' + esc(this.params['id']), + const current_vhost = get_pref('vhost'); + let index_vhost = vhosts.findIndex(v => v.name === current_vhost); + index_vhost = index_vhost === -1 ? 0 : index_vhost; + render({'user': '/users/' + esc(this.params['id']), 'permissions': '/users/' + esc(this.params['id']) + '/permissions', 'topic_permissions': '/users/' + esc(this.params['id']) + '/topic-permissions', 'vhosts': '/vhosts/', - 'exchanges': '/exchanges/' + esc(vhosts[0].name)}, 'user', - '#/users'); + 'exchanges': '/exchanges/' + esc(vhosts[index_vhost].name)}, + 'user','#/users'); }); sammy.put('#/users-add', function() { res = sync_put(this, '/users/:username'); |