허진호

Merge branch 'dev' of https://github.com/jh8579/fileshell_cloudcomputing into dev

# Conflicts:
#	fileshell/models.py
#	fileshell/settings.py
#	fileshell/urls.py
#	fileshell/views.py
#	templates/base.html
...@@ -85,6 +85,7 @@ body { ...@@ -85,6 +85,7 @@ body {
85 font-size: 30px; 85 font-size: 30px;
86 color:#ffffff; 86 color:#ffffff;
87 margin: 10px; 87 margin: 10px;
88 + margin-top: 30px;
88 } 89 }
89 .nav-item1 { 90 .nav-item1 {
90 font-size: 30px; 91 font-size: 30px;
...@@ -104,7 +105,7 @@ body { ...@@ -104,7 +105,7 @@ body {
104 .nav-link:hover { 105 .nav-link:hover {
105 } 106 }
106 .frame { 107 .frame {
107 - width: 2000px; 108 + width: 100%;
108 109
109 } 110 }
110 .header { 111 .header {
...@@ -134,13 +135,12 @@ body { ...@@ -134,13 +135,12 @@ body {
134 padding: 0 8px; 135 padding: 0 8px;
135 } 136 }
136 .container { 137 .container {
137 -
138 overflow: hidden; 138 overflow: hidden;
139 } 139 }
140 140
141 .content { 141 .content {
142 float: left; 142 float: left;
143 - width: 1600px; 143 + width: 100%;
144 144
145 } 145 }
146 .right_bar { 146 .right_bar {
......
...@@ -16,15 +16,15 @@ class MediaStorage(S3Boto3Storage): ...@@ -16,15 +16,15 @@ class MediaStorage(S3Boto3Storage):
16 def upload_file(file, user, dir): 16 def upload_file(file, user, dir):
17 client = boto3.client('s3') 17 client = boto3.client('s3')
18 data = file 18 data = file
19 - f = open('tempfile', 'wb') 19 + f = open(file.name, 'wb')
20 for chunk in data.chunks(): 20 for chunk in data.chunks():
21 f.write(chunk) 21 f.write(chunk)
22 f.close() 22 f.close()
23 23
24 - nf = open('tempfile', 'rb') 24 + nf = open(file.name, 'rb')
25 # client.Bucket(AWS_STORAGE_BUCKET_NAME).put_object(Key=file_name, body= nf) 25 # client.Bucket(AWS_STORAGE_BUCKET_NAME).put_object(Key=file_name, body= nf)
26 client.upload_fileobj(nf, AWS_STORAGE_BUCKET_NAME, user.username + '/' + dir + file.name) 26 client.upload_fileobj(nf, AWS_STORAGE_BUCKET_NAME, user.username + '/' + dir + file.name)
27 - os.remove('tempfile') 27 + os.remove(file.name)
28 # putResponse = client.put_object(Bucket=AWS_STORAGE_BUCKET_NAME, Key= file_name) 28 # putResponse = client.put_object(Bucket=AWS_STORAGE_BUCKET_NAME, Key= file_name)
29 29
30 def down(filename, bucketPath): 30 def down(filename, bucketPath):
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
22 </div> 22 </div>
23 <div class="header"> 23 <div class="header">
24 <a href="{% url 'logout' %}"> <img class = 'logout_icon' src= "{% static 'resources/logout.png' %}" width="50" height="50" align="right"/></a> 24 <a href="{% url 'logout' %}"> <img class = 'logout_icon' src= "{% static 'resources/logout.png' %}" width="50" height="50" align="right"/></a>
25 - <!--
26 - <a href="{% url 'profile' %}"> <img class = 'profile_icon' src= "{% static 'resources/profile.png' %}" width="50" height="50" align="right"/></a>
27 - -->
28 <div class="search_form"> 25 <div class="search_form">
29 <form id='search' action="" onsubmit="yourFunction()" method="post" enctype="multipart/form-data" >{% csrf_token %} 26 <form id='search' action="" onsubmit="yourFunction()" method="post" enctype="multipart/form-data" >{% csrf_token %}
30 <input type="dir_name" name="dir_name" id="dir_name" required="required" placeholder="검색할 파일이나 폴더 이름"> 27 <input type="dir_name" name="dir_name" id="dir_name" required="required" placeholder="검색할 파일이나 폴더 이름">
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
21 <div class="container"> 21 <div class="container">
22 <!-- //nav --> 22 <!-- //nav -->
23 <div class="content"> 23 <div class="content">
24 - <table id="hor-minimalist-b" width = 1000px> 24 + <table id="hor-minimalist-b" width = 100%>
25 <thead> 25 <thead>
26 <tr> 26 <tr>
27 <th scope="col", >제목</th> 27 <th scope="col", >제목</th>
...@@ -54,28 +54,27 @@ ...@@ -54,28 +54,27 @@
54 </tr> 54 </tr>
55 {% endfor %} 55 {% endfor %}
56 </tbody> 56 </tbody>
57 - {% else %}
58 - <p>No Folder.</p>
59 {% endif %} 57 {% endif %}
60 {% if fileList %} 58 {% if fileList %}
61 <tbody> 59 <tbody>
62 - {% for fileRow in fileList %} 60 + {% for fileRow in fileList %}
63 - <tr> 61 + <tr>
64 - <td><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>{{ fileRow.title }}</a></td> 62 + <td><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>{{ fileRow.title }}</a></td>
65 - <td><p href="", >{{ fileRow.uploaded_TM }}</p></td> 63 + <td><p href="", >{{ fileRow.uploaded_TM }}</p></td>
66 - <td><p href="", >{{ fileRow.last_view_TM }}</p></td> 64 + <td><p href="", >{{ fileRow.last_view_TM }}</p></td>
67 - <td><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" style="text-align:center;">{{ fileRow.isFavor }}</a></td> 65 + {% if fileRow.isFavor%}
68 - <td><p href="", >{{ fileRow.fileSize }}</p></td> 66 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/color_star.png' %}" width="50" height="50"/></a></td>
69 - <td><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>파일 삭제</a></td> 67 + {% else %}
70 - 68 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/gray_star.png' %}" width="50" height="50"/></a></td>
71 - </tr> 69 + {% endif %}
72 - {% endfor %} 70 + <td><p href="", >{{ fileRow.fileSize }}</p></td>
71 + <td><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center><img class = 'trash_icon' src= "{% static 'resources/trashcan.png' %}" width="50" height="50"/></a></td>
72 + </tr>
73 + {% endfor %}
73 </tbody> 74 </tbody>
74 - {% else %}
75 - <p>No File.</p>
76 {% endif %} 75 {% endif %}
77 </table> 76 </table>
78 - <form action="{% url 'upload' %}" id="dropzone" class="dropzone" method="post" enctype="multipart/form-data" >{% csrf_token %} 77 + <form action="{% url 'upload' %}" id="dropzone" class="dropzone" method="post" enctype="multipart/form-data" multi>{% csrf_token %}
79 <div class="fallback"> 78 <div class="fallback">
80 <input class="fall_back" name="source-file" type="file"/> 79 <input class="fall_back" name="source-file" type="file"/>
81 </div> 80 </div>
...@@ -96,6 +95,11 @@ ...@@ -96,6 +95,11 @@
96 location.reload(); 95 location.reload();
97 } 96 }
98 }); 97 });
98 + this.on('completemulti', function(){
99 + if (this.getQueuedFiles().length == 0 && this.getUploadingFiles().length == 0) {
100 + location.reload();
101 + }
102 + });
99 } 103 }
100 }; 104 };
101 </script> 105 </script>
......
...@@ -20,21 +20,23 @@ ...@@ -20,21 +20,23 @@
20 <td width=100><p>파일 삭제</p></td> 20 <td width=100><p>파일 삭제</p></td>
21 </tr> 21 </tr>
22 </thead> 22 </thead>
23 - {% if favorList %} <tbody> 23 + {% if favorList %}
24 - {% for fileRow in favorList %} 24 + <tbody>
25 - <tr> 25 + {% for fileRow in favorList %}
26 - <td width=50><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" valign=center>{{ fileRow.title }}</a></td> 26 + <tr>
27 - <td width=100><p href="", >{{ fileRow.uploaded_TM }}</p></td> 27 + <td width=50><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" valign=center>{{ fileRow.title }}</a></td>
28 - <td width=100><p href="",>{{ fileRow.last_view_TM }}</p></td> 28 + <td width=100><p href="", >{{ fileRow.uploaded_TM }}</p></td>
29 - <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center>{{ fileRow.isFavor }}</a></td> 29 + <td width=100><p href="",>{{ fileRow.last_view_TM }}</p></td>
30 - <td width=100><p href="", >{{ fileRow.fileSize }}</p></td> 30 + {% if fileRow.isFavor%}
31 - <td width=100><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>파일 삭제</a></td> 31 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/color_star.png' %}" width="50" height="50"/></a></td>
32 - 32 + {% else %}
33 - </tr> 33 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/gray_star.png' %}" width="50" height="50"/></a></td>
34 - {% endfor %} 34 + {% endif %}
35 + <td width=100><p href="", >{{ fileRow.fileSize }}</p></td>
36 + <td width=100><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center><img class = 'trash_icon' src= "{% static 'resources/trashcan.png' %}" width="50" height="50"/></a></td>
37 + </tr>
38 + {% endfor %}
35 </tbody> 39 </tbody>
36 - {% else %}
37 - <p>No File.</p>
38 {% endif %} 40 {% endif %}
39 </table> 41 </table>
40 <div class = "shiftleft"> 42 <div class = "shiftleft">
...@@ -53,25 +55,40 @@ ...@@ -53,25 +55,40 @@
53 </thead> 55 </thead>
54 {% if recentList %} 56 {% if recentList %}
55 <tbody> 57 <tbody>
56 - {% for fileRow in recentList %} 58 + {% for fileRow in recentList %}
57 - <tr> 59 + <tr>
58 - <td width=50><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>{{ fileRow.title }}</a></td> 60 + <td width=50><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>{{ fileRow.title }}</a></td>
59 - <td width=100><p href="", >{{ fileRow.uploaded_TM }}</p></td> 61 + <td width=100><p href="", >{{ fileRow.uploaded_TM }}</p></td>
60 - <td width=100><p href="", >{{ fileRow.last_view_TM }}</p></td> 62 + <td width=100><p href="" >{{ fileRow.last_view_TM }}</p></td>
61 - <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center>{{ fileRow.isFavor }}</a></td> 63 + {% if fileRow.isFavor%}
62 - <td width=100><p href="",>{{ fileRow.fileSize }}</p></td> 64 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/color_star.png' %}" width="50" height="50"/></a></td>
63 - <td width=100><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>파일 삭제</a></td> 65 + {% else %}
64 - 66 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/gray_star.png' %}" width="50" height="50"/></a></td>
65 - </tr> 67 + {% endif %}
66 - {% endfor %} 68 + <td width=100><p href="">{{ fileRow.fileSize }}</p></td>
69 + <td width=100><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center><img class = 'trash_icon' src= "{% static 'resources/trashcan.png' %}" width="50" height="50"/></a></td>
70 + </tr>
71 + {% endfor %}
67 </tbody> 72 </tbody>
68 - {% else %}
69 - <p>No File.</p>
70 {% endif %} 73 {% endif %}
71 </table> 74 </table>
72 </div> 75 </div>
73 </div> 76 </div>
74 <!-- //container --> 77 <!-- //container -->
75 </div> 78 </div>
79 +
80 + <script src="{% static 'js/dropzone.js' %}"></script>
81 + <script type="text/javascript">
82 + Dropzone.options.dropzone = {
83 + maxFilesize: 10, // Mb
84 + init: function() {
85 + this.on('success', function(){
86 + if (this.getQueuedFiles().length == 0 && this.getUploadingFiles().length == 0) {
87 + location.reload();
88 + }
89 + });
90 + }
91 + };
92 + </script>
76 <!-- //frame --> 93 <!-- //frame -->
77 {% endblock %} 94 {% endblock %}
......
...@@ -8,42 +8,46 @@ ...@@ -8,42 +8,46 @@
8 <div class="content"> 8 <div class="content">
9 <table id="hor-minimalist-b" width = 1000px> 9 <table id="hor-minimalist-b" width = 1000px>
10 <thead> 10 <thead>
11 - <tr> 11 + <tr>
12 - <td width=300><p >제목</p></td> 12 + <td width=300><p >제목</p></td>
13 - <td width=350><p >등록 시간</p></td> 13 + <td width=350><p >등록 시간</p></td>
14 - <td width=350><p >최근 열람 시간</p></td> 14 + <td width=350><p >최근 열람 시간</p></td>
15 - <td width=200><p >즐겨찾기</p></td> 15 + <td width=200><p >즐겨찾기</p></td>
16 - <td width=200><p >파일 크기</p></td> 16 + <td width=200><p >파일 크기</p></td>
17 - <td width=200><p >파일 삭제</p></td> 17 + <td width=200><p >파일 삭제</p></td>
18 - </tr> 18 + </tr>
19 </thead> 19 </thead>
20 {% if folderList %} 20 {% if folderList %}
21 <tbody> 21 <tbody>
22 - {% for folderRow in folderList %} 22 + {% for folderRow in folderList %}
23 - <tr> 23 + <tr>
24 - <td width=50><a href="/{{ folderRow.dir_name }}", align=center>{{ folderRow.dir_name }}</a></td> 24 + <td width=50><a href="/{{ folderRow.dir_name }}", align=center>{{ folderRow.dir_name }}</a></td>
25 - <td width=100><p href="",>{{ folderRow.uploaded_TM }}</p></td> 25 + <td width=100><p href="",>{{ folderRow.uploaded_TM }}</p></td>
26 - <td width=100><p href="",>{{ folderRow.last_view_TM }}</p></td> 26 + <td width=100><p href="",>{{ folderRow.last_view_TM }}</p></td>
27 - <td width=100><p href="",>{{ folderRow.isFavor }}</p></td> 27 + <td width=100><p href="",>{{ folderRow.isFavor }}</p></td>
28 - <td width=100><p href="",>{{ folderRow.fileSize }}</p></td> 28 + <td width=100><p href="",>{{ folderRow.fileSize }}</p></td>
29 - </tr> 29 + </tr>
30 - {% endfor %} 30 + {% endfor %}
31 </tbody> 31 </tbody>
32 {% else %} 32 {% else %}
33 33
34 {% endif %} 34 {% endif %}
35 {% if fileList %} 35 {% if fileList %}
36 <tbody> 36 <tbody>
37 - {% for fileRow in fileList %} 37 + {% for fileRow in fileList %}
38 - <tr> 38 + <tr>
39 - <td width=50><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>{{ fileRow.title }}</a></td> 39 + <td width=50><a href="/download/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>{{ fileRow.title }}</a></td>
40 - <td width=100><p href="", >{{ fileRow.uploaded_TM }}</p></td> 40 + <td width=100><p href="", >{{ fileRow.uploaded_TM }}</p></td>
41 - <td width=100><p href="", >{{ fileRow.last_view_TM }}</p></td> 41 + <td width=100><p href="", >{{ fileRow.last_view_TM }}</p></td>
42 - <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center>{{ fileRow.isFavor }}</a></td> 42 + {% if fileRow.isFavor%}
43 - <td width=100><p href="", >{{ fileRow.fileSize }}</p></td> 43 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/color_star.png' %}" width="50" height="50"/></a></td>
44 - <td width=100><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center>파일 삭제</a></td> 44 + {% else %}
45 - </tr> 45 + <td width=100><a href="/changeFavor/{{ fileRow.bucketPath }}/{{ fileRow.title }}" align=center><img class = 'star_icon' src= "{% static 'resources/gray_star.png' %}" width="50" height="50"/></a></td>
46 - {% endfor %} 46 + {% endif %}
47 + <td width=100><p href="", >{{ fileRow.fileSize }}</p></td>
48 + <td width=100><a href="/delete/{{ fileRow.bucketPath }}{{ fileRow.title }}//{{ fileRow.title }}//{{ fileRow.bucketPath }}" align=center><img class = 'trash_icon' src= "{% static 'resources/trashcan.png' %}" width="50" height="50"/></a></td>
49 + </tr>
50 + {% endfor %}
47 </tbody> 51 </tbody>
48 {% else %} 52 {% else %}
49 53
......