summaryrefslogtreecommitdiffstats
path: root/tinydns-status-html.lsp
blob: f90b615b5005fea2467dd8bdb84e6965866107ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<% local data, viewlibrary, page_info, session = ...
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>

<% htmlviewfunctions.displaycommandresults({"install","edit"}, session) %>
<% htmlviewfunctions.displaycommandresults({"startstop"}, session) %>

<%
local header_level = htmlviewfunctions.displaysectionstart(data, page_info)
htmlviewfunctions.displayitem(data.value.status)

htmlviewfunctions.displayitem(data.value.version)
if data.value.version and data.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then
	local install = cfe({ type="form", value={}, label="Install package", option="Install", action=page_info.script.."/apk-tools/apk/install" })
	install.value.package = cfe({ type="hidden", value=data.value.version.name })
	htmlviewfunctions.displayitem(install, page_info, 0)	-- header_level 0 means display inline without header
end

htmlviewfunctions.displayitem(data.value.autostart)
if not (data.value.version and data.value.version.errtxt) and data.value.autostart and data.value.autostart.errtxt and viewlibrary.check_permission("alpine-baselayout/rc/edit") then
	local autostart = cfe({ type="link", value={}, label="Enable autostart", option="Enable", action=page_info.script.."/alpine-baselayout/rc/edit" })
	autostart.value.servicename = cfe({ type="hidden", value=data.value.autostart.name })
	autostart.value.redir = cfe({ type="hidden", value=page_info.orig_action })
	htmlviewfunctions.displayitem(autostart, page_info, 0)	-- header_level 0 means display inline without header
end

htmlviewfunctions.displayitem(data.value.configdir)
htmlviewfunctions.displayitem(data.value.listen)

htmlviewfunctions.displaysectionend(header_level)
%>

<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("startstop") then
	viewlibrary.dispatch_component("startstop")
end %>