|
|
@ -1,33 +1,66 @@ |
|
|
|
var num = 0; |
|
|
|
var num = 0; |
|
|
|
//查看任务日志
|
|
|
|
//查看任务日志
|
|
|
|
function getLogs(id){ |
|
|
|
function getLogs(id){ |
|
|
|
layer.msg('正在获取,请稍候...',{icon:16,time:0,shade: [0.3, '#000']}); |
|
|
|
|
|
|
|
var data='&id='+id; |
|
|
|
var reqTimer = null; |
|
|
|
$.post('/crontab/logs', data, function(rdata){ |
|
|
|
var reqCount = 0; |
|
|
|
layer.closeAll(); |
|
|
|
|
|
|
|
|
|
|
|
var tips = layer.msg('正在获取,请稍候...',{icon:16,time:0,shade: [0.3, '#000']}); |
|
|
|
|
|
|
|
var req_log_args = 'id='+id; |
|
|
|
|
|
|
|
function requestLogs(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$.post('/crontab/logs', req_log_args, function(rdata){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (reqCount == 0){ |
|
|
|
|
|
|
|
layer.close(tips); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!rdata.status) { |
|
|
|
if(!rdata.status) { |
|
|
|
layer.msg(rdata.msg,{icon:2, time:2000}); |
|
|
|
layer.msg(rdata.msg,{icon:2, time:2000}); |
|
|
|
|
|
|
|
clearInterval(reqTimer); |
|
|
|
return; |
|
|
|
return; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#crontab_log").html(rdata.msg); |
|
|
|
|
|
|
|
//滚动到最低
|
|
|
|
|
|
|
|
var ob = document.getElementById('crontab_log'); |
|
|
|
|
|
|
|
ob.scrollTop = ob.scrollHeight;
|
|
|
|
|
|
|
|
reqCount++; |
|
|
|
|
|
|
|
},'json'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
layer.open({ |
|
|
|
layer.open({ |
|
|
|
type:1, |
|
|
|
type:1, |
|
|
|
title:lan.crontab.task_log_title, |
|
|
|
title:"任务执行日志", |
|
|
|
area: ['60%','500px'],
|
|
|
|
area: ['60%','500px'],
|
|
|
|
shadeClose:false, |
|
|
|
shadeClose:false, |
|
|
|
|
|
|
|
btn:["关闭","清空"], |
|
|
|
closeBtn:1, |
|
|
|
closeBtn:1, |
|
|
|
content:'<div class="setchmod bt-form pd20 pb70">' |
|
|
|
end: function(){ |
|
|
|
+'<pre id="crontab-log" style="overflow: auto; border: 0px none; line-height:23px;padding: 15px; margin: 0px; white-space: pre-wrap; height: 405px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>' |
|
|
|
if (reqTimer){ |
|
|
|
+'<div class="bt-form-submit-btn" style="margin-top: 0px;">' |
|
|
|
clearInterval(reqTimer); |
|
|
|
+'<button type="button" class="btn btn-success btn-sm" onclick="closeLogs('+id+')">清空</button>' |
|
|
|
} |
|
|
|
+'<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>' |
|
|
|
}, |
|
|
|
+'</div>' |
|
|
|
content:'<div class="setchmod bt-form" style="padding:5px;">' |
|
|
|
+'</div>' |
|
|
|
+'<pre id="crontab_log" style="overflow: auto; border: 0px none; line-height:23px;padding: 5px; margin: 0px; white-space: pre-wrap; height: 395px; background-color: rgb(51,51,51);color:#f1f1f1;border-radius:0px;font-family:"></pre>' |
|
|
|
}); |
|
|
|
// +'<div class="bt-form-submit-btn" style="margin-top: 0px;">'
|
|
|
|
|
|
|
|
// +'<button type="button" class="btn btn-success btn-sm" onclick="closeLogs('+id+')">清空</button>'
|
|
|
|
|
|
|
|
// +'<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>'
|
|
|
|
|
|
|
|
// +'</div>'
|
|
|
|
|
|
|
|
+'</div>', |
|
|
|
|
|
|
|
success:function(){ |
|
|
|
|
|
|
|
requestLogs(); |
|
|
|
|
|
|
|
reqTimer = setInterval(function(){ |
|
|
|
|
|
|
|
requestLogs(); |
|
|
|
|
|
|
|
},3000); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setTimeout(function(){ |
|
|
|
yes:function(index){ |
|
|
|
$("#crontab-log").html(rdata.msg); |
|
|
|
closeLogs(id); |
|
|
|
},200); |
|
|
|
}, |
|
|
|
},'json'); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|