This commit is contained in:
bee0005 2016-08-22 08:07:57 +00:00
parent 0b28a0c5dc
commit 7a757e10b1
2 changed files with 22 additions and 13 deletions

View File

@ -2,6 +2,11 @@
---------------------------
Rails 4 implementation of the awesome [Gentelella](https://github.com/puikinsh/gentelella) Bootstrap admin template.
Requirement:
1. ruby(2.2.3)
2. rails
3. sshpass
Setup:
1. Clone this repo : git clone
https://github.com/iogbole/gentelella_on_rails.git

View File

@ -3,20 +3,24 @@ class VolumnController < ApplicationController
@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
if get_info.blank?
flash[:danger] = "Check Server"
else
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
@volumes[i] = volume
puts @volumes
end
def get_info