From f9780f645bc94f2f79fc4e266e671d15232d4b9d Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Tue, 4 Mar 2014 02:41:32 +0000 Subject: Change HTML views to use htmlviewfunctions.displayheader Modified some models to change labels --- alpine-baselayout.roles | 4 ++-- cron-listjobs-html.lsp | 7 +++++-- health-model.lua | 10 +++++----- health-network-html.lsp | 14 +++++++++----- health-networkstats-html.lsp | 7 ++++--- health-proc-html.lsp | 12 ++++++++---- health-storage-html.lsp | 16 ++++++++++------ health-system-html.lsp | 16 ++++++++++------ hostname-read-html.lsp | 5 ++--- interfaces-model.lua | 4 ++-- interfaces-read-html.lsp | 11 ++++------- interfaces-status-html.lsp | 4 ++-- interfaces-update-html.lsp | 6 ++++-- logfiles-model.lua | 4 ++-- logfiles-status-html.lsp | 2 +- logfiles-tail-html.lsp | 4 ++-- logfiles-view-html.lsp | 36 +----------------------------------- modules-edit-html.lsp | 40 +--------------------------------------- modules-expert-html.lsp | 12 ++++++++++++ modules-status-html.lsp | 10 ++++++---- modules.menu | 2 +- rc-status-html.lsp | 2 +- syslog-config-html.lsp | 28 ++++++++++++++-------------- syslog-loginfo-html.lsp | 8 ++------ syslog-model.lua | 2 +- 25 files changed, 111 insertions(+), 155 deletions(-) mode change 100644 => 120000 logfiles-view-html.lsp mode change 100644 => 120000 modules-edit-html.lsp create mode 100644 modules-expert-html.lsp diff --git a/alpine-baselayout.roles b/alpine-baselayout.roles index c17fa71..41583a0 100644 --- a/alpine-baselayout.roles +++ b/alpine-baselayout.roles @@ -1,5 +1,5 @@ GUEST=hostname:read USER=cron:status,cron:startstop,health:system,health:storage,health:proc,health:network,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,syslog:status,syslog:loginfo,syslog:startstop,rc:status,rc:startstop EDITOR=cron:listjobs,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit -EXPERT=cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,syslog:expert,interfaces:editintfile,modules:edit,modules:reload -ADMIN=cron:status,cron:startstop,cron:listjobs,cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,hostname:read,health:system,health:storage,health:proc,health:network,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,syslog:status,syslog:loginfo,syslog:startstop,rc:status,rc:startstop,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit,syslog:expert,interfaces:editintfile,modules:edit,modules:reload,password:edit +EXPERT=cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,syslog:expert,interfaces:editintfile,modules:expert,modules:edit,modules:reload +ADMIN=cron:status,cron:startstop,cron:listjobs,cron:editjob,cron:deletejob,cron:movejob,cron:createjob,cron:expert,hostname:read,health:system,health:storage,health:proc,health:network,health:networkstats,interfaces:status,interfaces:read,interfaces:restart,logfiles:status,logfiles:view,logfiles:download,logfiles:tail,modules:status,syslog:status,syslog:loginfo,syslog:startstop,rc:status,rc:startstop,hostname:edit,interfaces:delete,interfaces:create,interfaces:update,interfaces:ifup,interfaces:ifdown,logfiles:delete,syslog:config,rc:edit,syslog:expert,interfaces:editintfile,modules:expert,modules:edit,modules:reload,password:edit diff --git a/cron-listjobs-html.lsp b/cron-listjobs-html.lsp index 6dd3b14..b9759d3 100644 --- a/cron-listjobs-html.lsp +++ b/cron-listjobs-html.lsp @@ -48,9 +48,12 @@ local function createmoveform(name) end %> -

Cron Jobs

+<% +local header_level = htmlviewfunctions.displayheader(view, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) +%> <% for i,tabl in ipairs(view.value) do %> -

<%= html.html_escape(tabl.period) %>

+<% htmlviewfunctions.displayheader(cfe({label=tabl.period}), page_info, header_level) %> <% if #tabl.jobs == 0 then %>

No jobs

