Add publishers in stream connection details page

This commit is contained in:
Arnaud Cogoluègnes 2020-12-07 17:52:03 +01:00
parent 22195f7934
commit 9e1279434e
No known key found for this signature in database
GPG Key ID: D5C8C4DFAD43AFA8
3 changed files with 39 additions and 2 deletions

View File

@ -7,7 +7,8 @@ dispatcher_add(function(sammy) {
var name = esc(this.params['name']);
render({'connection': {path: '/stream/connections/'+ vhost + '/' + name,
options: {ranges: ['data-rates-conn']}},
'consumers': '/stream/connections/' + vhost + '/' + name + '/consumers'},
'consumers': '/stream/connections/' + vhost + '/' + name + '/consumers',
'publishers': '/stream/connections/' + vhost + '/' + name + '/publishers'},
'streamConnection', '#/stream/connections');
});

View File

@ -65,7 +65,14 @@
</div>
<div class="section">
<h2>Channels</h2>
<h2>Publishers</h2>
<div class="hider updatable">
<%= format('streamPublishersList', {'publishers': publishers}) %>
</div>
</div>
<div class="section">
<h2>Consumers</h2>
<div class="hider updatable">
<%= format('streamConsumersList', {'consumers': consumers}) %>
</div>

View File

@ -0,0 +1,29 @@
<% if (publishers.length > 0) { %>
<table class="list">
<thead>
<tr>
<th>ID</th>
<th>Reference</th>
<th>Queue</th>
<th>Messages Published</th>
<th>Messages Confirmed</th>
<th>Messages Errored</th>
</tr>
</thead>
<%
for (var i = 0; i < publishers.length; i++) {
var publisher = publishers[i];
%>
<tr<%= alt_rows(i) %>>
<td><%= publisher.publisher_id %></td>
<td class="c"><%= fmt_string(publisher.reference) %></td>
<td><%= link_queue(publisher.queue.vhost, publisher.queue.name) %></td>
<td class="c"><%= publisher.published %></td>
<td class="c"><%= publisher.confirmed %></td>
<td class="c"><%= publisher.errored %></td>
</tr>
<% } %>
</table>
<% } else { %>
<p>... no publishers ...</p>
<% } %>