diff --git a/app/controllers/volume_controller.rb b/app/controllers/volume_controller.rb index 15f77f3..f0a57c0 100644 --- a/app/controllers/volume_controller.rb +++ b/app/controllers/volume_controller.rb @@ -1,11 +1,10 @@ class VolumeController < ApplicationController def info - - file_directory('/home/ubuntu') - + mnt_path = "/opt/gluster-web-interface/app/mntpoint" @volumes = Array.new volume = Hash.new i = 0 + if get_info.blank? flash[:danger] = "Check Server" else @@ -15,11 +14,13 @@ class VolumeController < ApplicationController temp = output[t].split(":") volume[temp[0]] = temp[1] else + volume["files"] = file_directory(mnt_path + "/" + volume["Volume Name"].delete(' '), volume["Volume Name"].delete(' ')) @volumes[i] = volume volume = Hash.new i+=1 end end + volume["files"] = file_directory(mnt_path + "/" + volume["Volume Name"].delete(' '), volume["Volume Name"].delete(' ')) @volumes[i] = volume puts @volumes end @@ -37,13 +38,24 @@ class VolumeController < ApplicationController end - def file_directory(dir) + def file_directory(dir, dir_name) + puts "start///////" + puts "dir: " + dir + puts "dir_name: " + dir_name + + @current_dir = dir + `sudo mkdir #{dir}` + `sudo mount.glusterfs gluster-1:/#{dir_name} #{dir}` + dir_list = `ls #{@current_dir} -l` + + puts dir_list + parsing_list = dir_list.split("\n") - @files = Array.new + files = Array.new file = Hash.new i = 0 @total_list = parsing_list[0] @@ -52,12 +64,14 @@ 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["name"] = parsing_file[8] - @files[i] = file - file = Hash.new - i+=1 + file["date"] = parsing_file[5] + " " + parsing_file[6] + " "+ parsing_file[7] + file["name"] = parsing_file[8] + @files[i] = file + file = Hash.new + i+=1 end - puts @files + puts files + + return files end end diff --git a/app/mntpoint/dist-volume/project_oss_proposal.pdf b/app/mntpoint/dist-volume/project_oss_proposal.pdf new file mode 100644 index 0000000..72ace4d Binary files /dev/null and b/app/mntpoint/dist-volume/project_oss_proposal.pdf differ diff --git a/app/mntpoint/dist-volume/x1 b/app/mntpoint/dist-volume/x1 new file mode 100644 index 0000000..e69de29 diff --git a/app/mntpoint/dist-volume/x2 b/app/mntpoint/dist-volume/x2 new file mode 100644 index 0000000..e69de29 diff --git a/app/mntpoint/dist-volume/x3 b/app/mntpoint/dist-volume/x3 new file mode 100644 index 0000000..e69de29 diff --git a/app/mntpoint/dist-volume/x4 b/app/mntpoint/dist-volume/x4 new file mode 100644 index 0000000..e69de29 diff --git a/app/mntpoint/dist-volume/x5 b/app/mntpoint/dist-volume/x5 new file mode 100644 index 0000000..e69de29 diff --git a/app/mntpoint/dist-volume/제10회_공개SW_개발자대회_심사기준_안내.pdf b/app/mntpoint/dist-volume/제10회_공개SW_개발자대회_심사기준_안내.pdf new file mode 100644 index 0000000..e4046e0 Binary files /dev/null and b/app/mntpoint/dist-volume/제10회_공개SW_개발자대회_심사기준_안내.pdf differ diff --git a/app/views/volume/info.html.erb b/app/views/volume/info.html.erb index d7b0370..3bd10c7 100644 --- a/app/views/volume/info.html.erb +++ b/app/views/volume/info.html.erb @@ -4,7 +4,7 @@
-

Volume Info

+

Volume