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. 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: Setup:
1. Clone this repo : git clone 1. Clone this repo : git clone
https://github.com/iogbole/gentelella_on_rails.git https://github.com/iogbole/gentelella_on_rails.git

View File

@ -3,11 +3,14 @@ class VolumnController < ApplicationController
@volumes = Array.new @volumes = Array.new
volume = Hash.new volume = Hash.new
i = 0 i = 0
if get_info.blank?
flash[:danger] = "Check Server"
else
output = get_info.split("\n") output = get_info.split("\n")
for t in 1..(output.length-1) for t in 1..(output.length-1)
if output[t].include? ":" if output[t].include? ":"
temp = output[t].split(":") temp = output[t].split(":")
volume[temp[0]] = temp[1] volume[temp[0]] = temp[1]
else else
@volumes[i] = volume @volumes[i] = volume
@ -18,6 +21,7 @@ class VolumnController < ApplicationController
@volumes[i] = volume @volumes[i] = volume
puts @volumes puts @volumes
end end
end
def get_info def get_info
return `sshpass -pakfm77 ssh -p 2222 root@124.63.216.174 gluster volume info` return `sshpass -pakfm77 ssh -p 2222 root@124.63.216.174 gluster volume info`