diff --git a/app/controllers/volume_controller.rb b/app/controllers/volume_controller.rb index 568d4f9..10b33f5 100644 --- a/app/controllers/volume_controller.rb +++ b/app/controllers/volume_controller.rb @@ -2,7 +2,17 @@ class VolumeController < ApplicationController helper_method :file_directory def info - file_directory(`pwd`) + @conf_list = get_conf + project_path = String.new + @conf_list.each do |t| + if t.include? "project_path=" + project_path = t.split("project_path=")[1] + end + end + + file_directory(project_path) + + @volumes = Array.new volume = Hash.new @@ -29,13 +39,12 @@ class VolumeController < ApplicationController end def get_info - conf_list = get_conf host_user = "root" host_ip = "127.0.0.1" host_password = "secret" host_port = "" - conf_list.each do |t| + @conf_list.each do |t| if t.include? "host_name=" host_user = t.split("host_user=")[1] elsif t.include? "host_ip=" @@ -70,7 +79,7 @@ class VolumeController < ApplicationController 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["date"] = parsing_file[5] + " " + parsing_file[6] + " " + parsing_file[7] file["name"] = parsing_file[8] @files << file file = Hash.new diff --git a/app/views/volume/info.html.erb b/app/views/volume/info.html.erb index c092567..1334214 100644 --- a/app/views/volume/info.html.erb +++ b/app/views/volume/info.html.erb @@ -93,10 +93,12 @@ <% if t["auth"][0]=='d'%> - ')"><%=t["name"]%> + ')"><%=t["name"]%> <% else %> - <%=t["name"]%> + + <%=t["name"]%> + <% end %> <%=t["auth"]%> <%=t["size"]%> @@ -175,14 +177,14 @@ } function change_directory(directory){ - $.ajax({ + $.ajax({ method: "POST", url: "/volume/changeDir", data: { path: directory }, success : function(result){ $("#table_div").empty(); - var new_table = "

File Manager

" - new_table += "

Current directory : " + directory + "


"; + var new_table = "

File Manager

"; + new_table += "

Current directory : " + directory + "


"; new_table += ""; new_table += ""; new_table += ""; @@ -192,11 +194,12 @@ new_table += ""; new_table += ""; new_table += ""; - new_table += "" + new_table += ""; var new_tr = "" + new_tr += " .."; + new_tr += ""; + for( var i = 0; i < result.file.length; i++){ if(i % 2 == 0) new_tr += ""; @@ -205,11 +208,11 @@ if(result.file[i].auth[0] == "d"){ new_tr += ""; + new_tr += "" + result.file[i].name + ""; else - new_tr += "" + result.file[i].name + ""; + new_tr += "" + result.file[i].name + ""; }else{ - new_tr += ""; + new_tr += ""; } new_tr += ""; new_tr += "";
Date
"; - new_tr += " .." - new_tr += "
"; if(result.current != "/") - new_tr += "" + result.file[i].name + " " + result.file[i].name + "" + result.file[i].name + ""+result.file[i].auth+""+result.file[i].size+"