add volume info

This commit is contained in:
bee0005 2016-08-20 12:02:16 +00:00
parent 22a2389c12
commit e008bd3bab
2 changed files with 33 additions and 7 deletions

View File

@ -1,6 +1,22 @@
class VolumnController < ApplicationController class VolumnController < ApplicationController
def info def info
@output = get_info.split("\n") @volumes = Array.new
volume = Hash.new
i = 0
output = get_info.split("\n")
for t in 1..(output.length-1)
if output[t].include? ":"
temp = output[t].split(":")
volume[temp[0]] = temp[1]
else
@volumes[i] = volume
volume = Hash.new
i+=1
end
end
@volumes[i] = volume
puts @volumes
end end
def get_info def get_info

View File

@ -22,11 +22,13 @@
<div class="row"> <div class="row">
<div class="col-md-12 col-sm-12 col-xs-12">
<%@volumes.each do |t|%>
<div class="col-md-12 col-sm-1 col-xs-12">
<div class="x_panel"> <div class="x_panel">
<div class="x_title"> <div class="x_title">
<h2>Infomation <small>volumn</small></h2> <h2>Infomation <small><%=t["Volume Name"]%></small></h2>
<ul class="nav navbar-right panel_toolbox"> <ul class="nav navbar-right panel_toolbox">
<li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a> <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
</li> </li>
@ -45,12 +47,20 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="x_content"> <div class="x_content">
<%@output.each do |t|%> Type : <%=t["Type"]%> <br>
<%=t%> </br> Volume ID : <%=t["Volume ID"]%> <br>
<%end%> Status : <%=t["Status"]%> <br>
Number of Bricks : <%=t["Number of Bricks"]%> <br>
Transport-type : <%=t["Transport-type"]%> <br>
Bricks : <%=t["Bricks"]%> <br>
Bricks1 : <%=t["Brick1"]%> <br>
Options Reconfigured : <%=t["Options Reconfigured"]%> <br>
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%> <br>
</div> </div>
</div> </div>
</div> </div>
<%end%>
</div> </div>
</div> </div>
</div> </div>