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

<% htmlviewfunctions.displaycommandresults({"createdatabase"}, session, true) %>

<% local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Weblog Database Status"}), page_info) %>
<% local status
if viewlibrary and viewlibrary.dispatch_component then
	if viewlibrary.check_permission("postgresql/postgresql/status") then
		status = viewlibrary.dispatch_component("postgresql/postgresql/status", nil, true)
	end
end %>

<%
local statuscfe = cfe({ label="Database status" })
if status then
	statuscfe.value = status.value.status.errtxt or status.value.status.value
else
	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)
%>

<% htmlviewfunctions.displaysectionend(header_level) %>

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