Merge branch 'stable'

Conflicts:
	.gitignore
	priv/www/js/formatters.js
This commit is contained in:
Michael Klishin 2017-09-18 12:40:19 -06:00
commit e45cc8d5ec
5 changed files with 14 additions and 10 deletions

View File

@ -1,6 +1,9 @@
.sw?
.*.sw?
*.beam
*.pem
erl_crash.dump
MnesiaCore.*
.erlang.mk/
/cover/
/debug/

View File

@ -7,8 +7,12 @@ PROCESS_THRESHOLDS=[[0.75, 'red'],
[0.5, 'yellow']];
function fmt_string(str, unknown) {
if (unknown == undefined) unknown = UNKNOWN_REPR;
if (str == undefined) return unknown;
if (unknown == undefined) {
unknown = UNKNOWN_REPR;
}
if (str == undefined) {
return unknown;
}
return fmt_escape_html("" + str);
}
@ -506,10 +510,7 @@ function fmt_maybe_wrap(txt, encoding) {
}
function fmt_node(node_host) {
var both = node_host.split('@');
var node = both.slice(0, 1);
var host = both.slice(1);
return node == 'rabbit' ? host : (node + '@' + host);
return fmt_string(node_host);
}
function fmt_object_state(obj) {
@ -662,7 +663,7 @@ function link_user(name) {
}
function link_node(name) {
return _link_to(name, '#/nodes/' + esc(name));
return _link_to(fmt_node(name), '#/nodes/' + esc(name));
}
function link_policy(vhost, name) {

View File

@ -81,7 +81,7 @@
<div class="hider updatable">
<% if (nodes.length == 1) { %>
<p>Node: <%= nodes[0].name %> <a href="#/nodes/<%= esc(nodes[0].name) %>">(More about this node)</a></p>
<p>Node: <%= fmt_node(nodes[0].name) %> <a href="#/nodes/<%= esc(nodes[0].name) %>">(More about this node)</a></p>
<% } %>
<table class="list">

View File

@ -30,7 +30,7 @@
var partition = partitions[i];
%>
<tr<%= alt_rows(i)%>>
<td><%= partition.node %></td>
<td><%= fmt_node(partition.node) %></td>
<td>
<%
for (var j = 0; j < partition.others.length; j++) {

View File

@ -225,7 +225,7 @@
<td>
<select name="node">
<% for (var i = 0; i < nodes.length; i++) { %>
<option value="<%= fmt_string(nodes[i].name) %>"><%= nodes[i].name %></option>
<option value="<%= fmt_string(nodes[i].name) %>"><%= fmt_node(nodes[i].name) %></option>
<% } %>
</select>
</td>