Update home index

This commit is contained in:
kyg516 2016-10-03 16:33:46 +09:00
parent d7320e22b0
commit f5a11b5485
3 changed files with 15 additions and 10 deletions

View File

@ -119,14 +119,17 @@ module HomeHelper
html << "</thead>"
html << "<tbody>"
nodes = Node.all
get_df.each_with_index do |file, index|
# show mounted files only
ip = file['Filesystem'].split(":").first
next if nodes.select{|node| node["host_ip"].eql? ip}.length == 0
color = ['blue', 'green', 'red', 'purple', 'grey'][index % 5]
html << "<tr><td>"
html << "<div class='col-lg-7 col-md-7 col-sm-7 col-xs-7'>"
html << "<p><i class='fa fa-square #{color}'></i> "
html << file['Filesystem']
html << file['Mounted on']
html << "</p></div>"
html << "</td><td>"
html << "<div class='col-lg-7 col-md-7 col-sm-7 col-xs-7'>"

View File

@ -352,7 +352,6 @@
<!-- On ready -->
<script>
$(document).ready(function() {
var du = [];
<% get_du.each_with_index do |du, index| %>
@ -375,7 +374,11 @@ $(document).ready(function() {
var hoverBackgroundColor = [];
var df = [];
<% nodes = Node.all %>
<% get_df.each_with_index do |df, index| %>
<% ip = df['Filesystem'].split(":").first %>
<% next if nodes.select{|node| node["host_ip"].eql? ip}.length == 0 %>
df.push({
'file_name':"<%= df['Filesystem'] %>",
'usage':"<%= (df["Use%"][0..df["Use%"].length - 1]).to_f / 100 %>"

View File

@ -90,13 +90,13 @@
<div class="clearfix"></div>
</div>
<div class="x_content tile" style="overflow-y:auto; min-height:227px;">
</div>
</div>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12">
<div class="x_panel">
<div class="x_title">
@ -177,7 +177,7 @@
<% if (node["id"].to_s).eql?(@node_id.to_s)%>
<form class="form-horizontal form-label-left" action="/node/update" method="post" novalidate>
<input type="hidden" name="node_id" value="<%=node["id"].to_s%>"/>
<div class="item form-group">
<label for="password" class="control-label col-md-3">Ping : </label>
<div class="col-md-6 col-sm-6 col-xs-12">
@ -212,7 +212,7 @@
<!--<label class="control-label col-md-7 col-xs-12" ><%=node["gluster"]%></label>-->
</div>
</div>
<% if node["ssh"].eql?("on") && node["gluster"].eql?("on")%>
<div class="item form-group">
<label for="password" class="control-label col-md-3">Number of Peers : </label>
@ -222,8 +222,8 @@
</div>
<%end%>
<% end %>
<div class="item form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Host Name <span class="required">*</span>
</label>
@ -285,7 +285,6 @@
<!-- /page content -->
<script>
$('.probe').change(function() {
$(location).attr('href',"#loading");
if($(this).is(":checked")) {