|
|
@@ -107,45 +107,44 @@ ${ commonheader(_('Job Attempt: %(attempt_index)s') % {'attempt_index': attempt_
|
|
|
// From 15s to less than 5s display time with async
|
|
|
|
|
|
refreshLogs();
|
|
|
- var logsRefreshInterval = window.setInterval(function () {
|
|
|
- refreshLogs();
|
|
|
- }, 5000);
|
|
|
-
|
|
|
- $(document).on("stopLogsRefresh", function () {
|
|
|
- window.clearInterval(logsRefreshInterval);
|
|
|
- });
|
|
|
|
|
|
initLogsElement($("#syslog-container"));
|
|
|
initLogsElement($("#stdout-container"));
|
|
|
initLogsElement($("#stderr-container"));
|
|
|
|
|
|
- function refreshLogs() {
|
|
|
+ function refreshSyslogs() {
|
|
|
$.getJSON("${ url("jobbrowser.views.job_attempt_logs_json", job=job.jobId, attempt_index=attempt_index, name='syslog', offset=0) }", function (data) {
|
|
|
if (data && data.log) {
|
|
|
appendAndScroll($("#syslog-container"), data.log);
|
|
|
- }
|
|
|
- else {
|
|
|
- $(document).trigger("stopLogsRefresh");
|
|
|
+ window.setTimeout(refreshSyslogs, 5000);
|
|
|
}
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+ function refreshStdout() {
|
|
|
$.getJSON("${ url("jobbrowser.views.job_attempt_logs_json", job=job.jobId, attempt_index=attempt_index, name='stdout', offset=0) }", function (data) {
|
|
|
if (data && data.log) {
|
|
|
appendAndScroll($("#stdout-container"), data.log);
|
|
|
- }
|
|
|
- else {
|
|
|
- $(document).trigger("stopLogsRefresh");
|
|
|
+ window.setTimeout(refreshStdout, 5000);
|
|
|
}
|
|
|
});
|
|
|
+ }
|
|
|
+
|
|
|
+ function refreshStderr() {
|
|
|
$.getJSON("${ url("jobbrowser.views.job_attempt_logs_json", job=job.jobId, attempt_index=attempt_index, name='stderr', offset=0) }", function (data) {
|
|
|
if (data && data.log) {
|
|
|
appendAndScroll($("#stderr-container"), data.log);
|
|
|
- }
|
|
|
- else {
|
|
|
- $(document).trigger("stopLogsRefresh");
|
|
|
+ window.setTimeout(refreshStderr, 5000);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function refreshLogs() {
|
|
|
+ refreshSyslogs();
|
|
|
+ refreshStdout();
|
|
|
+ refreshStderr();
|
|
|
+ }
|
|
|
+
|
|
|
$(document).on("resized", function () {
|
|
|
resizeLogs($("#syslog-container"));
|
|
|
resizeLogs($("#stdout-container"));
|