diff options
-rw-r--r-- | tcpproxy-model.lua | 8 | ||||
-rw-r--r-- | tcpproxy-smtpstatus-html.lsp | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/tcpproxy-model.lua b/tcpproxy-model.lua index f361799..682f117 100644 --- a/tcpproxy-model.lua +++ b/tcpproxy-model.lua @@ -206,8 +206,8 @@ end function getsmtpstatus() local value, errtxt = processinfo.package_version(smtppackagename) - local version = cfe({ value=value, label="Program version", errtxt=errtxt }) - return cfe({ type="group", value={version=version, entries=entries}, label="SMTP Proxy Status" }) + local version = cfe({ value=value, label="Program version", errtxt=errtxt, name=smtppackagename }) + return cfe({ type="group", value={version=version}, label="SMTP Proxy Status" }) end function listsmtpentries(self) @@ -335,7 +335,7 @@ end function listsmtpfiles() local retval = cfe({ type="list", value={}, label="SMTP Proxy Files" }) - if not fs.is_dir(smtpdirectory) then posix.mkdir(smtpdirectory) end + if not fs.is_dir(smtpdirectory) then fs.create_directory(smtpdirectory) end for file in posix.files(smtpdirectory) do if fs.is_file(smtpdirectory .. file) then table.insert(retval.value, smtpdirectory .. file) @@ -356,7 +356,7 @@ function createsmtpfile(filedetails) success = false filedetails.value.filename.errtxt = "Invalid filename" else - if not fs.is_dir(smtpdirectory) then posix.mkdir(smtpdirectory) end + if not fs.is_dir(smtpdirectory) then fs.create_directory(smtpdirectory) end if posix.stat(filedetails.value.filename.value) then success = false filedetails.value.filename.errtxt = "Filename already exists" diff --git a/tcpproxy-smtpstatus-html.lsp b/tcpproxy-smtpstatus-html.lsp index 3a46b19..0e3384f 100644 --- a/tcpproxy-smtpstatus-html.lsp +++ b/tcpproxy-smtpstatus-html.lsp @@ -7,7 +7,11 @@ require("viewfunctions") <H1>SMTP Proxy Status</H1> <DL> -<% displayitem(view.value.version) %> +<% displayitem(view.value.version) +if view.value.version and view.value.version.errtxt and session.permissions.apk and session.permissions.apk.install then +%> + <a href="<%= html.html_escape(page_info.script .. "/apk-tools/apk/install?package="..view.value.version.name) %>">Install</a> +<% end %> </DL> <% if viewlibrary and viewlibrary.dispatch_component then |