summaryrefslogtreecommitdiffstats
path: root/acfupdate-html.lsp
blob: aa5683e40a6f6d40c4d169b2cdef2efe079154dd (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<% local data, viewlibrary, page_info, session = ... 
require("viewfunctions")
%>

<% displaycommandresults({"install", "log"}, session) %>

<%
	local cmdresult = {}
	for i,cmd in ipairs({"status", "update", "diff"}) do
		if session[cmd.."result"] then
			cmdresult[#cmdresult + 1] = session[cmd.."result"]
			session[cmd.."result"] = nil
		end
	end
	if #cmdresult > 0 then
		for i,result in ipairs(cmdresult) do
			io.write("<H1>"..html.html_escape(result.label).."</H1>\n<DL>\n")
			for i,value in ipairs(result.value) do
				if value.updates ~= "" then %>
<H3><%= html.html_escape(value.name) %></H3>
<pre><%= html.html_escape(value.updates) %></pre>
				<% end
			end
			io.write("</DL>\n")
		end
	end
%>

<H1>System Info</H1>
<DL>
<%
displayitem(data.value.version)
if data.value.version and data.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=<%= html.html_escape(data.value.version.name) %>&redir=<%= html.html_escape(page_info.orig_action) %>">Install</a>
<%
end
displayitem(data.value.repository)
%>
</DL>

<% if not data.value.repository.errtxt then %>
<H1>Actions</H1>
<DL>
<DT>View Status</DT> 
<DD>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/status") %>" method="POST">
<input type=hidden value="<%= html.html_escape(data.value.repository.value) %>" name="repository">
<input type=submit class=submit value="View Status">
</form>
</DD>
<% if session.permissions.acfupdate.diff then %>
<DT>View Diff</DT> 
<DD>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/diff") %>" method="POST">
<input type=hidden value="<%= html.html_escape(data.value.repository.value) %>" name="repository">
<input type=submit class=submit value="View Diff">
</form>
</DD>
<% end %>
<DT>View Log</DT>
<DD>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/log") %>" method="POST">
<input type=hidden value="<%= html.html_escape(data.value.repository.value) %>" name="repository">
<input type=submit class=submit value="View Log">
</form>
</DD>
<% if session.permissions.acfupdate.update then %>
<DT>Update</DT> 
<DD>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/update") %>" method="POST">
<input type=hidden value="<%= html.html_escape(data.value.repository.value) %>" name="repository">
<input type=submit class=submit value="Update">
</form>
</DD>
<% end %>
</DL>
<% end %>