From b62e09806bba2e9e83b82c009fa4bac76d7c316f 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. --- 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 a35821ebd7..0e3f59025d 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 ef6c543bba..09a3435435 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) { %>