From 182c97fb840d794db8e0d4bff69e4ba056d41f8f Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Tue, 28 May 2019 11:29:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=98=BE=E7=A4=BA=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebMain.py | 6 +++++- templates/device.html | 27 +------------------------ templates/files.html | 3 +++ templates/status.html | 47 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 27 deletions(-) create mode 100644 templates/status.html diff --git a/WebMain.py b/WebMain.py index c892d26..9f12742 100644 --- a/WebMain.py +++ b/WebMain.py @@ -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/", methods=["GET"]) diff --git a/templates/device.html b/templates/device.html index dc74374..8d878c7 100644 --- a/templates/device.html +++ b/templates/device.html @@ -27,29 +27,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
CPU近半天
CPU近一天
CPU近三天
网络近半天
网络近一天
网络近三天
+ diff --git a/templates/files.html b/templates/files.html index 40221cb..6b6d1c7 100644 --- a/templates/files.html +++ b/templates/files.html @@ -21,6 +21,9 @@

录播信息页

{% 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 new file mode 100644 index 0000000..281ee2c --- /dev/null +++ b/templates/status.html @@ -0,0 +1,47 @@ +

CPU

+ + + + + + + + + + + + + +
CPU近半天
CPU近一天
CPU近三天
+
+

磁盘

+ + + + + + + + + + + + + +
磁盘近半天
磁盘近一天
磁盘近三天
+
+

网络

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