From 637046c4ef116b6d5cef6db5fcfe114488d96e68 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Fri, 20 Dec 2019 13:15:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebMain.py | 20 +------------------- templates/files.html | 3 --- templates/status.html | 42 ------------------------------------------ 3 files changed, 1 insertion(+), 64 deletions(-) delete mode 100644 templates/status.html diff --git a/WebMain.py b/WebMain.py index 8cabf15..7a502c0 100644 --- a/WebMain.py +++ b/WebMain.py @@ -211,16 +211,12 @@ def accountRelogin(): @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, show=OMV_RRD_PATH) + return render_template("files.html",files=a) @app.route("/files/download/", methods=["GET"]) @@ -250,20 +246,6 @@ def fileDownload(path): return Response(status=404) -@app.route("/images/rrd/") -def rrdGraphGet(filename): - OMV_RRD_PATH = "/var/lib/openmediavault/rrd" - def generate(file): - with open(file, "rb") as f: - for row in f: - yield row - if os.path.isdir(OMV_RRD_PATH): - if os.path.exists(os.path.join(OMV_RRD_PATH, filename)): - return Response(generate(os.path.join(OMV_RRD_PATH, filename)), - mimetype='application/octet-stream') - return Response(status=404) - - def SubThread(): t = threading.Thread(target=RUN, args=()) t.setDaemon(True) diff --git a/templates/files.html b/templates/files.html index 6b6d1c7..40221cb 100644 --- a/templates/files.html +++ b/templates/files.html @@ -21,9 +21,6 @@

录播信息页

{% include 'device.html' %} - {% if show %} - {% include 'status.html' %} - {% endif %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html deleted file mode 100644 index 6991adf..0000000 --- a/templates/status.html +++ /dev/null @@ -1,42 +0,0 @@ -
-

CPU

- - - - - - - - - - - -
CPU近半天CPU近一天CPU近三天
-
-

磁盘

- - - - - - - - - - - -
磁盘近半天磁盘近一天磁盘近三天
-
-

网络

- - - - - - - - - - - -
网络近半天网络近一天网络近三天
\ No newline at end of file