From 5c1f712900a54ca6882dfaf395d303d344fc36b7 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 22 Apr 2019 05:59:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=BD=91=E9=80=9F=E7=9A=84?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common.py | 10 +++++----- liveDownloader.py | 3 +-- static/index.js | 10 +++++----- templates/device.html | 8 ++++---- templates/head.html | 6 ++++++ templates/index.html | 10 +++++----- 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/Common.py b/Common.py index 9bb2a11..26a0d7c 100644 --- a/Common.py +++ b/Common.py @@ -54,18 +54,18 @@ def doClean(): def getCurrentStatus(): _disk = psutil.disk_usage("/") _mem = psutil.virtual_memory() - _net = psutil.net_io_counters() _delta= getTimeDelta(datetime.now(),network["currentTime"]) - if getTimeDelta(datetime.now(), _do_move_time) > 3600: - p = threading.Thread(target=doClean) - p.setDaemon(True) - p.start() + _net = psutil.net_io_counters() if 60 > _delta > 0: _inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta _outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta else: _outSpeed = 0 _inSpeed = 0 + if getTimeDelta(datetime.now(), _do_move_time) > 3600: + p = threading.Thread(target=doClean) + p.setDaemon(True) + p.start() updateNetwork() return { "memTotal": parseSize(_mem.total), diff --git a/liveDownloader.py b/liveDownloader.py index 7d95f2c..ba5409e 100644 --- a/liveDownloader.py +++ b/liveDownloader.py @@ -32,8 +32,7 @@ def download(url): Common.modifyLastDownloadStatus("Download >{}< Exceed MaxSize".format(path)) break except Exception as e: - Common.appendError("Download >{}< With Exception {}".format(path, datetime.strftime(datetime.now(), "%y%m%d %H%M"), - e.__str__())) + Common.appendError("Download >{}< With Exception {}".format(path, e.__str__())) f.close() isDownload = False Common.modifyLastDownloadStatus("Download >{}< Finished".format(path)) diff --git a/static/index.js b/static/index.js index 952cd80..2d54541 100644 --- a/static/index.js +++ b/static/index.js @@ -16,35 +16,35 @@ function taskUpdate(){ $("#download").html(function(){ var ret = "" res.data.download.reverse().forEach(function(obj){ - ret += "
CPU使用率 | +CPU使用率 | % | |
内存使用率 | +内存使用率 | /(%) | |
磁盘使用率 | +磁盘使用率 | /(%) | |
网络速率 | +网络速率 | ↓ /s | ↑ /s |
下载日志 | +下载日志 | |
转码日志 队列 |
+ 转码日志 队列 |
|
上传日志 队列 |
+ 上传日志 队列 |
|
错误日志 | +错误日志 | |
操作日志 | +操作日志 |