<% else %> diff --git a/health-model.lua b/health-model.lua index 424a0e4..9398b14 100644 --- a/health-model.lua +++ b/health-model.lua @@ -65,7 +65,7 @@ mymodule.get_system = function (self) system.memory.free = math.floor(100 * meminfo["MemFree"] / meminfo["MemTotal"]) system.memory.buffers = math.floor(100 * (meminfo["Buffers"] + meminfo["Cached"]) / meminfo["MemTotal"]) system.memory.used = 100 - math.floor(100 * (meminfo["MemFree"] + meminfo["Buffers"] + meminfo["Cached"]) / meminfo["MemTotal"]) - return cfe({ type="group", value=system }) + return cfe({ type="group", value=system, label="System" }) end mymodule.get_storage = function (self) @@ -105,7 +105,7 @@ mymodule.get_storage = function (self) end end storage.partitions = cfe({ value=fs.read_file("/proc/partitions") or "", label="Partitions" }) - return cfe({ type="group", value=storage }) + return cfe({ type="group", value=storage, label="Storage" }) end mymodule.get_network = function (self) @@ -113,18 +113,18 @@ mymodule.get_network = function (self) network.interfaces = cfe({ value=querycmd("ip addr"), label="Interfaces" }) network.routes = cfe({ value=querycmd("ip route"), label="Routes" }) network.tunnel = cfe({ value=querycmd("ip tunnel"), label="Tunnels" }) - return cfe({ type="group", value=network }) + return cfe({ type="group", value=network, label="Network" }) end mymodule.get_proc = function (self) local proc = {} proc.processor = cfe({ value=fs.read_file("/proc/cpuinfo") or "", label="Processor" }) proc.memory = cfe({ value=fs.read_file("/proc/meminfo") or "", label="Memory" }) - return cfe({ type="group", value=proc }) + return cfe({ type="group", value=proc, label="Hardware Information" }) end mymodule.get_networkstats = function () - local stats = cfe({ type="structure", value={}, label="Network Stats", timestamp=os.time() }) + local stats = cfe({ type="structure", value={}, label="Network Statistics", timestamp=os.time() }) local result = fs.read_file("/proc/net/dev") or "" -- parse the result local i=0 diff --git a/health-network-html.lsp b/health-network-html.lsp index 0e34906..fb9799c 100644 --- a/health-network-html.lsp +++ b/health-network-html.lsp @@ -1,15 +1,19 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> -

Network

+<% +local header_level = htmlviewfunctions.displayheader(view, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) +%> -

Interface status

+<% htmlviewfunctions.displayheader(cfe({label="Interface status"}), page_info, header_level) %>
<%= html.html_escape(view.value.interfaces.value) %>
-

Routes

+<% htmlviewfunctions.displayheader(cfe({label="Routes"}), page_info, header_level) %>
<%= html.html_escape(view.value.routes.value) %>
<% if view.value.tunnel.value ~= "" then %> -

Tunnels

+<% htmlviewfunctions.displayheader(cfe({label="Tunnels"}), page_info, header_level) %>
<%= html.html_escape(view.value.tunnel.value) %>
<% end %> diff --git a/health-networkstats-html.lsp b/health-networkstats-html.lsp index 3963773..e6a5d3a 100644 --- a/health-networkstats-html.lsp +++ b/health-networkstats-html.lsp @@ -1,5 +1,6 @@ -<% local view, viewlibrary, page_info = ... %> +<% local view, viewlibrary, page_info, session = ... %> <% json = require("json") %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> <% -- Table of colors @@ -141,8 +142,8 @@ }); -

Network Statistics

-Network traffic in bytes/second +<% htmlviewfunctions.displayheader(view, page_info) %> +

Network traffic in bytes/second

Display Options

diff --git a/health-proc-html.lsp b/health-proc-html.lsp index 443e34e..dbf2bf4 100644 --- a/health-proc-html.lsp +++ b/health-proc-html.lsp @@ -1,10 +1,14 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> -

Hardware information

+<% +local header_level = htmlviewfunctions.displayheader(view, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) +%> -

Processor

+<% htmlviewfunctions.displayheader(cfe({label="Processor"}), page_info, header_level) %>
<%= html.html_escape(view.value.processor.value) %>
-

