update
This commit is contained in:
parent
9eb2720f2d
commit
84288c167a
@ -24,4 +24,26 @@ class ApplicationController < ActionController::Base
|
|||||||
return @config
|
return @config
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def file_directory(dir)
|
||||||
|
@current_dir = dir
|
||||||
|
dir_list = `ls #{@current_dir} -l`
|
||||||
|
parsing_list = dir_list.split("\n")
|
||||||
|
@files = Array.new
|
||||||
|
file = Hash.new
|
||||||
|
|
||||||
|
@total_list = parsing_list[0]
|
||||||
|
for t in 1..(parsing_list.length-1)
|
||||||
|
parsing_file = parsing_list[t].split(" ")
|
||||||
|
file["auth"] = parsing_file[0]
|
||||||
|
file["size"] = parsing_file[4]
|
||||||
|
file["date"] = parsing_file[5] + " " + parsing_file[6] + " " + parsing_file[7]
|
||||||
|
file["name"] = parsing_file[8]
|
||||||
|
@files << file
|
||||||
|
file = Hash.new
|
||||||
|
end
|
||||||
|
puts @files
|
||||||
|
return @files
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -39,27 +39,7 @@ class VolumeController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def file_directory(dir)
|
|
||||||
@current_dir = dir
|
|
||||||
dir_list = `ls #{@current_dir} -l`
|
|
||||||
parsing_list = dir_list.split("\n")
|
|
||||||
@files = Array.new
|
|
||||||
file = Hash.new
|
|
||||||
|
|
||||||
@total_list = parsing_list[0]
|
|
||||||
for t in 1..(parsing_list.length-1)
|
|
||||||
parsing_file = parsing_list[t].split(" ")
|
|
||||||
file["auth"] = parsing_file[0]
|
|
||||||
file["size"] = parsing_file[4]
|
|
||||||
file["date"] = parsing_file[5] + " " + parsing_file[6] + " " + parsing_file[7]
|
|
||||||
file["name"] = parsing_file[8]
|
|
||||||
@files << file
|
|
||||||
file = Hash.new
|
|
||||||
end
|
|
||||||
puts @files
|
|
||||||
return @files
|
|
||||||
end
|
|
||||||
|
|
||||||
def checkDir
|
def checkDir
|
||||||
files = file_directory(params[:path])
|
files = file_directory(params[:path])
|
||||||
render :json => {:file => files , :current => @current_dir}
|
render :json => {:file => files , :current => @current_dir}
|
||||||
|
Loading…
Reference in New Issue
Block a user