summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/expert-html.lsp3
-rw-r--r--lib/controllerfunctions.lua2
-rw-r--r--lib/modelfunctions.lua15
3 files changed, 10 insertions, 10 deletions
diff --git a/app/expert-html.lsp b/app/expert-html.lsp
index c4a76cd..3639f11 100644
--- a/app/expert-html.lsp
+++ b/app/expert-html.lsp
@@ -6,7 +6,8 @@
end ?>
<?
-local func = haserl.loadfile(page_info.viewfile:gsub(page_info.prefix..page_info.controller..".*$", "/") .. "filedetails-html.lsp")
+local pattern = string.gsub(page_info.prefix..page_info.controller, "[%(%)%.%%%+%-%*%?%[%]%^%$]", "%%%1")
+local func = haserl.loadfile(page_info.viewfile:gsub(pattern..".*$", "/") .. "filedetails-html.lsp")
func(form, viewlibrary, page_info, session)
?>
diff --git a/lib/controllerfunctions.lua b/lib/controllerfunctions.lua
index 53ef927..298eac6 100644
--- a/lib/controllerfunctions.lua
+++ b/lib/controllerfunctions.lua
@@ -47,7 +47,7 @@ function handle_startstop(self, startstopfunction, getstatusfunction, clientdata
result = self:redirect_to_referrer(result)
local status = getstatusfunction()
- status = status.value.status
+ if status.value.status then status = status.value.status end
return cfe({ type="group", value={status=status, result=result} })
end
diff --git a/lib/modelfunctions.lua b/lib/modelfunctions.lua
index 84c690b..0648f23 100644
--- a/lib/modelfunctions.lua
+++ b/lib/modelfunctions.lua
@@ -5,13 +5,15 @@ require("procps")
require("daemoncontrol")
require("processinfo")
-local function process_status_text(procname)
- local t = procps.pidof(procname)
+function getenabled(processname)
+ local result = cfe({ label = "Program status" })
+ local t = procps.pidof(processname)
if (t) and (#t > 0) then
- return "Enabled"
+ result.value = "Enabled"
else
- return "Disabled"
+ result.value = "Disabled"
end
+ return result
end
function startstop_service(processname, action)
@@ -30,10 +32,7 @@ function getstatus(processname, packagename, label)
errtxt=errtxt,
})
- status.status = cfe({
- label="Program status",
- value=process_status_text(processname),
- })
+ status.status = getenabled(processname)
local autostart_sequence, autostart_errtxt = processinfo.process_botsequence(processname)
status.autostart = cfe({