more manage_users
This commit is contained in:
parent
46ade7956f
commit
90f7bf75ed
10
fileHost.py
10
fileHost.py
|
@ -3,6 +3,7 @@
|
||||||
Simple file host using Flask.
|
Simple file host using Flask.
|
||||||
"""
|
"""
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
import string
|
import string
|
||||||
import secrets
|
import secrets
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
@ -261,9 +262,14 @@ def manage_uploads():
|
||||||
"SELECT filename, uploaded_date FROM uploads WHERE uploaded_by = ?",
|
"SELECT filename, uploaded_date FROM uploads WHERE uploaded_by = ?",
|
||||||
(username,)).fetchall()
|
(username,)).fetchall()
|
||||||
|
|
||||||
|
new_uploads = []
|
||||||
|
for file, date in uploads:
|
||||||
|
file = app.config.get("UPLOAD_URL") + file
|
||||||
|
date = time.strftime("%Y-%m-%d %H:%M", date)
|
||||||
|
new_uploads.append((file, date))
|
||||||
|
|
||||||
if request.method == "GET":
|
if request.method == "GET":
|
||||||
return render_template("manage_uploads.html", uploads=uploads,
|
return render_template("manage_uploads.html", uploads=new_uploads)
|
||||||
app_url=app.config.get("APP_URL"))
|
|
||||||
|
|
||||||
|
|
||||||
@app.route("/", methods=["POST", "GET"])
|
@app.route("/", methods=["POST", "GET"])
|
||||||
|
|
|
@ -4,7 +4,17 @@
|
||||||
<title>Manage your uploads</title>
|
<title>Manage your uploads</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>File</th>
|
||||||
|
<th>Date Uploaded</th>
|
||||||
|
</tr>
|
||||||
{% for file, date in uploads %}
|
{% for file, date in uploads %}
|
||||||
{% app_url + file + "\t" + date %}
|
<tr>
|
||||||
|
<td>{{ upload_url + file }}</td>
|
||||||
|
<td>{{ date|string }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user