weblog-status-html.lsp 1.03 KB
Newer Older
Ted Trask's avatar
Ted Trask committed
1
<% local data, viewlibrary, page_info, session = ... 
2
htmlviewfunctions = require("htmlviewfunctions")
Ted Trask's avatar
Ted Trask committed
3 4
%>

5
<% htmlviewfunctions.displaycommandresults({"createdatabase"}, session, true) %>
Ted Trask's avatar
Ted Trask committed
6

7
<h1>Weblog Database Status</h1>
Ted Trask's avatar
Ted Trask committed
8 9
<% local status
if viewlibrary and viewlibrary.dispatch_component then
10
	if viewlibrary.check_permission("postgresql/postgresql/status") then
Ted Trask's avatar
Ted Trask committed
11 12
		status = viewlibrary.dispatch_component("postgresql/postgresql/status", nil, true)
	end
13 14
end %>

15 16
<div class='item'><p class='left'>Database status</p>
<div class='right'><p>
17
<% if status then %>
Ted Trask's avatar
Ted Trask committed
18 19 20 21 22
<% if status.value.status.errtxt then
	print(status.value.status.errtxt)
else
	print(status.value.status.value)
end %>
Ted Trask's avatar
Ted Trask committed
23
<% else %>
24
Unknown
Ted Trask's avatar
Ted Trask committed
25
<% end %>
26
</p></div></div><!-- end .item -->
Ted Trask's avatar
Ted Trask committed
27

28 29
<div class='item'><p class='left'>Weblog Database</p>
<div class='right'><p>
Ted Trask's avatar
Ted Trask committed
30
<% if data.value then %>
31
Present
Ted Trask's avatar
Ted Trask committed
32
<% else %>
33
Missing
Ted Trask's avatar
Ted Trask committed
34
<% end %>
35
</p></div></div><!-- end .item -->
36 37 38 39

<% if not data.value and viewlibrary and viewlibrary.dispatch_component then
	viewlibrary.dispatch_component("createdatabase")
end %>