Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit bfb1347

Browse files
Merge pull request #172 from rabbitmq/rabbitmq-server-104
Display user-provided connection name, if any
2 parents b2f8f3c + 2afbf20 commit bfb1347

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

priv/www/js/tmpl/connection.ejs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h1>Connection <b><%= fmt_string(connection.name) %></b><%= fmt_maybe_vhost(connection.vhost) %></h1>
1+
<h1>Connection <%= fmt_string(connection.name) %> <%= fmt_maybe_vhost(connection.vhost) %></h1>
22

33
<div class="section">
44
<h2>Overview</h2>
@@ -13,6 +13,14 @@
1313
<td><%= fmt_node(connection.node) %></td>
1414
</tr>
1515
<% } %>
16+
17+
<% if (connection.client_properties.connection_name) { %>
18+
<tr>
19+
<th>Client-provided name</th>
20+
<td><%= fmt_string(connection.client_properties.connection_name) %></td>
21+
</tr>
22+
<% } %>
23+
1624
<tr>
1725
<th>Username</th>
1826
<td><%= fmt_string(connection.user) %></td>

priv/www/js/tmpl/connections.ejs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<% if (vhosts_interesting) { %>
1717
<th><%= fmt_sort('Virtual host', 'vhost') %></th>
1818
<% } %>
19-
<th><%= fmt_sort('Name', 'name') %></th>
19+
<th><%= fmt_sort('Name', 'client_properties.connection_name;name') %></th>
2020
<% if (nodes_interesting) { %>
2121
<th><%= fmt_sort('Node', 'node') %></th>
2222
<% } %>
@@ -73,7 +73,13 @@
7373
<% if (vhosts_interesting) { %>
7474
<td><%= fmt_string(connection.vhost) %></td>
7575
<% } %>
76+
<% if(connection.client_properties.connection_name) { %>
77+
<td><%= link_conn(connection.name) %>
78+
<%= fmt_string(short_conn(connection.client_properties.connection_name)) %>
79+
</td>
80+
<% } else { %>
7681
<td><%= link_conn(connection.name) %></td>
82+
<% } %>
7783
<% if (nodes_interesting) { %>
7884
<td><%= fmt_node(connection.node) %></td>
7985
<% } %>

src/rabbit_mgmt_util.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,8 @@ get_dotted_value0([Key], Item) ->
388388
get_dotted_value0([Key | Keys], Item) ->
389389
get_dotted_value0(Keys, pget_bin(list_to_binary(Key), Item, [])).
390390

391+
pget_bin(Key, {struct, List}, Default) ->
392+
pget_bin(Key, List, Default);
391393
pget_bin(Key, List, Default) ->
392394
case lists:partition(fun ({K, _V}) -> a2b(K) =:= Key end, List) of
393395
{[{_K, V}], _} -> V;

0 commit comments

Comments
 (0)