diff --git a/app/controllers/volumn_controller.rb b/app/controllers/volumn_controller.rb index 2217e05..bf0f654 100644 --- a/app/controllers/volumn_controller.rb +++ b/app/controllers/volumn_controller.rb @@ -1,6 +1,22 @@ class VolumnController < ApplicationController 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 def get_info diff --git a/app/views/volumn/info.html.erb b/app/views/volumn/info.html.erb index d78bb49..5c9fe5b 100644 --- a/app/views/volumn/info.html.erb +++ b/app/views/volumn/info.html.erb @@ -22,11 +22,13 @@ -
-
+
+ + <%@volumes.each do |t|%> +
-

Infomation volumn

+

Infomation <%=t["Volume Name"]%>

- <%@output.each do |t|%> - <%=t%>
- <%end%> + Type : <%=t["Type"]%>
+ Volume ID : <%=t["Volume ID"]%>
+ Status : <%=t["Status"]%>
+ Number of Bricks : <%=t["Number of Bricks"]%>
+ Transport-type : <%=t["Transport-type"]%>
+ Bricks : <%=t["Bricks"]%>
+ Bricks1 : <%=t["Brick1"]%>
+ Options Reconfigured : <%=t["Options Reconfigured"]%>
+ performance.readdir-ahead : <%=t["performance.readdir-ahead"]%>
+ <%end%> +