From 6a10b1fbcaa38c81a11d3e58f596ac588f792ffa Mon Sep 17 00:00:00 2001 From: actions-user Date: Fri, 21 Jun 2024 20:10:00 +0800 Subject: [PATCH] update 2024-06-21 20:10:00 --- luci-lib-taskd/Makefile | 2 +- .../luci-static/resources/tasks/tasks.js | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/luci-lib-taskd/Makefile b/luci-lib-taskd/Makefile index 2fa94dcd..f33d094b 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.19 +PKG_VERSION:=1.0.20 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 14eefeea..fd2f32f7 100644 --- a/luci-lib-taskd/htdocs/luci-static/resources/tasks/tasks.js +++ b/luci-lib-taskd/htdocs/luci-static/resources/tasks/tasks.js @@ -24,7 +24,7 @@ if (oReq.status == 403) { alert($gettext("Lost login status")); location.href = location.href; - } else if (oReq.status == 404) { + } else if (oReq.status >= 400) { reject(oEvent); } else { resolve(oReq); @@ -155,7 +155,7 @@ } }).catch(err => { if (showing) { - if (err.target.status == 0) { + 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) { @@ -183,23 +183,23 @@ // compat if (typeof(window.findParent) !== 'function') { const elem = function(e) { - return (e != null && typeof(e) == 'object' && 'nodeType' in e); - }; + return (e != null && typeof(e) == 'object' && 'nodeType' in e); + }; const matches = function(node, selector) { - var m = elem(node) ? node.matches || node.msMatchesSelector : null; - return m ? m.call(node, selector) : false; - }; + var m = elem(node) ? node.matches || node.msMatchesSelector : null; + return m ? m.call(node, selector) : false; + }; window.findParent = function (node, selector) { - if (elem(node) && node.closest) - return node.closest(selector); + if (elem(node) && node.closest) + return node.closest(selector); - while (elem(node)) - if (matches(node, selector)) - return node; - else - node = node.parentNode; + while (elem(node)) + if (matches(node, selector)) + return node; + else + node = node.parentNode; - return null; + return null; }; } if (typeof(window.cbi_submit) !== 'function') {