Add mount table to volume index

This commit is contained in:
kyg516
2016-09-28 18:15:06 +09:00
parent e62a1eed16
commit ac1527acf0
7 changed files with 88 additions and 91 deletions

View File

@@ -12,24 +12,5 @@ class ApplicationController < ActionController::Base
redirect_to "/users/sign_in" # halts request cycle
end
end
def chdir
@current_dir = params[:next_dir]
puts "current_dir : " + @current_dir
render :json => {
:dir => @current_dir,
:file_manager_table => file_manager_table(@current_dir),
:disk_usage_table => disk_usage_table(@current_dir),
:du => get_du(@current_dir),
}
end
def rmdir
file_name = params[:file_name]
command = String.new
command << "sudo rm -rf #{file_name}"
puts command
`#{command}`
end
end

View File

@@ -26,4 +26,22 @@ class HomeController < ApplicationController
redirect_to '/home/index'
end
def chdir
@current_dir = params[:next_dir]
puts "current_dir : " + @current_dir
render :json => {
:dir => @current_dir,
:file_manager_table => file_manager_table(@current_dir),
:disk_usage_table => disk_usage_table(@current_dir),
:du => get_du(@current_dir),
}
end
def rmdir
file_name = params[:file_name]
command = String.new
command << "sudo rm -rf #{file_name}"
puts command
`#{command}`
end
end

View File

@@ -5,6 +5,15 @@ class VolumeController < ApplicationController
@current_dir = "/mnt"
end
def chdir
@current_dir = params[:next_dir]
puts "current_dir : " + @current_dir
render :json => {
:dir => @current_dir,
:mount_table => mount_table(@current_dir),
}
end
def file_upload
df = get_df
mnt_dir = String.new