diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 9f484c7..7f54ca7 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -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
diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb
index e318978..65dc87e 100644
--- a/app/controllers/home_controller.rb
+++ b/app/controllers/home_controller.rb
@@ -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
diff --git a/app/controllers/volume_controller.rb b/app/controllers/volume_controller.rb
index 5160b82..a6bb81f 100644
--- a/app/controllers/volume_controller.rb
+++ b/app/controllers/volume_controller.rb
@@ -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
diff --git a/app/helpers/volume_helper.rb b/app/helpers/volume_helper.rb
index 6c78e3f..e05272c 100644
--- a/app/helpers/volume_helper.rb
+++ b/app/helpers/volume_helper.rb
@@ -13,7 +13,7 @@ module VolumeHelper
html << ""
raw(html)
end
-
+
def mount_table(dir = @current_dir, id = "mount_table", class_option = "table table-striped table-bordered jambo_table")
html = String.new
html << "
"
@@ -21,20 +21,16 @@ module VolumeHelper
html << ""
html << "Name | "
html << "auth | "
- #html << "Size | "
- #html << "Date | "
html << " | "
html << "
"
html << ""
html << ""
html << ""
html << ""
- #html << ""
- html << " .."
+ html << " #{@current_dir}"
html << " | "
html << " | "
html << " | "
- #html << " | "
html << "
"
files(dir).each do |file|
@@ -46,7 +42,7 @@ module VolumeHelper
html << ""
html << ""
html << ""
html << " | "
@@ -58,5 +54,5 @@ module VolumeHelper
html << "
"
return html
end
-
-end
\ No newline at end of file
+
+end
diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb
index d402bd6..83cd1b2 100644
--- a/app/views/home/index.html.erb
+++ b/app/views/home/index.html.erb
@@ -347,7 +347,7 @@ $(document).on("click", "#file_manager_div .chdir", function(){
$.ajax({
method: "post",
- url: "/application/chdir",
+ url: "/home/chdir",
data: { next_dir : next_dir },
success : function(result){
$("#current_dir").val(next_dir);
@@ -375,7 +375,7 @@ $(document).on("click", "#file_manager_div .chupper", function(){
$.ajax({
method: "POST",
- url: "/application/chdir",
+ url: "/home/chdir",
data: { next_dir : next_dir },
success : function(result){
$("#current_dir").val(next_dir);
@@ -399,7 +399,7 @@ $(document).on("click", "#file_manager_div .rmdir", function(){
if(confirm("Are you sure you want to delete '"+ file_name +"' ?")) {
$.ajax({
method: "POST",
- url: "/application/rmdir",
+ url: "/home/rmdir",
data: { target : target },
success : function(result){
$("#current_dir").val(current_dir);
diff --git a/app/views/volume/index.html.erb b/app/views/volume/index.html.erb
index c0301dd..e0c3085 100644
--- a/app/views/volume/index.html.erb
+++ b/app/views/volume/index.html.erb
@@ -69,8 +69,10 @@
@@ -185,63 +187,11 @@
-
-
-
+
+
+
+
diff --git a/config/routes.rb b/config/routes.rb
index 41b7439..0fa2745 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -6,25 +6,26 @@ Rails.application.routes.draw do
# You can have the root of your site routed with "root"
root 'home#index'
- post 'application/chdir' => 'application#chdir'
- post 'application/rmdir' => 'application#rmdir'
-
get 'index' => 'plainpage#index'
#Home
get 'file_download' => 'home#file_download'
get 'home/index' => 'home#index'
post 'home/mkdir' => 'home#make_directory'
+ post 'home/chdir' => 'home#chdir'
+ post 'home/rmdir' => 'home#rmdir'
#Volume
get 'volume/index' => 'volume#index'
- post 'file_upload/:volume_name' => 'volume#file_upload'
- post 'volume/mount' => "volume#volume_mount"
- post 'volume/create' => "volume#volume_create"
get 'volume/unmount/:volume_name' => "volume#volume_unmount"
get 'volume/start/:volume_name' => "volume#volume_start"
get 'volume/stop/:volume_name' => "volume#volume_stop"
get 'volume/delete/:volume_name' => "volume#volume_delete"
+ post 'file_upload/:volume_name' => 'volume#file_upload'
+ post 'volume/mount' => "volume#volume_mount"
+ post 'volume/create' => "volume#volume_create"
+ post 'volume/chdir' => 'volume#chdir'
+
#Node
get 'node/index' => 'node#index'