diff --git a/class/core/mw.py b/class/core/mw.py index 351a2c916d..89cb4a3e2f 100755 --- a/class/core/mw.py +++ b/class/core/mw.py @@ -1305,7 +1305,10 @@ def getClientIp(): def checkDomainPanel(): tmp = getHost() domain = readFile('data/bind_domain.pl') - port = readFile('data/port.pl').strip() + + port = 7200 + if os.path.exists('data/port.pl'): + port = readFile('data/port.pl').strip() scheme = 'http' diff --git a/route/static/app/public.js b/route/static/app/public.js index b73fe3d810..56fb178910 100755 --- a/route/static/app/public.js +++ b/route/static/app/public.js @@ -1351,58 +1351,57 @@ function execLog(){ * @param {String} dateFormat 返回的日期格式,默认为'H:i:s' */ function getSFM(seconds, dateFormat = 'H:i:s') { - var obj = {}; - obj.H = Number.parseInt(seconds / 3600); - obj.i = Number.parseInt((seconds - obj.H * 3600) / 60); - obj.s = Number.parseInt(seconds - obj.H * 3600 - obj.i * 60); - if (obj.H < 10) { - obj.H = '0' + obj.H; - } - if (obj.i < 10) { - obj.i = '0' + obj.i; - } - if (obj.s < 10) { - obj.s = '0' + obj.s; - } + + var obj = {}; + obj.H = Number.parseInt(seconds / 3600); + obj.i = Number.parseInt((seconds - obj.H * 3600) / 60); + obj.s = Number.parseInt(seconds - obj.H * 3600 - obj.i * 60); + if (obj.H < 10) { + obj.H = '0' + obj.H; + } + if (obj.i < 10) { + obj.i = '0' + obj.i; + } + if (obj.s < 10) { + obj.s = '0' + obj.s; + } - // 3.解析 - var rs = dateFormat.replace('H', obj.H).replace('i', obj.i).replace('s', obj.s); - return rs; + // 3.解析 + var rs = dateFormat.replace('H', obj.H).replace('i', obj.i).replace('s', obj.s); + return rs; } function remind(a){ a = a == undefined ? 1 : a; $.post("/task/list", "table=tasks&result=2,4,6,8&limit=10&p=" + a, function(g) { - // console.log(g); - var e = ""; + var e = ''; var f = false; var task_count = 0; for(var d = 0; d < g.data.length; d++) { - if(g.data[d].status != '1'){ - task_count++; - e += '\ - \ - \ -
\ - '+g.data[d].name+'\ - 【'+lan.bt.task_the+'】\ - 耗时['+ getSFM(g.data[d].end - g.data[d].start) +']\ -
\ - \ - '+g.data[d].addtime+'\ - '; - } else{ - e += '\ - \ - \ -
'+g.data[d].name+'\ - 【'+lan.bt.task_ok+'】\ - 安装等待中...\ -
\ - \ - '+g.data[d].addtime+'\ - '; + var status = g.data[d].status; + var status_text = '已经完成'; + var cos_text = ''; + if (status == '1'){ + status_text = '完成'; + cos_text = '耗时['+getSFM(g.data[d].end - g.data[d].start)+']' + } else if (status == '0'){ + status_text = '正在处理'; + cos_text = '等待中..'; + } else if (status == '-1'){ + status_text = '安装中'; + cos_text = '..'; } + + e += '\ + \ + \ +
'+g.data[d].name+'\ + 【'+status_text+'】\ + '+cos_text+'\ +
\ + \ + '+g.data[d].addtime+'\ + '; } var con = '
\ \ @@ -1412,15 +1411,16 @@ function remind(a){ \ \ '+e+'\ -
\ -
\ - \ -
\ -
'; + \ + \ +
\ + \ +
\ +
'; $(".task_count").text(task_count); $(".msg_count").text(g.count); @@ -1429,9 +1429,9 @@ function remind(a){ $("#Rs-checkAll").click(function(){ if($(this).prop("checked")){ - $("#remind").find("input").prop("checked",true) + $("#remind").find("input").prop("checked",true); } else { - $("#remind").find("input").prop("checked",false) + $("#remind").find("input").prop("checked",false); } }); },'json'); diff --git a/task.py b/task.py index 42546897af..71691f0887 100755 --- a/task.py +++ b/task.py @@ -77,7 +77,7 @@ def openresty_cmd(method = 'reload'): return True sys_initd = '/etc/init.d/openresty' - if os.path.exists(install_initd): + if os.path.exists(sys_initd): os.system(sys_initd + ' ' + method) return True