diff --git a/luci-lib-taskd/Makefile b/luci-lib-taskd/Makefile index cc660a76..0e05f2b4 100644 --- a/luci-lib-taskd/Makefile +++ b/luci-lib-taskd/Makefile @@ -11,7 +11,7 @@ LUCI_DEPENDS:=+luci-lib-xterm +taskd LUCI_EXTRA_DEPENDS:=taskd (>=1.0.3-1) LUCI_PKGARCH:=all -PKG_VERSION:=1.0.22 +PKG_VERSION:=1.0.23 PKG_RELEASE:= PKG_MAINTAINER:=jjm2473 diff --git a/luci-lib-taskd/htdocs/luci-static/resources/tasks/tasks.js b/luci-lib-taskd/htdocs/luci-static/resources/tasks/tasks.js index 086f7533..9a5b7957 100644 --- a/luci-lib-taskd/htdocs/luci-static/resources/tasks/tasks.js +++ b/luci-lib-taskd/htdocs/luci-static/resources/tasks/tasks.js @@ -104,6 +104,9 @@ return false; }; const checkTask = function() { + if (!showing) { + return Promise.resolve(false); + } return getTaskDetail(task_id).then(data=>{ if (!running) { return false; @@ -163,16 +166,18 @@ } }).catch(err => { if (showing) { - if (err.target.status == 0 || err.target.status == 502) { - title_view.innerText = task_id + ' (' + $gettext("Fetch log failed, retrying...") + ')'; - setTimeout(()=>pulllog(true), 1000); - } else if (err.target.status == 403 || err.target.status == 404) { - title_view.innerText = task_id + ' (' + $gettext(err.target.status == 403?"Lost login status":"Task does not exist or has been deleted") + ')'; - container.querySelector(".dialog-icon-close").hidden = true; - container.classList.add('tasks_unknown'); - } else { - console.error(err); + console.error(err); + if (err.target) { + if (err.target.status == 0 || err.target.status == 502) { + title_view.innerText = task_id + ' (' + $gettext("Fetch log failed, retrying...") + ')'; + } else if (err.target.status == 403 || err.target.status == 404) { + title_view.innerText = task_id + ' (' + $gettext(err.target.status == 403?"Lost login status":"Task does not exist or has been deleted") + ')'; + container.querySelector(".dialog-icon-close").hidden = true; + container.classList.add('tasks_unknown'); + return + } } + setTimeout(()=>pulllog(true), 1000); } }); };