diff --git a/class/core/files_api.py b/class/core/files_api.py
index 020f3bc3e..11ae5b62a 100755
--- a/class/core/files_api.py
+++ b/class/core/files_api.py
@@ -127,11 +127,11 @@ class files_api:
filename = request.form.get('filename', '').encode('utf-8')
isTask = public.getRootDir() + '/tmp/panelTask.pl'
- execstr = url + '|bt|' + path + '/' + filename
+ execstr = url + '|mw|' + path + '/' + filename
public.M('tasks').add('name,type,status,addtime,execstr',
('下载文件[' + filename + ']', 'download', '0', time.strftime('%Y-%m-%d %H:%M:%S'), execstr))
public.writeFile(isTask, 'True')
- self.setFileAccept(path + '/' + filename)
+ # self.setFileAccept(path + '/' + filename)
return public.returnJson(True, '已将下载任务添加到队列!')
def getRecycleBinApi(self):
diff --git a/class/core/plugins_api.py b/class/core/plugins_api.py
index 0484e13f5..5f24b0a2d 100755
--- a/class/core/plugins_api.py
+++ b/class/core/plugins_api.py
@@ -204,6 +204,8 @@ class plugins_api:
# 检查是否正在安装
def checkSetupTask(self, sName):
+ sName = ''
+ version = ''
if not self.__tasks:
self.__tasks = public.M('tasks').where(
"status!=?", ('1',)).field('status,name').select()
diff --git a/class/core/public.py b/class/core/public.py
index 9370c7b4c..230ff71a4 100755
--- a/class/core/public.py
+++ b/class/core/public.py
@@ -410,11 +410,12 @@ def writeSpeed(title, used, total, speed=0):
def getSpeed():
# 取进度
- data = readFile('/tmp/panelSpeed.pl')
+ path = public.getRootDir()
+ data = readFile(path + '/tmp/panelSpeed.pl')
if not data:
data = json.dumps({'title': None, 'progress': 0,
'total': 0, 'used': 0, 'speed': 0})
- writeFile('/tmp/panelSpeed.pl', data)
+ writeFile(path + '/tmp/panelSpeed.pl', data)
return json.loads(data)
diff --git a/class/core/task_api.py b/class/core/task_api.py
index e742a8523..0204aa015 100755
--- a/class/core/task_api.py
+++ b/class/core/task_api.py
@@ -70,15 +70,15 @@ class task_api:
try:
tmp = public.readFile(tempFile)
if len(tmp) < 10:
- return public.returnMsg(False, '当前没有任务队列在执行-3!')
+ return public.returnJson(False, '当前没有任务队列在执行-3!')
echoMsg['msg'] = json.loads(tmp)
echoMsg['isDownload'] = True
except:
- db.Sql().table('tasks').where(
+ public.M('tasks').where(
"id=?", (find['id'],)).save('status', ('0',))
- return public.returnMsg(False, '当前没有任务队列在执行-4!')
+ return public.returnJson(False, '当前没有任务队列在执行-4!')
else:
- echoMsg['msg'] = public.getLastLine(tempFile, 20)
+ echoMsg['msg'] = public.getLastLine(tempFile, 10)
echoMsg['isDownload'] = False
echoMsg['task'] = public.M('tasks').where("status!=?", ('1',)).field(
diff --git a/cli.sh b/cli.sh
index 0632ce220..c51f090bb 100755
--- a/cli.sh
+++ b/cli.sh
@@ -10,9 +10,8 @@ mw_start(){
mw_start_debug(){
- # gunicorn -c setting.py app:app
+
python task.py &
- # gunicorn -b :7200 app:app
gunicorn -b :7200 -k gevent -w 1 app:app
# gunicorn -b :7200 -k eventlet -w 1 app:app
# gunicorn -c setting.py app:app
diff --git a/route/static/app/public.js b/route/static/app/public.js
index 68ca0ff39..e9b6a4cfe 100755
--- a/route/static/app/public.js
+++ b/route/static/app/public.js
@@ -1062,15 +1062,15 @@ function getReloads() {
c += f[e] + "
"
}
if(h.task[g].name.indexOf("扫描") != -1) {
- b = "