This commit is contained in:
bee0005 2016-08-31 14:42:14 +00:00
parent 87a6b90eda
commit 7ff5f4ece2
3 changed files with 34 additions and 21 deletions

View File

@ -93,25 +93,29 @@ class VolumeController < ApplicationController
render :json => {:file => files , :current => @current_dir}
end
def mount
def volume_mount
conf_list = get_conf
host_ip = String.new
conf_list.each do |t|
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"
conf_list.each do |t|
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"
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "gluster volume stop " + volume_name
end
def volume_start
puts "gluster volume start volume_name"
volume_name = params[:volume_name]
volume_name = volume_name.delete(' ')
puts "gluster volume start " + volume_name
end
end

View File

@ -52,16 +52,23 @@
Bricks : <%=t["Bricks"]%> <br>
Bricks1 : <%=t["Brick1"]%> <br>
Options Reconfigured : <%=t["Options Reconfigured"]%> <br>
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%> <br><br><br>
<% 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']%>">
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%>
<br><br><br>
<% if t["Status"] == " start" %>
<a class="btn btn-round btn-success btn-lg" href="/volume/start/<%=t['Volume Name']%>">
<i class="fa fa-play"></i> Start
</a>
<!--<button type="button" class="btn btn-round btn-success btn-lg"><i class="fa fa-play"></i> Start</button> -->
<% else %>
<a class="btn btn-round btn-danger btn-lg" href="/volume/stop/<%=t['Volume Name']%>">
<i class="fa fa-pause"></i> Stop
</a>
<!--<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
</a>
<% end %>
</div>
</a>
<% end %>
</div>
<div class="col-md-8 col-sm-8 col-xs-8">
<p>Drag multiple files to the box below for multi upload or click to select files.</p>

View File

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