删除无用代码
This commit is contained in:
parent
96c68dc608
commit
637046c4ef
20
WebMain.py
20
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/<path>", methods=["GET"])
|
||||
@ -250,20 +246,6 @@ def fileDownload(path):
|
||||
return Response(status=404)
|
||||
|
||||
|
||||
@app.route("/images/rrd/<filename>")
|
||||
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)
|
||||
|
@ -21,9 +21,6 @@
|
||||
<hr/>
|
||||
<h3><a href="/">录播信息页</a></h3>
|
||||
{% include 'device.html' %}
|
||||
{% if show %}
|
||||
{% include 'status.html' %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
@ -1,42 +0,0 @@
|
||||
<hr/>
|
||||
<h3>CPU</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 33%">CPU近半天</td>
|
||||
<td style="width: 33%">CPU近一天</td>
|
||||
<td style="width: 33%">CPU近三天</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img style="width: 100%" src="/images/rrd/cpu-0-half_day.png"></td>
|
||||
<td><img style="width: 100%" src="/images/rrd/cpu-0-day.png"></td>
|
||||
<td><img style="width: 100%" src="/images/rrd/cpu-0-three_days.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<h3>磁盘</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 33%">磁盘近半天</td>
|
||||
<td style="width: 33%">磁盘近一天</td>
|
||||
<td style="width: 33%">磁盘近三天</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img style="width: 100%" src="/images/rrd/df-srv-dev-disk-by-label-6TB-half_day.png"></td>
|
||||
<td><img style="width: 100%" src="/images/rrd/df-srv-dev-disk-by-label-6TB-day.png"></td>
|
||||
<td><img style="width: 100%" src="/images/rrd/df-srv-dev-disk-by-label-6TB-three_days.png"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<h3>网络</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="width: 33%">网络近半天</td>
|
||||
<td style="width: 33%">网络近一天</td>
|
||||
<td style="width: 33%">网络近三天</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img style="width: 100%" src="/images/rrd/interface-enp3s0-half_day.png"></td>
|
||||
<td><img style="width: 100%" src="/images/rrd/interface-enp3s0-day.png"></td>
|
||||
<td><img style="width: 100%" src="/images/rrd/interface-enp3s0-three_days.png"></td>
|
||||
</tr>
|
||||
</table>
|
Reference in New Issue
Block a user