Memory

+<% htmlviewfunctions.displayheader(cfe({label="Memory"}), page_info, header_level) %>
<%= html.html_escape(view.value.memory.value) %>
diff --git a/health-storage-html.lsp b/health-storage-html.lsp index 786a32c..2335132 100644 --- a/health-storage-html.lsp +++ b/health-storage-html.lsp @@ -1,4 +1,5 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> <% displaydisk = function(disk, name) @@ -30,9 +31,12 @@ io.write(" \n") io.write("\n") end %> -

Storage

+<% +local header_level = htmlviewfunctions.displayheader(view, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) +%> -

Floppy capacity

+<% htmlviewfunctions.displayheader(cfe({label="Floppy capacity"}), page_info, header_level) %> <% if (view.value.floppy) then for name,floppy in pairs(view.value.floppy.value) do displaydisk(floppy, name) @@ -41,7 +45,7 @@ else %>

No Floppy mounted

<% end %> -

Harddrive capacity

+<% htmlviewfunctions.displayheader(cfe({label="Harddrive capacity"}), page_info, header_level) %> <% if (view.value.hd) then for name,hd in pairs(view.value.hd.value) do displaydisk(hd, name) @@ -50,7 +54,7 @@ else %>

No Harddrive mounted

<% end %> -

RAM Disk capacity

+<% htmlviewfunctions.displayheader(cfe({label="RAM Disk capacity"}), page_info, header_level) %> <% if (view.value.ramdisk) then for name,ramdisk in pairs(view.value.ramdisk.value) do displaydisk(ramdisk, name) @@ -60,7 +64,7 @@ else %> <% end %> <% if view.value.partitions then %> -

Disk partitions

+<% htmlviewfunctions.displayheader(cfe({label="Disk partitions"}), page_info, header_level) %>
<%= html.html_escape(view.value.partitions.value) %>
<% end %> diff --git a/health-system-html.lsp b/health-system-html.lsp index b4a352f..8688771 100644 --- a/health-system-html.lsp +++ b/health-system-html.lsp @@ -1,20 +1,24 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> -

System

+<% +local header_level = htmlviewfunctions.displayheader(view, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) +%> -

Versions and names

+<% htmlviewfunctions.displayheader(cfe({label="Versions and names"}), page_info, header_level) %>
<%= html.html_escape(view.value.version.value) %>
<%= html.html_escape(view.value.uname.value) %>
-

Uptime

+<% htmlviewfunctions.displayheader(cfe({label="Uptime"}), page_info, header_level) %>
<%= html.html_escape(view.value.uptime.value) %>
-

Time/TimeZone

+<% htmlviewfunctions.displayheader(cfe({label="Time/TimeZone"}), page_info, header_level) %>
<%= html.html_escape(view.value.date.value) %>
<%= html.html_escape(view.value.timezone.value) %>
-

Memory

+<% htmlviewfunctions.displayheader(cfe({label="Memory"}), page_info, header_level) %>
<%= html.html_escape(view.value.memory.value) %>
<% diff --git a/hostname-read-html.lsp b/hostname-read-html.lsp index 2ab5d0a..233d664 100644 --- a/hostname-read-html.lsp +++ b/hostname-read-html.lsp @@ -1,6 +1,5 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> -<% html = require("acf.html") %> -

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

+<% htmlviewfunctions.displayheader(view, page_info) %> <% htmlviewfunctions.displayitem(view) %> diff --git a/interfaces-model.lua b/interfaces-model.lua index 9fee686..ffcc376 100644 --- a/interfaces-model.lua +++ b/interfaces-model.lua @@ -336,7 +336,7 @@ mymodule.get_status = function () status.ipaddr.value, status.ipaddr.errtxt = modelfunctions.run_executable({"ip", "addr"}) status.iptunnel.value, status.iptunnel.errtxt = modelfunctions.run_executable({"ip", "tunnel"}) - return cfe({ type="group", value=status, label="Status" }) + return cfe({ type="group", value=status, label="Interfaces Status" }) end mymodule.get_file = function () @@ -426,7 +426,7 @@ mymodule.get_restartnetworking = function(self, clientdata) local actions = {} actions[1] = "restart" local service = cfe({ type="hidden", value=servicename, label="Service Name" }) - local startstop = cfe({ type="group", label="Restart Networking", value={servicename=service}, option=actions }) + local startstop = cfe({ type="group", label="Restart Networking", value={servicename=service}, option=actions, descr="WARNING!!! Restarting networking may cause the ACF web interface to stop functioning. Try refreshing this page after restarting. If that fails, you may have to use terminal access to recover." }) return startstop end diff --git a/interfaces-read-html.lsp b/interfaces-read-html.lsp index a0cb44a..ae84b44 100644 --- a/interfaces-read-html.lsp +++ b/interfaces-read-html.lsp @@ -19,7 +19,7 @@ html = require("acf.html") viewlibrary.dispatch_component("status") end %> -

