weblog-status-html.lsp 1.13 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
<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Weblog Database Status"}), page_info) %>
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 17 18
<%
local statuscfe = cfe({ label="Database status" })
if status then
	statuscfe.value = status.value.status.errtxt or status.value.status.value
19
else
20 21 22 23 24 25 26 27 28 29 30 31 32 33
	statuscfe.value = "Unknown"
end
htmlviewfunctions.displayitem(statuscfe)
%>

<%
local databasecfe = cfe({ label="Weblog Database" })
if data.value then
	databasecfe.value = "Present"
else
	databasecfe.value = "Missing"
end
htmlviewfunctions.displayitem(databasecfe)
%>
Ted Trask's avatar
Ted Trask committed
34

35
<% htmlviewfunctions.displaysectionend(header_level) %>
36 37 38 39

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