添加判断是否显示图表

This commit is contained in:
2019-05-28 11:29:41 +08:00
parent ee7ddbb1de
commit 182c97fb84
4 changed files with 56 additions and 27 deletions

View File

@ -201,12 +201,16 @@ def getUploadStats():
@app.route("/files/", methods=["GET"])
def fileIndex():
a = []
if not os.path.isdir("/var/lib/openmediavault/rrd"):
OMV_RRD_PATH = False
else:
OMV_RRD_PATH = True
for i in (glob("*.mp4") + glob("*.flv")):
a.append({
"name": i,
"size": Common.parseSize(os.path.getsize(i))
})
return render_template("files.html",files=a)
return render_template("files.html",files=a, show=OMV_RRD_PATH)
@app.route("/files/download/<path>", methods=["GET"])