Show nodes in maintenance mode in UI

This commit is contained in:
Simon Unge 2023-06-15 17:04:49 +00:00 committed by Michael Klishin
parent b959a92cfa
commit 782830f4bd
4 changed files with 11 additions and 2 deletions

View File

@ -13,6 +13,12 @@
<div class="hider">
<div class="box">
<table class="facts facts-l">
<% if (node.drained) { %>
<tr>
<th>Status</th>
<td><abbr class="status-yellow" title="Broker is in maintenance mode.">In maintenance mode</abbr></td>
</tr>
<% } %>
<tr>
<th>Uptime</th>
<td><%= fmt_uptime(node.uptime) %></td>

View File

@ -190,6 +190,9 @@
<% } %>
<% if (show_column('overview', 'info')) { %>
<td>
<% if (node.drained) { %>
<abbr class="status-yellow" title="Broker in maintenance mode">maint.mode</abbr>
<% } %>
<abbr title="Message rates"><%= fmt_string(node.rates_mode) %></abbr>
<% if (node.type == 'disc') { %>
<abbr title="Broker definitions are held on disc.">disc</abbr>

View File

@ -63,7 +63,7 @@ node_data(Node, ReqData) ->
Nodes = proplists:get_value(nodes, S),
Running = proplists:get_value(running_nodes, S),
Type = find_type(Node, Nodes),
Basic = [[{name, Node}, {running, lists:member(Node, Running)}, {type, Type}]],
Basic = [[{name, Node}, {running, lists:member(Node, Running)}, {type, Type}, {drained, rabbit_maintenance:is_being_drained_local_read(Node)}]],
case rabbit_mgmt_util:disable_stats(ReqData) of
false ->
rabbit_mgmt_db:augment_nodes(Basic, rabbit_mgmt_util:range_ceil(ReqData));

View File

@ -51,5 +51,5 @@ all_nodes_raw() ->
Nodes = proplists:get_value(nodes, S),
Types = proplists:get_keys(Nodes),
Running = proplists:get_value(running_nodes, S),
[[{name, Node}, {type, Type}, {running, lists:member(Node, Running)}] ||
[[{name, Node}, {type, Type}, {running, lists:member(Node, Running)}, {drained, rabbit_maintenance:is_being_drained_local_read(Node)}] ||
Type <- Types, Node <- proplists:get_value(Type, Nodes)].