From 101fd59a695f39be7b0e62d566335681bb8acebf Mon Sep 17 00:00:00 2001 From: bee0005 Date: Thu, 1 Sep 2016 11:04:46 +0000 Subject: [PATCH] update --- app/controllers/volume_controller.rb | 3 ++- app/views/volume/index.html.erb | 18 +++++++++++++++--- config/routes.rb | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/controllers/volume_controller.rb b/app/controllers/volume_controller.rb index 8dbf3f0..9915798 100644 --- a/app/controllers/volume_controller.rb +++ b/app/controllers/volume_controller.rb @@ -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 diff --git a/app/views/volume/index.html.erb b/app/views/volume/index.html.erb index 480a4cf..616eebf 100644 --- a/app/views/volume/index.html.erb +++ b/app/views/volume/index.html.erb @@ -65,9 +65,21 @@ Stop - - Mount - + +
+
+ +
+
+ <%=t['Volume Name']%> + +
+ + + Mount + <% end %> diff --git a/config/routes.rb b/config/routes.rb index 858d239..a0361ed 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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"