diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 16080c3..639be94 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -33,8 +33,18 @@ class ApplicationController < ActionController::Base return df end - def checkDir - @current_dir = params[:path] + def chdir + @current_dir = params[:next_dir] + puts "current_dir : " + @current_dir render :json => {:dir => @current_dir} end + + def rmdir + file_name = params[:file_name] + command = String.new + command << "sudo rm -rf #{file_name}" + puts command + `#{command}` + end + end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 01ebf5d..e318978 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -26,14 +26,4 @@ class HomeController < ApplicationController redirect_to '/home/index' end - def delete_file - file_name = params[:file_name] - # delete file - command = String.new - command << "sudo rm -rf #{file_name}" - puts command - `#{command}` - redirect_to '/home/index' - end - end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3e839b5..28f86df 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -85,8 +85,7 @@ module ApplicationHelper def file_manager_table(dir = "/mnt", id = "datatable", class_option = "table table-striped table-bordered jambo_table") html = String.new - html << "
Name | " @@ -95,12 +94,11 @@ module ApplicationHelper html << "Date | " html << "||||||
---|---|---|---|---|---|---|---|
" - html << "" - html << " " + dir + html << "" + html << " #{dir}" html << "" html << " | " html << "" @@ -112,24 +110,24 @@ module ApplicationHelper html << " | ||||||
" - html << " " + file['name'] + "" + html << " #{file['name']}" html << " | " else + conv_name = (dir + '/' + file['name']).gsub("/", "+") html << "" - html << " " + file['name'] + "" + html << " #{file['name']}" html << " | " end - html << "" + file['auth'] + " | " - html << "" + file['size'] + " | " - html << "" - html << file["date"] - html << "" + html << " | #{file['auth']} | " + html << "#{file['size']} | " + html << "#{file["date"]}" + html << "" html << " | " html << "
"
+ html << " Chart " + html << " | "
+ html << " "
+ html << " "
+ html << "Name "
+ html << " "
+ html << "Usage | ||
---|---|---|---|
" + html << " | "
+ html << "
|