From 082456a5396d4e3e0b3838270f01589e1ff3ad71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20G=C3=B6m=C3=B6ri?= Date: Mon, 3 Feb 2025 18:29:08 +0100 Subject: [PATCH] Show consumer count column on Mgmt UI Channels page Consumer count is already returned by the /channels API endpoint. Now the consumer count column can be shown in the channels table but it is hidden by default. (cherry picked from commit b62e09806bba2e9e83b82c009fa4bac76d7c316f) (cherry picked from commit 31b9ecb34ec4923d32e68344e68610e27f3873a5) --- deps/rabbitmq_management/priv/www/js/global.js | 1 + .../priv/www/js/tmpl/channels-list.ejs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/deps/rabbitmq_management/priv/www/js/global.js b/deps/rabbitmq_management/priv/www/js/global.js index a3ad397bc061..c304571eb966 100644 --- a/deps/rabbitmq_management/priv/www/js/global.js +++ b/deps/rabbitmq_management/priv/www/js/global.js @@ -96,6 +96,7 @@ var ALL_COLUMNS = ['mode', 'Mode', true], ['state', 'State', true]], 'Details': [['msgs-unconfirmed', 'Unconfirmed', true], + ['consumer-count', 'Consumer count', false], ['prefetch', 'Prefetch', true], ['msgs-unacked', 'Unacked', true]], 'Transactions': [['msgs-uncommitted', 'Msgs uncommitted', false], diff --git a/deps/rabbitmq_management/priv/www/js/tmpl/channels-list.ejs b/deps/rabbitmq_management/priv/www/js/tmpl/channels-list.ejs index ef6c543bbaf3..09a34354357a 100644 --- a/deps/rabbitmq_management/priv/www/js/tmpl/channels-list.ejs +++ b/deps/rabbitmq_management/priv/www/js/tmpl/channels-list.ejs @@ -35,6 +35,9 @@ <% if (show_column('channels', 'msgs-unconfirmed')) { %> <%= fmt_sort('Unconfirmed', 'messages_unconfirmed') %> <% } %> +<% if (show_column('channels', 'consumer-count')) { %> + <%= fmt_sort('Consumer count', 'consumer_count') %> +<% } %> <% if (show_column('channels', 'prefetch')) { %> Prefetch <% } %> @@ -85,6 +88,9 @@ <% if (show_column('channels', 'msgs-unconfirmed')) { %> Unconfirmed <% } %> +<% if (show_column('channels', 'consumer-count')) { %> + Consumer count +<% } %> <% if (show_column('channels', 'prefetch')) { %> Prefetch <% } %> @@ -152,6 +158,9 @@ <% if (show_column('channels', 'msgs-unconfirmed')) { %> <%= channel.messages_unconfirmed %> <% } %> +<% if (show_column('channels', 'consumer-count')) { %> + <%= channel.consumer_count %> +<% } %> <% if (show_column('channels', 'prefetch')) { %> <% if (channel.prefetch_count != 0) { %>