Environment
Cluster
<% if (cluster.length > 0) { %>
|
<%
monitors = {};
_.each(cluster, function (computer) {
computerJSON = computer.toJSON(); %>
<% if(computerJSON.online) { %>
<% } else { %>
<% }
_.each(computerJSON['monitors'], function(object, monitor) {
monitors[monitor] = _.escape(object.description);
}); %>
| <% }); %>
<%
rows = {'id': 'Host name',
'ip': 'IP address',
'masterpriority': 'Priority',
'projections': 'Projections',
'actions': 'Actions',
'platform': 'Platform'
};
$.extend(rows, monitors);
_.each(rows, function (row, key) { %>
<%- row %> |
<% _.each(cluster, function (computer) {
b = computer.toJSON();
if (key == 'projections') {
out = _.escape( _.keys(b[key]).join(', ') );
} else if (key.endsWith('Monitor')) {
if (b['monitors'][key] === undefined) {
out = 'N/A';
} else {
out = '' + b['monitors'][key]['value'] + '';
}
} else if (key == 'actions') {
actions = [];
_.each(b[key], function (link, name) {
actions.push('' + _.escape(name) + '');
});
out = actions.join(', ');
} else {
out = _.escape(b[key] ? b[key] : '');
} %>
<%print( out )%> | <%
}); %>
<% }); %>
<% } %>