add status button
This commit is contained in:
parent
199f2c0c91
commit
87a6b90eda
@ -94,9 +94,24 @@ class VolumeController < ApplicationController
|
||||
end
|
||||
|
||||
def mount
|
||||
puts "@@@@@@@@@@"
|
||||
puts params[:volume_id]
|
||||
puts "##########"
|
||||
redirect_to '/volume/info'
|
||||
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"
|
||||
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
|
||||
|
@ -52,10 +52,15 @@
|
||||
Bricks : <%=t["Bricks"]%> <br>
|
||||
Bricks1 : <%=t["Brick1"]%> <br>
|
||||
Options Reconfigured : <%=t["Options Reconfigured"]%> <br>
|
||||
performance.readdir-ahead : <%=t["performance.readdir-ahead"]%> <br>
|
||||
<a class="btn btn-app" href="/volume/mount/<%=t["Volume ID"]%>">
|
||||
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']%>">
|
||||
<i class="fa fa-upload"></i> Mount
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-sm-8 col-xs-8">
|
||||
|
@ -21,7 +21,7 @@ Rails.application.routes.draw do
|
||||
|
||||
post 'volume/changeDir' => 'volume#checkDir'
|
||||
|
||||
get 'volume/mount/:volume_id' => "volume#mount"
|
||||
get 'volume/mount/:volume_name' => "volume#mount"
|
||||
|
||||
|
||||
get 'peer/index' => 'peer#index'
|
||||
|
Loading…
Reference in New Issue
Block a user