mirror of
https://github.com/FAUSheppy/python-flask-picture-factory
synced 2025-12-06 07:01:37 +01:00
improve simple overview page
This commit is contained in:
@@ -90,14 +90,14 @@ def sendPicture(path):
|
|||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def list():
|
def list():
|
||||||
retString = ".\n"
|
retStringArr = []
|
||||||
print(PICTURE_DIR)
|
print(PICTURE_DIR)
|
||||||
for root, dirs, files in os.walk(PICTURE_DIR):
|
for root, dirs, files in os.walk(PICTURE_DIR):
|
||||||
path = root.split(os.sep)
|
path = root.split(os.sep)
|
||||||
for f in files:
|
for f in files:
|
||||||
retString += os.path.join(os.path.basename(root), f) + "<br>\n"
|
retStringArr += [os.path.join(os.path.basename(root), f)]
|
||||||
|
|
||||||
return (retString, 200)
|
return flask.render_template("index.html", paths=retStringArr)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
29
templates/index.html
Normal file
29
templates/index.html
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<head>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
|
<meta name="description" content="Image factory providing automatically resized and re-encoded images.">
|
||||||
|
<meta name="author" content="Yannik Schmidt">
|
||||||
|
<meta name="title" content="Image Factory">
|
||||||
|
|
||||||
|
<meta property="og:type" content="website" />
|
||||||
|
<meta property="og:title" content="Image Factory" />
|
||||||
|
<meta property="og:description" content="Image Factory developed by Yannik Schmidt" />
|
||||||
|
<meta property="og:url" content="/" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="dev-info">
|
||||||
|
Image Factory for internal use,
|
||||||
|
developed by <a href="https://potaris.de">Yannik Schmidt</a><br>
|
||||||
|
Availiable on
|
||||||
|
<a href="https://github.com/FAUSheppy/python-flask-picture-factory">FAUSheppy GitHub</a>
|
||||||
|
</div>
|
||||||
|
<p>
|
||||||
|
Public Images List:
|
||||||
|
</p>
|
||||||
|
<div class="overview">
|
||||||
|
<p>
|
||||||
|
{% for path in paths %}
|
||||||
|
{{ path }}<br>
|
||||||
|
{% endfor %}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
Reference in New Issue
Block a user