From 760973a0b5ff746b3c4bec1fcc010c043943d83c Mon Sep 17 00:00:00 2001 From: Riley Date: Fri, 8 Sep 2023 14:51:36 -0400 Subject: [PATCH 1/3] Use string from shell script and fix button style --- luasrc/view/nodered/status.htm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/luasrc/view/nodered/status.htm b/luasrc/view/nodered/status.htm index 7085650..a31357f 100644 --- a/luasrc/view/nodered/status.htm +++ b/luasrc/view/nodered/status.htm @@ -2,20 +2,22 @@ local util = require "luci.util" local container_status = util.trim(util.exec("/usr/libexec/apps/nodered/nodered.sh status")) local container_install = (string.len(container_status) > 0) -local container_running = container_status == "running" +local container_running = string.find(string.lower(container_status), "up") and string.find(string.lower(container_status), "(healthy)") -%> +
- +
<% if container_running then %> - + <% else %> - + <% end %>
+ <% -if container_running then +if container_install then local port=util.trim(util.exec("/usr/libexec/apps/nodered/nodered.sh port")) if port == "" then port="1880" @@ -24,8 +26,7 @@ if container_running then
- - +
<% end %> From b34eaca01e160b076ef29b9462e9e132e31d1a1b Mon Sep 17 00:00:00 2001 From: Riley Date: Fri, 8 Sep 2023 15:03:50 -0400 Subject: [PATCH 2/3] Removed unused container_install var --- luasrc/view/nodered/status.htm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/luasrc/view/nodered/status.htm b/luasrc/view/nodered/status.htm index a31357f..e9ee343 100644 --- a/luasrc/view/nodered/status.htm +++ b/luasrc/view/nodered/status.htm @@ -1,7 +1,6 @@ <% local util = require "luci.util" local container_status = util.trim(util.exec("/usr/libexec/apps/nodered/nodered.sh status")) -local container_install = (string.len(container_status) > 0) local container_running = string.find(string.lower(container_status), "up") and string.find(string.lower(container_status), "(healthy)") -%> @@ -17,7 +16,7 @@ local container_running = string.find(string.lower(container_status), "up") and <% -if container_install then +if container_running then local port=util.trim(util.exec("/usr/libexec/apps/nodered/nodered.sh port")) if port == "" then port="1880" From 34a7a97fb479b21b10fd0aa239f406e25bfc8e2e Mon Sep 17 00:00:00 2001 From: Riley Date: Fri, 8 Sep 2023 15:09:22 -0400 Subject: [PATCH 3/3] Fixed syntax on line 28 --- luasrc/view/nodered/status.htm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luasrc/view/nodered/status.htm b/luasrc/view/nodered/status.htm index e9ee343..f6a8355 100644 --- a/luasrc/view/nodered/status.htm +++ b/luasrc/view/nodered/status.htm @@ -25,7 +25,7 @@ if container_running then
- +
<% end %>