diff --git a/web/static/app/public.js b/web/static/app/public.js index 9d6b6675c..64bb24d41 100755 --- a/web/static/app/public.js +++ b/web/static/app/public.js @@ -1410,8 +1410,9 @@ function getReloads() { return } if(speed) {return;} - speed = setInterval(function() { - var mm = $(".bt-w-menu .bgw").html() + + function renderRunTask(){ + var mm = $(".bt-w-menu .bgw").html(); if(mm == undefined || mm.indexOf(lan.bt.task_list) == -1) { clearInterval(speed); speed = null; @@ -1421,6 +1422,7 @@ function getReloads() { a++; $.post('/task/get_task_speed', '', function(h) { if(h.task == undefined) { + $(".task_count").text(0); $(".cmdlist").html('当前没有任务!'); return; } @@ -1470,7 +1472,12 @@ function getReloads() { return; } },'json').error(function(){}); - }, 3000); + } + + renderRunTask(); + speed = setInterval(function() { + renderRunTask(); + }, 2000); } //检查选中项 @@ -1496,42 +1503,9 @@ function tasklist(a){ $(".taskcon").html(con); a = a == undefined ? 1 : a; $.post("/task/list", "tojs=getTaskList&table=tasks&limit=10&p=" + a, function(g) { - var e = ""; - var b = ""; - var c = ""; - var f = false; - for(var d = 0; d < g.data.length; d++) { - switch(g.data[d].status) { - case "-1": - f = true; - if(g.data[d].type != "download") { - b = "