add status button

This commit is contained in:
Youngkyun Kim 2016-08-31 09:34:09 -04:00
parent 199f2c0c91
commit 87a6b90eda
3 changed files with 29 additions and 9 deletions

View File

@ -94,9 +94,24 @@ class VolumeController < ApplicationController
end end
def mount def mount
puts "@@@@@@@@@@" conf_list = get_conf
puts params[:volume_id] host_ip = String.new
puts "##########" conf_list.each do |t|
redirect_to '/volume/info' if t.include? "host_ip="
host_ip = t.split("host_ip=")[1]
end
end
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "mount -t glusterfs " + host_ip + ":/" + volume_name + " /mnt/glusterfs"
redirect_to '/volume/index'
end
def volume_stop
puts "gluster volume stop volume_name"
end
def volume_start
puts "gluster volume start volume_name"
end end
end end

View File

@ -52,10 +52,15 @@
Bricks : <%=t["Bricks"]%> <br> Bricks : <%=t["Bricks"]%> <br>
Bricks1 : <%=t["Brick1"]%> <br> Bricks1 : <%=t["Brick1"]%> <br>
Options Reconfigured : <%=t["Options Reconfigured"]%> <br> Options Reconfigured : <%=t["Options Reconfigured"]%> <br>
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%> <br> performance.readdir-ahead : <%=t["performance.readdir-ahead"]%> <br><br><br>
<a class="btn btn-app" href="/volume/mount/<%=t["Volume ID"]%>"> <% if t["Status"] == " start" %>
<button type="button" class="btn btn-round btn-success btn-lg"><i class="fa fa-play"></i> Start</button>
<% else %>
<button type="button" class="btn btn-round btn-danger btn-lg"><i class="fa fa-pause"></i> Stop</button>
<a class="btn btn-app" href="/volume/mount/<%=t['Volume Name']%>">
<i class="fa fa-upload"></i> Mount <i class="fa fa-upload"></i> Mount
</a> </a>
<% end %>
</div> </div>
<div class="col-md-8 col-sm-8 col-xs-8"> <div class="col-md-8 col-sm-8 col-xs-8">

View File

@ -21,7 +21,7 @@ Rails.application.routes.draw do
post 'volume/changeDir' => 'volume#checkDir' post 'volume/changeDir' => 'volume#checkDir'
get 'volume/mount/:volume_id' => "volume#mount" get 'volume/mount/:volume_name' => "volume#mount"
get 'peer/index' => 'peer#index' get 'peer/index' => 'peer#index'