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 += "" + obj.datetime + "" + obj.message + "" + ret += "" + obj.datetime + "" + obj.message + "" }) return "" + ret + "
" }) $("#encode").html(function(){ var ret = "" res.data.encode.reverse().forEach(function(obj){ - ret += "" + obj.datetime + "" + obj.message + "" + ret += "" + obj.datetime + "" + obj.message + "" }) return "" + ret + "
" }) $("#upload").html(function(){ var ret = "" res.data.upload.reverse().forEach(function(obj){ - ret += "" + obj.datetime + "" + obj.message + "" + ret += "" + obj.datetime + "" + obj.message + "" }) return "" + ret + "
" }) $("#error").html(function(){ var ret = "" res.data.error.reverse().forEach(function(obj){ - ret += "" + obj.datetime + "" + obj.message + "" + ret += "" + obj.datetime + "" + obj.message + "" }) return "" + ret + "
" }) $("#operation").html(function(){ var ret = "" res.data.operation.reverse().forEach(function(obj){ - ret += "" + obj.datetime + "" + obj.message + "" + ret += "" + obj.datetime + "" + obj.message + "" }) return "" + ret + "
" }) diff --git a/templates/device.html b/templates/device.html index 2eb224f..0c8783e 100644 --- a/templates/device.html +++ b/templates/device.html @@ -1,22 +1,22 @@

机器状态

- + - + - + - + diff --git a/templates/head.html b/templates/head.html index c84b086..c9f310b 100644 --- a/templates/head.html +++ b/templates/head.html @@ -4,4 +4,10 @@ td{ border: solid 1px lightgray; } + .title{ + width: 6em; + } + .time{ + width: 10em; + } diff --git a/templates/index.html b/templates/index.html index 57aede3..0c350ad 100644 --- a/templates/index.html +++ b/templates/index.html @@ -49,23 +49,23 @@

当前状态

CPU使用率CPU使用率 %
内存使用率内存使用率 /(%)
磁盘使用率磁盘使用率 /(%)
网络速率网络速率 /s /s
- + - + - + - + - +
下载日志下载日志
转码日志
队列
转码日志
队列
上传日志
队列
上传日志
队列
错误日志错误日志
操作日志操作日志