From 085447b711461ca06600218395dcf6b0dd480ad9 Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 18:00:01 -0400 Subject: [PATCH 01/12] makefile cleanup --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 843fcd9..be0bc71 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,15 @@ # include $(TOPDIR)/rules.mk +PKG_VERSION=2.0.1 +PKG_RELEASE:=0 LUCI_TITLE:=Task library LUCI_DEPENDS:=+luci-lib-xterm +taskd LUCI_EXTRA_DEPENDS:=taskd (>=1.0.3-1) LUCI_PKGARCH:=all -PKG_MAINTAINER:=jjm2473 +PKG_MAINTAINER:=jason include $(TOPDIR)/feeds/luci/luci.mk -- 2.38.4 From fcfe1a5368e2d65e509be4cbb9eb739da5113a73 Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 18:50:45 -0400 Subject: [PATCH 02/12] increment version --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index be0bc71..492689d 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,11 @@ # -# Copyright (C) 2022 jjm2473 +# Copyright (C) 2022 jason # # This is free software, licensed under the MIT License. # include $(TOPDIR)/rules.mk -PKG_VERSION=2.0.1 +PKG_VERSION=2.0.2 PKG_RELEASE:=0 LUCI_TITLE:=Task library -- 2.38.4 From e6be66c02ab607b770233ef163e77d9c459635d4 Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 19:16:29 -0400 Subject: [PATCH 03/12] container polling logic cleanup --- luasrc/view/tasks/docker.htm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/luasrc/view/tasks/docker.htm b/luasrc/view/tasks/docker.htm index 66ce0e6..c40ca35 100644 --- a/luasrc/view/tasks/docker.htm +++ b/luasrc/view/tasks/docker.htm @@ -17,8 +17,8 @@ if not task_running then <% local util = require "luci.util" local container_status = util.trim(util.exec(self.script_path.." status")) - local container_install = (string.len(container_status) > 0) - local container_running = container_status == "running" + local container_install = not string.match(container_status, " is not installed$") + local container_running = string.match(string.lower(container_status), "^up .* (seconds|minutes|hours)") if container_install then -%> -- 2.38.4 From eae34d3de409726d56613b8aa465f8ed782f6b2e Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 22:30:22 -0400 Subject: [PATCH 04/12] versioning --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 492689d..c3b5f67 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_VERSION=2.0.2 -PKG_RELEASE:=0 +PKG_RELEASE:=1 LUCI_TITLE:=Task library LUCI_DEPENDS:=+luci-lib-xterm +taskd -- 2.38.4 From 426b5bcc71facc93a4dab668defad766a82cb7eb Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 22:41:12 -0400 Subject: [PATCH 05/12] troubleshooting taskd docker control buttons --- luasrc/view/tasks/docker.htm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luasrc/view/tasks/docker.htm b/luasrc/view/tasks/docker.htm index c40ca35..454bf21 100644 --- a/luasrc/view/tasks/docker.htm +++ b/luasrc/view/tasks/docker.htm @@ -17,7 +17,8 @@ if not task_running then <% local util = require "luci.util" local container_status = util.trim(util.exec(self.script_path.." status")) - local container_install = not string.match(container_status, " is not installed$") + local container_status_lower = string.lower(util.trim(util.exec(self.script_path.." status"))) + local container_install = not string.match(container_status_lower, " is not installed$") local container_running = string.match(string.lower(container_status), "^up .* (seconds|minutes|hours)") if container_install then -%> -- 2.38.4 From a3a791f5248f6a056d93cc719140c59885987a06 Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 22:44:06 -0400 Subject: [PATCH 06/12] update pkg release --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c3b5f67..88d7c6a 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_VERSION=2.0.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 LUCI_TITLE:=Task library LUCI_DEPENDS:=+luci-lib-xterm +taskd -- 2.38.4 From edb8e9a645f7184ce05afccbd86f8dc77b65e45f Mon Sep 17 00:00:00 2001 From: riley Date: Tue, 12 Sep 2023 22:45:36 -0400 Subject: [PATCH 07/12] update version --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 88d7c6a..b1fd6ee 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,7 @@ # include $(TOPDIR)/rules.mk -PKG_VERSION=2.0.2 -PKG_RELEASE:=2 +PKG_VERSION=2.0.2.001 LUCI_TITLE:=Task library LUCI_DEPENDS:=+luci-lib-xterm +taskd -- 2.38.4 From 360b0eb483232d4a3636a04d75ee9f178928116f Mon Sep 17 00:00:00 2001 From: riley Date: Wed, 13 Sep 2023 13:13:40 -0400 Subject: [PATCH 08/12] Major reformat of docker.htm for readability --- luasrc/view/tasks/docker.htm | 101 ++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 44 deletions(-) diff --git a/luasrc/view/tasks/docker.htm b/luasrc/view/tasks/docker.htm index 454bf21..b412f33 100644 --- a/luasrc/view/tasks/docker.htm +++ b/luasrc/view/tasks/docker.htm @@ -1,57 +1,70 @@ +<% +local taskd = require "luci.model.tasks" +local status = taskd.status(self.task_id) + +-- Check if a task is running +local task_running = status.running -<% if self.task_start_failed then %> -
<%:Another task running, try again later.%> <%:Click here to check running task%>
+-- Check for a task start failure +if self.task_start_failed then +%> +
+ <%:Another task running, try again later.%> + + <%:Click here to check running task%> + +
<% end %> <%+cbi/map%> -<% -local task_running = false -local taskd = require "luci.model.tasks" -local status = taskd.status(self.task_id) -task_running = status.running --%> +
<% -if not task_running then -%> - <% - local util = require "luci.util" - local container_status = util.trim(util.exec(self.script_path.." status")) - local container_status_lower = string.lower(util.trim(util.exec(self.script_path.." status"))) - local container_install = not string.match(container_status_lower, " is not installed$") + if not task_running then + local util = require "luci.util" + + local container_status = util.trim(util.exec(self.script_path.." status")) + local container_status_lower = string.lower(container_status) + + local container_install = not string.match(container_status_lower, " is not installed$") local container_running = string.match(string.lower(container_status), "^up .* (seconds|minutes|hours)") - if container_install then - -%> - - <% - if container_running then - -%> - - - - <% else %> - - - - <% end - else %> - - <% end -else - %> - + + if container_install then +%> + <% -end + if container_running then +%> + + +<% + else +%> + + +<% + end + else +%> + +<% + end + else +%> + +<% + end %>
<%+tasks/embed%> -<% -if self.auto_show_task and task_running then --%> - -<% -end + +<% +if self.auto_show_task and task_running then +%> + +<% +end %> -- 2.38.4 From 06d7012394e26632e80ac72fe78c9d339ed85239 Mon Sep 17 00:00:00 2001 From: riley Date: Wed, 13 Sep 2023 13:14:01 -0400 Subject: [PATCH 09/12] Adjusted status polling logic --- luasrc/view/tasks/docker.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luasrc/view/tasks/docker.htm b/luasrc/view/tasks/docker.htm index b412f33..f8f5ddd 100644 --- a/luasrc/view/tasks/docker.htm +++ b/luasrc/view/tasks/docker.htm @@ -27,7 +27,7 @@ if self.task_start_failed then local container_status_lower = string.lower(container_status) local container_install = not string.match(container_status_lower, " is not installed$") - local container_running = string.match(string.lower(container_status), "^up .* (seconds|minutes|hours)") + local container_running = string.match(container_status_lower, "^up%W") if container_install then %> -- 2.38.4 From 8e421f5d55d8f82eb3960e120175fd69ea398cd8 Mon Sep 17 00:00:00 2001 From: riley Date: Wed, 13 Sep 2023 16:23:01 -0400 Subject: [PATCH 10/12] Docker remove confirm button --- luasrc/view/tasks/docker.htm | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/luasrc/view/tasks/docker.htm b/luasrc/view/tasks/docker.htm index f8f5ddd..bdd5b96 100644 --- a/luasrc/view/tasks/docker.htm +++ b/luasrc/view/tasks/docker.htm @@ -18,6 +18,12 @@ if self.task_start_failed then <%+cbi/map%> + +
<% if not task_running then @@ -41,7 +47,7 @@ if self.task_start_failed then else %> - + <% end else @@ -57,6 +63,21 @@ if self.task_start_failed then %>
+ + <%+tasks/embed%> <% -- 2.38.4 From 8143445753eb01267dc5a3c7babee93c20eeb218 Mon Sep 17 00:00:00 2001 From: riley Date: Wed, 13 Sep 2023 17:40:15 -0400 Subject: [PATCH 11/12] confirm popup styling --- luasrc/view/tasks/docker.htm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/luasrc/view/tasks/docker.htm b/luasrc/view/tasks/docker.htm index bdd5b96..da03385 100644 --- a/luasrc/view/tasks/docker.htm +++ b/luasrc/view/tasks/docker.htm @@ -18,12 +18,12 @@ if self.task_start_failed then <%+cbi/map%> -