Configured Interfaces

+<% htmlviewfunctions.displayheader(view, page_info) %> <% for i,entry in ipairs(view.value) do local interface = entry.value %>
<%= html.html_escape(interface.name.value) %>
@@ -55,9 +55,6 @@ end %>
<% end %> -

Restart Networking

-

WARNING!!! Restarting networking may cause the ACF web interface to stop functioning. Try refreshing this page after restarting. If that fails, you may have to use terminal access to recover.

-

Restart Networking

-
-
">
-
+<% if viewlibrary and viewlibrary.dispatch_component then + viewlibrary.dispatch_component("restart") +end %> diff --git a/interfaces-status-html.lsp b/interfaces-status-html.lsp index 90b0e19..18ce7f2 100644 --- a/interfaces-status-html.lsp +++ b/interfaces-status-html.lsp @@ -1,8 +1,8 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> -

System Info

<% +htmlviewfunctions.displayheader(view, page_info) htmlviewfunctions.displayitem(view.value.filename) htmlviewfunctions.displayitem(view.value.ipaddr) htmlviewfunctions.displayitem(view.value.iproute) diff --git a/interfaces-update-html.lsp b/interfaces-update-html.lsp index 1d1ee14..194b8d8 100644 --- a/interfaces-update-html.lsp +++ b/interfaces-update-html.lsp @@ -77,7 +77,9 @@ end }); -

<%= html.html_escape(form.label) %><% if page_info.action == "update" then io.write(html.html_escape(" - "..form.value.name.value)) end %>

<% - htmlviewfunctions.displayform(form, nil, nil, page_info, 2) +if page_info.action == "update" then form.label = form.label.." - "..form.value.name.value end +local header_level = htmlviewfunctions.displayheader(form, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) + htmlviewfunctions.displayform(form, nil, nil, page_info, htmlviewfunctions.incrementheader(header_level)) %> diff --git a/logfiles-model.lua b/logfiles-model.lua index 95bcb19..590b3ae 100644 --- a/logfiles-model.lua +++ b/logfiles-model.lua @@ -65,7 +65,7 @@ local function list_files ( ... ) inuse=inuse, label="File details"} }) ) end table.sort(listed_files, function (a,b) return (a.value.filename.value < b.value.filename.value) end ) - return cfe({ type="list", value=listed_files, label="Log files" }) + return cfe({ type="list", value=listed_files, label="Log Files" }) end local do_grep = function(filecontent, grep) @@ -138,7 +138,7 @@ mymodule.tail = function(path, offset, grep) end end - return cfe({ type="group", value={filename=filename, filecontent=filecontent, filesize=filesize, fileoffset=fileoffset, grep=filegrep}, label="Tail Config file details" }) + return cfe({ type="group", value={filename=filename, filecontent=filecontent, filesize=filesize, fileoffset=fileoffset, grep=filegrep}, label="Tail File" }) end mymodule.get = function () diff --git a/logfiles-status-html.lsp b/logfiles-status-html.lsp index bd45435..454d309 100644 --- a/logfiles-status-html.lsp +++ b/logfiles-status-html.lsp @@ -40,7 +40,7 @@ end <% htmlviewfunctions.displaycommandresults({"delete"}, session) %> -

Available Logfiles

