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.
|
||||
"""
|
||||
import os
|
||||
import time
|
||||
import string
|
||||
import secrets
|
||||
import sqlite3
|
||||
|
@ -261,9 +262,14 @@ def manage_uploads():
|
|||
"SELECT filename, uploaded_date FROM uploads WHERE uploaded_by = ?",
|
||||
(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":
|
||||
return render_template("manage_uploads.html", uploads=uploads,
|
||||
app_url=app.config.get("APP_URL"))
|
||||
return render_template("manage_uploads.html", uploads=new_uploads)
|
||||
|
||||
|
||||
@app.route("/", methods=["POST", "GET"])
|
||||
|
|
|
@ -4,7 +4,17 @@
|
|||
<title>Manage your uploads</title>
|
||||
</head>
|
||||
<body>
|
||||
<table>
|
||||
<tr>
|
||||
<th>File</th>
|
||||
<th>Date Uploaded</th>
|
||||
</tr>
|
||||
{% for file, date in uploads %}
|
||||
{% app_url + file + "\t" + date %}
|
||||
<tr>
|
||||
<td>{{ upload_url + file }}</td>
|
||||
<td>{{ date|string }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue
Block a user