1
0
Fork 0

modified nodes view

This commit is contained in:
hkernbach 2016-04-19 16:33:17 +02:00
parent 5c17f3a230
commit bcbaa7bc72
3 changed files with 22 additions and 5 deletions

View File

@ -2,11 +2,16 @@
<div id="nodesContent" class="innerContent"> <div id="nodesContent" class="innerContent">
<% if(coords.length > 0) { %> <% if (coords.length > 0) { %>
<% var disabled = ''; %>
<% var genClass = "pure-u-1-" + Object.keys(coords[0]).length; %> <% var genClass = "pure-u-1-" + Object.keys(coords[0]).length; %>
<% if (type !== 'coordinator') { %>
<% disabled = " disabled"; %>
<% } %>
<div class="pure-g cluster-nodes-title pure-table pure-table-header pure-title"> <div class="pure-g cluster-nodes-title pure-table pure-table-header pure-title">
<div class="pure-table-row"> <div class="pure-table-row <%= disabled %> ">
<div class="<%= genClass %> mid">Name</div> <div class="<%= genClass %> mid">Name</div>
<div class="<%= genClass %> mid">Address</div> <div class="<%= genClass %> mid">Address</div>
<div class="<%= genClass %> mid">Protocol</div> <div class="<%= genClass %> mid">Protocol</div>
@ -24,7 +29,7 @@
<% _.each(coords, function(node) { %> <% _.each(coords, function(node) { %>
<div class="pure-table-row" node="<%=node.name%>"> <div class="pure-table-row disabled" node="<%=node.name%>">
<div class="<%= genClass %> mid"><%= node.name %></div> <div class="<%= genClass %> mid"><%= node.name %></div>
<div class="<%= genClass %> mid"><%= node.address %></div> <div class="<%= genClass %> mid"><%= node.address %></div>

View File

@ -12,16 +12,20 @@
knownServers: [], knownServers: [],
events: { events: {
"click .pure-table-body .pure-table-row": "navigateToNode"
}, },
initialize: function (options) { initialize: function (options) {
if (window.App.isCluster) { if (window.App.isCluster) {
this.dbServers = options.dbServers; this.dbServers = options.dbServers;
this.coordinators = options.coordinators; this.coordinators = options.coordinators;
this.updateServerTime(); this.updateServerTime();
this.toRender = options.toRender; this.toRender = options.toRender;
if (this.toRender !== 'coordinator') {
this.events["click .pure-table-body .pure-table-row"] = "navigateToNode";
}
//start polling with interval //start polling with interval
window.setInterval(function() { window.setInterval(function() {
if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes') { if (window.location.hash === '#cNodes' || window.location.hash === '#dNodes') {

View File

@ -29,12 +29,20 @@
color: $c-pure-text; color: $c-pure-text;
font-weight: 100; font-weight: 100;
line-height: 40px; line-height: 40px;
width: 100%;
&:hover { &:hover {
background-color: rgb(239, 240, 235); background-color: rgb(239, 240, 235);
cursor: pointer; cursor: pointer;
} }
&.disabled {
&:hover {
background-color: $c-white;
cursor: not-allowed;
}
}
.left { .left {
text-align: left; text-align: left;
} }