From 5a23f7c05695288e70d73b2f72499dc9d2d0932b Mon Sep 17 00:00:00 2001 From: bee0005 Date: Fri, 2 Sep 2016 07:20:14 +0000 Subject: [PATCH] update --- app/controllers/home_controller.rb | 16 ++++++++++++++-- app/views/home/index.html.erb | 17 +++++++++++++---- config/routes.rb | 1 + 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 37cf965..f7b5dfb 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,8 +1,20 @@ class HomeController < ApplicationController def index config = get_conf -# @current_dir = config["project_path"] - @current_dir = "~" + #@current_dir = config["project_path"] + @current_dir = "/mnt" file_directory(@current_dir) end + + + def make_directory + current_dir = params[:current_dir] + directory_name = params[:directory_name] + # `cd /#{current_dir}` + # `cd /#{current_dir} & mkdir #{directory_name}` + puts "mkdir #{current_dir}/#{directory_name}" + `mkdir #{current_dir}/#{directory_name}` + #output = `sshpass -p#{@config["host_password"]} ssh #{@config["host_port"]} #{@config["host_user"]}@#{@config["host_ip"]} gluster volume delete #{volume_name}` + redirect_to '/home/index' + end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 05b375b..85379f5 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -71,7 +71,7 @@
-

Dash Board

+

File Manager