+<% htmlviewfunctions.displayheader(view, page_info) %> <% if viewlibrary.check_permission("delete") then %> diff --git a/logfiles-tail-html.lsp b/logfiles-tail-html.lsp index b75429b..7f412a3 100644 --- a/logfiles-tail-html.lsp +++ b/logfiles-tail-html.lsp @@ -1,4 +1,4 @@ -<% local form, viewlibrary, page_info = ... %> +<% local form, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> @@ -62,8 +62,8 @@ }); -

Tail File

<% +htmlviewfunctions.displayheader(form, page_info) htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) if form.value.grep.value ~= "" then diff --git a/logfiles-view-html.lsp b/logfiles-view-html.lsp deleted file mode 100644 index 66a0248..0000000 --- a/logfiles-view-html.lsp +++ /dev/null @@ -1,35 +0,0 @@ -<% local form, viewlibrary, page_info = ... %> -<% htmlviewfunctions = require("htmlviewfunctions") %> -<% html = require("acf.html") %> - -<% if form.type == "form" then %> -

Configuration

-

Expert Configuration

-<% else %> -

View File

-<% end %> -

File Details

-<% -htmlviewfunctions.displayitem(form.value.filename) -htmlviewfunctions.displayitem(form.value.filesize) -htmlviewfunctions.displayitem(form.value.mtime) -if form.value.grep.value ~= "" then - htmlviewfunctions.displayitem(form.value.grep) -end -%> - -

File Content

-<% if form.type == "form" then %> -<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> -<% htmlviewfunctions.displayformstart(form) %> - -<% end %> - -<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> -<% if form.value.filecontent.descr then %>

<%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "
") %>

<% end %> - -<% if form.type == "form" then %> -<% htmlviewfunctions.displayformend(form) %> -<% end %> diff --git a/logfiles-view-html.lsp b/logfiles-view-html.lsp new file mode 120000 index 0000000..15b1930 --- /dev/null +++ b/logfiles-view-html.lsp @@ -0,0 +1 @@ +../filedetails-html.lsp \ No newline at end of file diff --git a/modules-edit-html.lsp b/modules-edit-html.lsp deleted file mode 100644 index 84ad35b..0000000 --- a/modules-edit-html.lsp +++ /dev/null @@ -1,39 +0,0 @@ -<% local form, viewlibrary, page_info, session = ... %> -<% htmlviewfunctions = require("htmlviewfunctions") %> -<% html = require("acf.html") %> - -<% htmlviewfunctions.displaycommandresults({"reload"}, session) %> - -<% if form.type == "form" then %> -

Configuration

-

Expert Configuration

-<% else %> -

View File

-<% end %> -

File Details

-<% -htmlviewfunctions.displayitem(form.value.filename) -htmlviewfunctions.displayitem(form.value.filesize) -htmlviewfunctions.displayitem(form.value.mtime) -%> - -

File Content

-<% if form.type == "form" then %> -<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> -<% htmlviewfunctions.displayformstart(form) %> - -<% end %> - -<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> -<% if form.value.filecontent.descr then %>

<%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "
") %>

<% end %> - -<% if form.type == "form" then %> -<% htmlviewfunctions.displayformend(form) %> -<% end %> - - -

Reload Modules

-

Reload Modules

-
">
diff --git a/modules-edit-html.lsp b/modules-edit-html.lsp new file mode 120000 index 0000000..15b1930 --- /dev/null +++ b/modules-edit-html.lsp @@ -0,0 +1 @@ +../filedetails-html.lsp \ No newline at end of file diff --git a/modules-expert-html.lsp b/modules-expert-html.lsp new file mode 100644 index 0000000..9f15077 --- /dev/null +++ b/modules-expert-html.lsp @@ -0,0 +1,12 @@ +<% local form, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> + +<% htmlviewfunctions.displaycommandresults({"reload"}, session) %> + +<% if viewlibrary and viewlibrary.dispatch_component then + viewlibrary.dispatch_component("edit") +end %> + +<% if viewlibrary and viewlibrary.dispatch_component then + viewlibrary.dispatch_component("reload") +end %> diff --git a/modules-status-html.lsp b/modules-status-html.lsp index d817df5..e70dee1 100644 --- a/modules-status-html.lsp +++ b/modules-status-html.lsp @@ -1,7 +1,9 @@ -<% local view = ... %> +<% local view, viewlibrary, page_info, session = ... %> +<% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> -

