summaryrefslogtreecommitdiffstats
path: root/app/status-html.lsp
blob: 6846dea3ab7bbf7e4952e48410f48902be168b2c (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
<% local data, viewlibrary, page_info, session = ... 
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>

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

<%
htmlviewfunctions.displayheader(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, 0, page_info)	-- 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, 0, page_info)	-- header_level 0 means display inline without header
end %>

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