From 0ed315dc3cf0d6244d656e2d68fe577797c2e5f0 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 10 Apr 2014 05:40:47 +0000 Subject: Changes to use new htmlviewfunctions functions --- chrony-config-html.lsp | 2 +- chrony-details-html.lsp | 10 +++++++--- chrony-keyfile-html.lsp | 13 ++++--------- chrony-model.lua | 2 +- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/chrony-config-html.lsp b/chrony-config-html.lsp index 68f2d4a..2fdd23b 100644 --- a/chrony-config-html.lsp +++ b/chrony-config-html.lsp @@ -6,4 +6,4 @@ htmlviewfunctions = require("htmlviewfunctions") viewlibrary.dispatch_component("status") end %> -<% htmlviewfunctions.displayitem(form, 1, page_info) %> +<% htmlviewfunctions.displayitem(form, page_info) %> diff --git a/chrony-details-html.lsp b/chrony-details-html.lsp index 6db3274..47d4997 100644 --- a/chrony-details-html.lsp +++ b/chrony-details-html.lsp @@ -5,10 +5,14 @@ html = require("acf.html") <% viewlibrary.dispatch_component("status") %> -

<%= html.html_escape(data.label) %>

+<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %> +<% local header_level2 = htmlviewfunctions.incrementheader(header_level) %> <% htmlviewfunctions.displayitem(data.value.time) %> <% htmlviewfunctions.displayitem(data.value.tracking) %> -

Sources

+<% htmlviewfunctions.displaysectionstart(data.value.sources, page_info, header_level2) %>
<%= html.html_escape(data.value.sources.value) %>
-

Source Stats

+<% htmlviewfunctions.displaysectionend(header_level2) %> +<% htmlviewfunctions.displaysectionstart(data.value.sourcestats, page_info, header_level2) %>
<%= html.html_escape(data.value.sourcestats.value) %>
+<% htmlviewfunctions.displaysectionend(header_level2) %> +<% htmlviewfunctions.displaysectionend(header_level) %> diff --git a/chrony-keyfile-html.lsp b/chrony-keyfile-html.lsp index 644483b..8ae41fc 100644 --- a/chrony-keyfile-html.lsp +++ b/chrony-keyfile-html.lsp @@ -4,18 +4,13 @@ <% htmlviewfunctions.displaycommandresults({"enablekeyfile"}, session) %> -

Key File Status

<% + local header_level = htmlviewfunctions.displaysectionstart(form.value.status, page_info) htmlviewfunctions.displayitem(form.value.status) if form.value.status.errtxt then - -%> -

-
"> - -
-
-<% end + htmlviewfunctions.displayitem(cfe({type="form", value={redir=cfe({ type="hidden", value=page_info.orig_action })}, label="", option="Enable", action="enablekeyfile" }), page_info, 0) + end + htmlviewfunctions.displaysectionend(header_level) %> <% diff --git a/chrony-model.lua b/chrony-model.lua index a1b937f..8661e20 100644 --- a/chrony-model.lua +++ b/chrony-model.lua @@ -53,7 +53,7 @@ local function get_keyfilestatus(filedetails) filedetails.value.filecontent.descr = "List of password numbers and passwords (ie. '10 cronpass')" -- check to see if the file is being used - filedetails.value.status = cfe({ value="Key file in use", label="Key file status" }) + filedetails.value.status = cfe({ value="Key file in use", label="Key File Status" }) local config = mymodule.get_config() if config.value.keyfile.value ~= keyfile then filedetails.value.status.value = "" -- cgit v1.2.3