update
This commit is contained in:
parent
87a6b90eda
commit
7ff5f4ece2
@ -93,25 +93,29 @@ class VolumeController < ApplicationController
|
|||||||
render :json => {:file => files , :current => @current_dir}
|
render :json => {:file => files , :current => @current_dir}
|
||||||
end
|
end
|
||||||
|
|
||||||
def mount
|
def volume_mount
|
||||||
conf_list = get_conf
|
conf_list = get_conf
|
||||||
host_ip = String.new
|
host_ip = String.new
|
||||||
conf_list.each do |t|
|
conf_list.each do |t|
|
||||||
if t.include? "host_ip="
|
if t.include? "host_ip="
|
||||||
host_ip = t.split("host_ip=")[1]
|
host_ip = t.split("host_ip=")[1]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
volume_name = params[:volume_name]
|
volume_name = params[:volume_name]
|
||||||
volume_name = volume_name.delete(' ')
|
volume_name = volume_name.delete(' ')
|
||||||
puts "mount -t glusterfs " + host_ip + ":/" + volume_name + " /mnt/glusterfs"
|
puts "mount -t glusterfs " + host_ip + ":/" + volume_name + " /mnt/glusterfs"
|
||||||
redirect_to '/volume/index'
|
redirect_to '/volume/index'
|
||||||
end
|
end
|
||||||
|
|
||||||
def volume_stop
|
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
|
end
|
||||||
|
|
||||||
def volume_start
|
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
|
||||||
end
|
end
|
||||||
|
@ -52,16 +52,23 @@
|
|||||||
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><br><br>
|
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%>
|
||||||
<% if t["Status"] == " start" %>
|
<br><br><br>
|
||||||
<button type="button" class="btn btn-round btn-success btn-lg"><i class="fa fa-play"></i> Start</button>
|
<% if t["Status"] == " start" %>
|
||||||
<% else %>
|
<a class="btn btn-round btn-success btn-lg" href="/volume/start/<%=t['Volume Name']%>">
|
||||||
<button type="button" class="btn btn-round btn-danger btn-lg"><i class="fa fa-pause"></i> Stop</button>
|
<i class="fa fa-play"></i> Start
|
||||||
<a class="btn btn-app" href="/volume/mount/<%=t['Volume Name']%>">
|
</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
|
<i class="fa fa-upload"></i> Mount
|
||||||
</a>
|
</a>
|
||||||
<% end %>
|
<% 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">
|
||||||
<p>Drag multiple files to the box below for multi upload or click to select files.</p>
|
<p>Drag multiple files to the box below for multi upload or click to select files.</p>
|
||||||
|
@ -21,7 +21,9 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
post 'volume/changeDir' => 'volume#checkDir'
|
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'
|
get 'peer/index' => 'peer#index'
|
||||||
|
Loading…
Reference in New Issue
Block a user