Update volume controller
This commit is contained in:
parent
6bebf599ce
commit
8fe78e8384
@ -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
|
||||
|
BIN
app/mntpoint/dist-volume/project_oss_proposal.pdf
Normal file
BIN
app/mntpoint/dist-volume/project_oss_proposal.pdf
Normal file
Binary file not shown.
0
app/mntpoint/dist-volume/x1
Normal file
0
app/mntpoint/dist-volume/x1
Normal file
0
app/mntpoint/dist-volume/x2
Normal file
0
app/mntpoint/dist-volume/x2
Normal file
0
app/mntpoint/dist-volume/x3
Normal file
0
app/mntpoint/dist-volume/x3
Normal file
0
app/mntpoint/dist-volume/x4
Normal file
0
app/mntpoint/dist-volume/x4
Normal file
0
app/mntpoint/dist-volume/x5
Normal file
0
app/mntpoint/dist-volume/x5
Normal file
BIN
app/mntpoint/dist-volume/제10회_공개SW_개발자대회_심사기준_안내.pdf
Normal file
BIN
app/mntpoint/dist-volume/제10회_공개SW_개발자대회_심사기준_안내.pdf
Normal file
Binary file not shown.
@ -4,7 +4,7 @@
|
||||
<div class="">
|
||||
<div class="page-title">
|
||||
<div class="title_left">
|
||||
<h3>Volume Info </h3>
|
||||
<h3>Volume</h3>
|
||||
</div>
|
||||
<div class="title_right">
|
||||
<div class="col-md-5 col-sm-5 col-xs-12 form-group pull-right top_search">
|
||||
@ -84,7 +84,8 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<%@files.each do |t|%>
|
||||
<%f = t["files"]%>
|
||||
<%f.each do |t|%>
|
||||
<tr>
|
||||
<td><%=t["name"]%></td>
|
||||
<td><%=t["auth"][0]%></td>
|
||||
|
@ -1,2 +1,2 @@
|
||||
host:
|
||||
124.63.216.174:2222 gluster-1
|
||||
host
|
||||
192.168.0.10 gluster-1
|
||||
|
BIN
public/uploads/제10회_공개SW_개발자대회_심사기준_안내.pdf
Normal file
BIN
public/uploads/제10회_공개SW_개발자대회_심사기준_안내.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user