Modules

- -

Installed modules

+<% +local header_level = htmlviewfunctions.displayheader(cfe({label="Modules"}), page_info) +htmlviewfunctions.displayheader(cfe({label="Installed modules"}), page_info, htmlviewfunctions.incrementheader(header_level)) +%>
<%= html.html_escape(view.value) %>
diff --git a/modules.menu b/modules.menu index 412a983..16fe1a7 100644 --- a/modules.menu +++ b/modules.menu @@ -1,3 +1,3 @@ # Cat Group Tab Action System 40Modules Status status -System 40Modules Expert edit +System 40Modules Expert expert diff --git a/rc-status-html.lsp b/rc-status-html.lsp index 9e8d2b8..8b4ff79 100644 --- a/rc-status-html.lsp +++ b/rc-status-html.lsp @@ -22,7 +22,7 @@ <% htmlviewfunctions.displaycommandresults({"edit", "startstop"}, session) %> -

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

+<% htmlviewfunctions.displayheader(view, page_info) %>
<% if viewlibrary.check_permission("edit") then %> diff --git a/syslog-config-html.lsp b/syslog-config-html.lsp index 2e86661..f89af21 100644 --- a/syslog-config-html.lsp +++ b/syslog-config-html.lsp @@ -5,25 +5,25 @@ viewlibrary.dispatch_component("status") end %> -

Configuration

-

Advanced Configuration

-<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> -<% htmlviewfunctions.displayformstart(form) %> -

General

-<% +<% +local header_level = htmlviewfunctions.displayheader(form, page_info) +header_level = htmlviewfunctions.incrementheader(header_level) + +htmlviewfunctions.displayheader(cfe({label="Advanced Configuration"}), page_info, header_level) +header_level = htmlviewfunctions.incrementheader(header_level) + +form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action +htmlviewfunctions.displayformstart(form) +htmlviewfunctions.displayheader(cfe({label="General"}), page_info, header_level) htmlviewfunctions.displayformitem(form.value.logfile, "logfile") htmlviewfunctions.displayformitem(form.value.loglevel, "loglevel") htmlviewfunctions.displayformitem(form.value.smallerlogs, "smallerlogs") -%> -

Log Rotate

-<% +htmlviewfunctions.displayheader(cfe({label="Log Rotate"}), page_info, header_level) htmlviewfunctions.displayformitem(form.value.maxsize, "maxsize") htmlviewfunctions.displayformitem(form.value.numrotate, "numrotate") -%> -

Remote Logging

-<% +htmlviewfunctions.displayheader(cfe({label="Remote Logging"}), page_info, header_level) htmlviewfunctions.displayformitem(form.value.localandnetworklog, "localandnetworklog") htmlviewfunctions.displayformitem(form.value.remotelogging, "remotelogging") +htmlviewfunctions.displayheader(cfe({label="Save and Apply Above Settings"}), page_info, header_level) +htmlviewfunctions.displayformend(form) %> -

Save and Apply Above Settings

-<% htmlviewfunctions.displayformend(form) %> diff --git a/syslog-loginfo-html.lsp b/syslog-loginfo-html.lsp index 5e1a19f..dbada17 100644 --- a/syslog-loginfo-html.lsp +++ b/syslog-loginfo-html.lsp @@ -1,14 +1,10 @@ -<% local form, viewlibrary = ... %> +<% local view, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> -<% ---[[ %> <% if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("status") end %> -<% --]] %> -

Program Specific Options/Information

<% -htmlviewfunctions.displayitem(form.value.logfile) -htmlviewfunctions.displayitem(form.value.remote) +htmlviewfunctions.displayitem(view, nil, page_info) %> diff --git a/syslog-model.lua b/syslog-model.lua index 8e3c665..943903a 100644 --- a/syslog-model.lua +++ b/syslog-model.lua @@ -173,7 +173,7 @@ function mymodule.getlogging() }) end - return cfe({ type="group", value=status }) + return cfe({ type="group", value=status, label="Logging Details" }) end function mymodule.get_filedetails() -- cgit v1.2.3