UI for synchronisedness.

This commit is contained in:
Simon MacMullen 2011-07-15 15:52:29 +01:00
parent 8de926e728
commit 09fd0e1c86
3 changed files with 26 additions and 6 deletions

View File

@ -135,6 +135,8 @@ h3 { padding: 0 0 2px 0; margin: 1em 0 1em 0; font-size: 1em; border-bottom: 1px
acronym { background: #add; color: #222; padding: 2px 4px; border-radius: 2px; -moz-border-radius: 2px; border: none; cursor: default; }
acronym.warning { background: #daa; }
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

@ -93,11 +93,22 @@ function args_to_params(obj) {
}
function fmt_mirrors(queue) {
if (queue.slave_nodes && queue.slave_nodes.length > 0) {
return '<acronym title="Mirrors: ' + queue.slave_nodes + '">+' +
queue.slave_nodes.length + '</acronym>';
var synced = queue.synchronised_slave_nodes || [];
var unsynced = queue.slave_nodes || [];
unsynced = jQuery.grep(unsynced,
function (node, i) {
return jQuery.inArray(node, synced) == -1
});
var res = '';
if (synced.length > 0 || unsynced.length > 0) {
res += ' <acronym title="Mirrors: ' + synced + '">+' +
synced.length + '</acronym>';
}
return '';
if (unsynced.length > 0) {
res += ' <acronym class="warning" title="Unsynchronised mirrors: ' +
unsynced + '">+' + unsynced.length + '</acronym>';
}
return res;
}
function fmt_channel_mode(ch) {

View File

@ -66,8 +66,15 @@
<tr>
<th>Mirrors</th>
<td>
<% for (var i in queue.mirror_nodes) { %>
<%= queue.mirror_nodes[i] %><br/>
<% for (var i in queue.slave_nodes) {
var node = queue.slave_nodes[i];
%>
<% if (jQuery.inArray(node, queue.synchronised_slave_nodes) == -1) { %>
<%= node %> <b>(unsynchronised)</b>
<% } else { %>
<%= node %>
<% } %>
<br/>
<% } %>
</td>
</tr>