This commit is contained in:
bee0005 2016-09-01 11:04:46 +00:00
parent 8cca9682c0
commit 101fd59a69
3 changed files with 18 additions and 5 deletions

View File

@ -91,8 +91,9 @@ class VolumeController < ApplicationController
def volume_mount
@config = get_conf
volume_name = params[:volume_name]
mount_point = params[:mount_point]
volume_name = volume_name.delete(' ')
puts "mount -t glusterfs " + @config["host_ip"] + ":/" + volume_name + " /mnt/glusterfs"
puts "mount -t glusterfs " + @config["host_ip"] + ":/" + volume_name + " " + mount_point
redirect_to '/volume/index'
end

View File

@ -65,9 +65,21 @@
<a class="btn btn-round btn-danger btn-lg" href="/volume/stop/<%=t['Volume Name']%>">
<i class="fa fa-pause"></i> Stop
</a>
<a class="btn btn-app" href="/volume/mount/<%=t['Volume Name']%>">
<i class="fa fa-upload"></i> Mount
</a>
<form class="form-horizontal form-label-left" action="/volume/mount" method="post">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-3" for="mount_point">Mount Point</label>
<div class="col-md-6 col-sm-6 col-xs-12"><input type="text" name="mount_point" required="required" class="form-control"></div>
</div>
<input type="hidden" name="volume_name" ><%=t['Volume Name']%></input>
<button class="btn btn-app" type="submit">
<i class="fa fa-upload"></i> Mount
</button>
</form>
<a class="btn btn-app" href="/volume/mount/<%=t['Volume Name']%>">
<i class="fa fa-upload"></i> Mount
</a>
<% end %>
</div>

View File

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