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"]
|
2016-09-04 06:29:32 +00:00
|
|
|
@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]
|
2016-09-04 06:17:44 +00:00
|
|
|
puts "mkdir #{current_dir}/#{directory_name}"
|
2016-09-02 07:20:14 +00:00
|
|
|
`mkdir #{current_dir}/#{directory_name}`
|
2016-09-04 05:37:33 +00:00
|
|
|
redirect_to '/home/index'
|
2016-09-02 07:20:14 +00:00
|
|
|
end
|
2016-09-04 16:10:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
def delete_file
|
|
|
|
file_name = params[:file_name]
|
|
|
|
puts "rm #{file_name} -rf"
|
2016-09-05 15:44:30 +00:00
|
|
|
`rm #{file_name} -rf`
|
2016-09-04 16:10:49 +00:00
|
|
|
redirect_to '/home/index'
|
|
|
|
end
|
2016-08-20 06:41:37 +00:00
|
|
|
end
|