This commit is contained in:
bee0005 2016-10-03 09:57:12 +00:00
parent ece51ec54c
commit 5aab51cca1

View File

@ -156,7 +156,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content tile fixed_height_160" style="overflow-y:auto;"> <div class="x_content tile fixed_height_160" style="overflow-y:auto;">
<% begin %> <% if nodes.nil? %>
<div class="widget_summary"> <div class="widget_summary">
<% ping = ((nodes.select{ |node| node["ping"].eql? "true" }.length.to_f / nodes.length.to_f) * 100).to_i %> <% ping = ((nodes.select{ |node| node["ping"].eql? "true" }.length.to_f / nodes.length.to_f) * 100).to_i %>
<div class="w_left w_25"> <div class="w_left w_25">
@ -208,8 +208,8 @@
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<% rescue => ex %> <% else %>
<div class="row animated flipInX col-md-6 col-sm-9 col-xs-12"> <div class="row animated flipInX col-md-8 col-sm-8 col-xs-8 cent-align">
<div class="alert alert-info" role="alert"> <div class="alert alert-info" role="alert">
<span class="glyphicon glyphicon-bell" area-hidden="true"></span> <span class="glyphicon glyphicon-bell" area-hidden="true"></span>
<span class="glyphicon-class">You don't have a node. Please add nodes to do something in this page.</span> <span class="glyphicon-class">You don't have a node. Please add nodes to do something in this page.</span>
@ -238,7 +238,7 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content tile fixed_height_160" style="overflow-y:auto;"> <div class="x_content tile fixed_height_160" style="overflow-y:auto;">
<% begin %> <% if volumes.nil? %>
<div class="widget_summary"> <div class="widget_summary">
<% start = ((volumes.select{ |volume| volume["Status"].eql? " Started" }.length.to_f / volumes.length.to_f) * 100).to_i %> <% start = ((volumes.select{ |volume| volume["Status"].eql? " Started" }.length.to_f / volumes.length.to_f) * 100).to_i %>
<div class="w_left w_25"> <div class="w_left w_25">
@ -273,9 +273,9 @@
</div> </div>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<% rescue => ex %> <% else %>
<div class="row animated flipInX col-md-6 col-sm-9 col-xs-12"> <div class="row animated flipInX col-md-8 col-sm-8 col-xs-8">
<div class="alert alert-info" role="alert"> <div class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-bell" area-hidden="true"></span> <span class="glyphicon glyphicon-bell" area-hidden="true"></span>
<span class="glyphicon-class">You don't have a volume. Please add volumes to do something in this page.</span> <span class="glyphicon-class">You don't have a volume. Please add volumes to do something in this page.</span>
</div> </div>
@ -308,26 +308,35 @@
</div> </div>
<div class="x_content fixed_height_320" style="overflow-y:auto;"> <div class="x_content fixed_height_320" style="overflow-y:auto;">
<ul class="list-unstyled top_profiles" > <ul class="list-unstyled top_profiles" >
<% nodes.each do |node| %> <% if nodes.nil? %>
<li class="media event"> <% nodes.each do |node| %>
<% if node["ping"].eql? "true" %> <li class="media event">
<a class="pull-left border-green profile_thumb"> <% if node["ping"].eql? "true" %>
<i class="fa fa-cube green"></i> <a class="pull-left border-green profile_thumb">
</a> <i class="fa fa-cube green"></i>
<% else %> </a>
<a class="pull-left border-red profile_thumb"> <% else %>
<i class="fa fa-cube red"></i> <a class="pull-left border-red profile_thumb">
</a> <i class="fa fa-cube red"></i>
<% end %> </a>
<div class="media-body"> <% end %>
<a class="title" onclick="loading();" href="/node/detail/<%= node["id"] %>"><%= node["host_name"] %></a> <div class="media-body">
<p><strong><%= node["host_ip"] %> </strong> <%= node["user_name"] %> </p> <a class="title" onclick="loading();" href="/node/detail/<%= node["id"] %>"><%= node["host_name"] %></a>
<% if node["gluster"].eql? "on" %> <p><strong><%= node["host_ip"] %> </strong> <%= node["user_name"] %> </p>
<p> <small> number of peers: <%= node["number_of_peers"] %></small></p> <% if node["gluster"].eql? "on" %>
<% end %> <p> <small> number of peers: <%= node["number_of_peers"] %></small></p>
</div> <% end %>
</li> </div>
<% end %> </li>
<% end %>
<% else %>
<div class="row animated flipInX col-md-8 col-sm-8 col-xs-8">
<div class="alert alert-success" role="alert">
<span class="glyphicon glyphicon-bell" area-hidden="true"></span>
<span class="glyphicon-class">You don't have a node. Please add nodes to do something in this page.</span>
</div>
</div>
<% end %>
</ul> </ul>
</div> </div>
</div> </div>
@ -355,7 +364,21 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content tile" id="disk_file_div"> <div class="x_content tile" id="disk_file_div">
<%= raw html_disk_file_table %>
<% if volumes.nil? or ( (volumes.select{ |volume| volume["Mount State"].eql? "mounted" }.length) == 0) %>
<div class="row animated flipInX col-md-8 col-sm-8 col-xs-8">
<div class="alert alert-error" role="alert">
<span class="glyphicon glyphicon-bell" area-hidden="true"></span>
<span class="glyphicon-class">You don't have a volume. Please add volumes to do something in this page.</span>
</div>
</div>
<div style="display:none;">
<%= raw html_disk_file_table %>
</div>
<% else %>
<%= raw html_disk_file_table %>
<% end %>
</div> </div>
</div> </div>
</div> </div>