gluster-web-interface/app/controllers/home_controller.rb

21 lines
670 B
Ruby
Raw Normal View History

2016-08-20 06:41:37 +00:00
class HomeController < ApplicationController
def index
2016-09-02 05:47:18 +00:00
config = get_conf
2016-09-02 07:20:14 +00:00
#@current_dir = config["project_path"]
@current_dir = "/mnt"
2016-09-02 05:56:12 +00:00
file_directory(@current_dir)
2016-08-20 06:41:37 +00:00
end
2016-09-02 07:20:14 +00:00
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
2016-08-20 06:41:37 +00:00
end