diff options
author | Arnaud Cogoluègnes <acogoluegnes@gmail.com> | 2021-09-13 15:17:49 +0200 |
---|---|---|
committer | Arnaud Cogoluègnes <acogoluegnes@gmail.com> | 2021-09-13 15:17:49 +0200 |
commit | 39a51772c6f73b7838bc117850f1c98014116db4 (patch) | |
tree | 459893947cbb295bfe97256d32b8849cfcdb3ff8 | |
parent | b5700751cfdc0864f14eed9eb04e78ed9f68f859 (diff) | |
download | rabbitmq-server-git-39a51772c6f73b7838bc117850f1c98014116db4.tar.gz |
Add extension into dispatcher block code
This is necessary to make sure the extension addition is actually
done in case of refresh of the queue page.
References #3389
-rw-r--r-- | deps/rabbitmq_stream_management/priv/www/js/stream.js | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/deps/rabbitmq_stream_management/priv/www/js/stream.js b/deps/rabbitmq_stream_management/priv/www/js/stream.js index ac546ad51b..2b881ed173 100644 --- a/deps/rabbitmq_stream_management/priv/www/js/stream.js +++ b/deps/rabbitmq_stream_management/priv/www/js/stream.js @@ -11,7 +11,25 @@ dispatcher_add(function(sammy) { 'publishers': '/stream/connections/' + vhost + '/' + name + '/publishers'}, 'streamConnection', '#/stream/connections'); }); - + // not exactly dispatcher stuff, but we have to make sure this is called before + // HTTP requests are made in case of refresh of the queue page + QUEUE_EXTRA_CONTENT_REQUESTS.push(function(vhost, queue) { + return {'extra_stream_publishers' : '/stream/publishers/' + esc(vhost) + '/' + esc(queue)}; + }); + QUEUE_EXTRA_CONTENT.push(function(queue, extraContent) { + if (is_stream(queue)) { + var publishers = extraContent['extra_stream_publishers']; + if (publishers !== undefined) { + return '<div class="section"><h2>Stream publishers</h2><div class="hider updatable">' + + format('streamPublishersList', {'publishers': publishers}) + + '</div></div>'; + } else { + return ''; + } + } else { + return ''; + } + }); }); NAVIGATION['Stream'] = ['#/stream/connections', "monitoring"]; @@ -63,22 +81,3 @@ CONSUMER_OWNER_FORMATTERS.push({ CONSUMER_OWNER_FORMATTERS.sort(CONSUMER_OWNER_FORMATTERS_COMPARATOR); -QUEUE_EXTRA_CONTENT_REQUESTS.push(function(vhost, queue) { - return {'extra_stream_publishers' : '/stream/publishers/' + esc(vhost) + '/' + esc(queue)}; -}); - -QUEUE_EXTRA_CONTENT.push(function(queue, extraContent) { - if (is_stream(queue)) { - var publishers = extraContent['extra_stream_publishers']; - if (publishers !== undefined) { - return '<div class="section"><h2>Stream publishers</h2><div class="hider updatable">' + - format('streamPublishersList', {'publishers': publishers}) + - '</div></div>'; - - } else { - return ''; - } - } else { - return ''; - } -});
\ No newline at end of file |