Merged bug24664 into default

This commit is contained in:
Emile Joubert 2012-01-27 14:51:20 +00:00
commit 07c8de9c3e
4 changed files with 38 additions and 3 deletions

View File

@ -145,6 +145,8 @@ acronym { background: #add; color: #222; padding: 2px 4px; border-radius: 2px; -
acronym.warning { background: #daa; }
.status acronym { background: none; color: inherit; padding: 0; border-bottom: 1px dotted; cursor: default; }
table.bindings { margin-bottom: 1em; }
td.binding-endpoint span.object { border: 1px solid #bbb; padding: 10px; border-radius: 10px; -moz-border-radius: 10px; }
td.binding-endpoint span.arrow { font-size: 200%; }

View File

@ -343,6 +343,39 @@ function fmt_node_host(node_host) {
return host + ' <small>(' + node_host + ')</small>';
}
function fmt_connection_state(conn) {
if (conn.state == undefined) return '';
var colour = 'green';
var text = conn.state;
var explanation;
if (conn.last_blocked_by == 'mem' && conn.state == 'blocked') {
colour = 'red';
explanation = 'Memory alarm: Connection blocked.';
}
else if (conn.state == 'blocking') {
colour = 'yellow';
explanation = 'Memory alarm: Connection will block on publish.';
}
else if (conn.last_blocked_by == 'flow') {
var age = conn.last_blocked_age.toFixed();
if (age < 5) {
colour = 'yellow';
text = 'flow';
explanation = 'Publishing rate recently restricted by server.';
}
}
if (explanation) {
return '<div class="' + colour + '"><acronym title="' + explanation +
'">' + text + '</acronym></div>';
}
else {
return '<div class="' + colour + '">' + text + '</div>';
}
}
function alt_rows(i) {
return (i % 2 == 0) ? ' class="alt1"' : ' class="alt2"';
}

View File

@ -66,7 +66,7 @@
<table class="facts">
<tr>
<th>State</th>
<td><%= connection.state %></td>
<td class="status"><%= fmt_connection_state(connection) %></td>
</tr>
<tr>
<th>Timeout</th>

View File

@ -6,7 +6,7 @@
<thead>
<tr>
<th colspan="<% if (nodes_interesting) { %>6<% } else { %>5<% } %>">Network</th>
<th colspan="<% if (vhosts_interesting) { %>4<% } else { %>3<% } %>">Overview</th>
<th colspan="<% if (vhosts_interesting) { %>5<% } else { %>4<% } %>">Overview</th>
</tr>
<tr>
<th><%= fmt_sort('Protocol', 'protocol') %></th>
@ -49,7 +49,7 @@
<td><%= fmt_string(connection.vhost) %></td>
<% } %>
<td><%= fmt_string(connection.user) %></td>
<td><%= connection.state %></td>
<td class="status"><%= fmt_connection_state(connection) %></td>
</tr>
<% } %>
</tbody>