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.
This commit is contained in:
Péter Gömöri 2025-02-03 18:29:08 +01:00
parent 40172aa183
commit b62e09806b
2 changed files with 10 additions and 0 deletions

View File

@ -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],

View File

@ -35,6 +35,9 @@
<% if (show_column('channels', 'msgs-unconfirmed')) { %>
<th><%= fmt_sort('Unconfirmed', 'messages_unconfirmed') %></th>
<% } %>
<% if (show_column('channels', 'consumer-count')) { %>
<th><%= fmt_sort('Consumer count', 'consumer_count') %></th>
<% } %>
<% if (show_column('channels', 'prefetch')) { %>
<th>Prefetch <span class="help" id="channel-prefetch"></span></th>
<% } %>
@ -85,6 +88,9 @@
<% if (show_column('channels', 'msgs-unconfirmed')) { %>
<th>Unconfirmed</th>
<% } %>
<% if (show_column('channels', 'consumer-count')) { %>
<th>Consumer count</th>
<% } %>
<% if (show_column('channels', 'prefetch')) { %>
<th>Prefetch <span class="help" id="channel-prefetch"></span></th>
<% } %>
@ -152,6 +158,9 @@
<% if (show_column('channels', 'msgs-unconfirmed')) { %>
<td class="c"><%= channel.messages_unconfirmed %></td>
<% } %>
<% if (show_column('channels', 'consumer-count')) { %>
<td class="c"><%= channel.consumer_count %></td>
<% } %>
<% if (show_column('channels', 'prefetch')) { %>
<td class="c">
<% if (channel.prefetch_count != 0) { %>