Update home index

This commit is contained in:
kyg516 2016-10-03 19:20:55 +09:00
parent 73209faf54
commit ea3d034885

View File

@ -36,8 +36,8 @@
<!-- top tiles -->
<% users = User.all %>
<% nodes = Node.all %>
<% vols = ssh_volume_info %>
<% nodes = ssh_nodes %>
<% volumes = ssh_volume_info %>
<% today_user = User.where(:last_sign_in_at => Date.today..Date.tomorrow) %>
<% today_node = Node.where(:created_at => Date.today..Date.tomorrow) %>
<div class="row tile_count">
@ -83,10 +83,10 @@
<div class="left"></div>
<div class="right">
<span class="count_top"><i class="fa fa-database"></i> Total volumes</span>
<div class="count"><%= vols.nil? ? 0 : vols.length %></div>
<div class="count"><%= volumes.nil? ? 0 : volumes.length %></div>
<span class="count_bottom">
<i class="blue"><%= vols.count{|x| x['Status'].eql? " Started"} %></i> started /
<i class="green"><%= vols.count{|x| x['Mount State'].eql? "mounted"} %></i> mounted
<i class="blue"><%= volumes.count{|x| x['Status'].eql? " Started"} %></i> started /
<i class="green"><%= volumes.count{|x| x['Mount State'].eql? "mounted"} %></i> mounted
</span>
</div>
</div>
@ -101,8 +101,8 @@
</div>
<!-- /top tiles -->
<!-- first row -->
<div class="row">
<!-- file manager -->
<div class="col-md-8 col-sm-8 col-xs-12">
<div id="pagecontent" class="panel panel-body">
@ -131,9 +131,9 @@
</div>
<!-- /disk usage -->
</div>
<!-- /first row -->
<% nodes = ssh_nodes %>
<% volumes = ssh_volume_info %>
<!-- second row -->
<div class ="row">
<!-- node status -->
<div class="col-md-4 col-sm-4 col-xs-12">
@ -156,7 +156,7 @@
<div class="clearfix"></div>
</div>
<div class="x_content tile fixed_height_160" style="overflow-y:auto;">
<% if nodes.nil? %>
<% if !nodes.nil? %>
<div class="widget_summary">
<% ping = ((nodes.select{ |node| node["ping"].eql? "true" }.length.to_f / nodes.length.to_f) * 100).to_i %>
<div class="w_left w_25">
@ -218,7 +218,6 @@
<% end %>
</div>
</div>
<div class="x_panel">
<div class="x_title">
<h2>Volumes Status</h2>
@ -238,7 +237,7 @@
<div class="clearfix"></div>
</div>
<div class="x_content tile fixed_height_160" style="overflow-y:auto;">
<% if volumes.nil? %>
<% if !volumes.nil? %>
<div class="widget_summary">
<% start = ((volumes.select{ |volume| volume["Status"].eql? " Started" }.length.to_f / volumes.length.to_f) * 100).to_i %>
<div class="w_left w_25">
@ -288,7 +287,7 @@
<!-- node list -->
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="x_panel tile">
<div class="x_panel">
<div class="x_title">
<h2>Nodes List</h2>
<ul class="nav navbar-right panel_toolbox">
@ -308,7 +307,7 @@
</div>
<div class="x_content fixed_height_320" style="overflow-y:auto;">
<ul class="list-unstyled top_profiles">
<% if nodes.nil? %>
<% if !nodes.nil? %>
<% nodes.each do |node| %>
<li class="media event">
<% if node["ping"].eql? "true" %>
@ -363,8 +362,7 @@
</ul>
<div class="clearfix"></div>
</div>
<div class="x_content tile" id="disk_file_div">
<div class="x_content fixed_height_320" style="overflow-y:auto;" id="disk_file_div">
<% 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">
@ -383,11 +381,9 @@
</div>
</div>
<!-- /disk usage -->
</div>
<!-- /second row -->
<div class ="row">
</div>
</div>
<!-- /page content -->