This commit is contained in:
bee0005 2016-09-02 06:02:43 +00:00
parent 7eff0efa68
commit 28d38e23a1
4 changed files with 8 additions and 11 deletions

View File

@ -44,6 +44,9 @@ class ApplicationController < ActionController::Base
puts @files
return @files
end
def checkDir
files = file_directory(params[:path])
render :json => {:file => files , :current => @current_dir}
end
end

View File

@ -38,13 +38,6 @@ class VolumeController < ApplicationController
redirect_to '/volume/info'
end
def checkDir
files = file_directory(params[:path])
render :json => {:file => files , :current => @current_dir}
end
def volume_mount
@config = get_conf
volume_name = params[:volume_name]

View File

@ -207,7 +207,7 @@
function change_directory(directory){
$.ajax({
method: "POST",
url: "/volume/changeDir",
url: "/application/changeDir",
data: { path: directory },
success : function(result){
$("#table_div").empty();

View File

@ -6,6 +6,8 @@ Rails.application.routes.draw do
# You can have the root of your site routed with "root"
root 'home#index'
post 'application/changeDir' => 'application#checkDir'
get 'index' => 'plainpage#index'
#Home
@ -15,7 +17,6 @@ Rails.application.routes.draw do
#Volume
get 'volume/index' => 'volume#index'
post 'file_upload' => 'volume#file_upload'
post 'volume/changeDir' => 'volume#checkDir'
post 'volume/mount' => "volume#volume_mount"
get 'volume/start/:volume_name' => "volume#volume_start"
get 'volume/stop/:volume_name' => "volume#volume_stop"