summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2014-03-04 02:41:32 +0000
committerTed Trask <ttrask01@yahoo.com>2014-03-04 02:41:32 +0000
commitf9780f645bc94f2f79fc4e266e671d15232d4b9d (patch)
treeba25e6d23f9a89891d4a01c5d1ffe4c59718c914
parentb0f4fadb7b62297b6dbd574b2a7d8eee0f990eb4 (diff)
downloadacf-alpine-baselayout-f9780f645bc94f2f79fc4e266e671d15232d4b9d.tar.bz2
acf-alpine-baselayout-f9780f645bc94f2f79fc4e266e671d15232d4b9d.tar.xz
Change HTML views to use htmlviewfunctions.displayheader
Modified some models to change labels
-rw-r--r--alpine-baselayout.roles4
-rw-r--r--cron-listjobs-html.lsp7
-rw-r--r--health-model.lua10
-rw-r--r--health-network-html.lsp14
-rw-r--r--health-networkstats-html.lsp7
-rw-r--r--health-proc-html.lsp12
-rw-r--r--health-storage-html.lsp16
-rw-r--r--health-system-html.lsp16
-rw-r--r--hostname-read-html.lsp5
-rw-r--r--interfaces-model.lua4
-rw-r--r--interfaces-read-html.lsp11
-rw-r--r--interfaces-status-html.lsp4
-rw-r--r--interfaces-update-html.lsp6
-rw-r--r--logfiles-model.lua4
-rw-r--r--logfiles-status-html.lsp2
-rw-r--r--logfiles-tail-html.lsp4
l---------[-rw-r--r--]logfiles-view-html.lsp36
l---------[-rw-r--r--]modules-edit-html.lsp40
-rw-r--r--modules-expert-html.lsp12
-rw-r--r--modules-status-html.lsp10
-rw-r--r--modules.menu2
-rw-r--r--rc-status-html.lsp2
-rw-r--r--syslog-config-html.lsp28
-rw-r--r--syslog-loginfo-html.lsp8
-rw-r--r--syslog-model.lua2
25 files changed, 111 insertions, 155 deletions
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
%>
-<h1>Cron Jobs</h1>
+<%
+local header_level = htmlviewfunctions.displayheader(view, page_info)
+header_level = htmlviewfunctions.incrementheader(header_level)
+%>
<% for i,tabl in ipairs(view.value) do %>
-<h2><%= html.html_escape(tabl.period) %></h2>
+<% htmlviewfunctions.displayheader(cfe({label=tabl.period}), page_info, header_level) %>
<% if #tabl.jobs == 0 then %>
<p>No jobs</p>
<% 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") %>
-<h1>Network</h1>
+<%
+local header_level = htmlviewfunctions.displayheader(view, page_info)
+header_level = htmlviewfunctions.incrementheader(header_level)
+%>
-<h2>Interface status</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Interface status"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.interfaces.value) %></pre>
-<h2>Routes</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Routes"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.routes.value) %></pre>
<% if view.value.tunnel.value ~= "" then %>
-<h2>Tunnels</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Tunnels"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.tunnel.value) %></pre>
<% 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 @@
});
</script>
-<h1>Network Statistics</h1>
-Network traffic in bytes/second
+<% htmlviewfunctions.displayheader(view, page_info) %>
+<p>Network traffic in bytes/second</p>
<div id="chart" style="width:680px; height:300px;"></div>
<div class='item'><p class='left'>Display Options</p>
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") %>
-<h1>Hardware information</h1>
+<%
+local header_level = htmlviewfunctions.displayheader(view, page_info)
+header_level = htmlviewfunctions.incrementheader(header_level)
+%>
-<h2>Processor</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Processor"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.processor.value) %></pre>
-<h2>Memory</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Memory"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.memory.value) %></pre>
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(" </tr>\n")
io.write("</table>\n")
end %>
-<h1>Storage</h1>
+<%
+local header_level = htmlviewfunctions.displayheader(view, page_info)
+header_level = htmlviewfunctions.incrementheader(header_level)
+%>
-<h2>Floppy capacity</h2>
+<% 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 %>
<p>No Floppy mounted</p>
<% end %>
-<h2>Harddrive capacity</h2>
+<% 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 %>
<p>No Harddrive mounted</p>
<% end %>
-<h2>RAM Disk capacity</h2>
+<% 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 %>
-<h2>Disk partitions</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Disk partitions"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.partitions.value) %></pre>
<% 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") %>
-<h1>System</h1>
+<%
+local header_level = htmlviewfunctions.displayheader(view, page_info)
+header_level = htmlviewfunctions.incrementheader(header_level)
+%>
-<h2>Versions and names</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Versions and names"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.version.value) %></pre>
<pre><%= html.html_escape(view.value.uname.value) %></pre>
-<h2>Uptime</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Uptime"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.uptime.value) %></pre>
-<h2>Time/TimeZone</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Time/TimeZone"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.date.value) %></pre>
<pre><%= html.html_escape(view.value.timezone.value) %></pre>
-<h2>Memory</h2>
+<% htmlviewfunctions.displayheader(cfe({label="Memory"}), page_info, header_level) %>
<pre><%= html.html_escape(view.value.memory.value) %></pre>
<%
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") %>
-<h1><%= html.html_escape(view.label) %></h1>
+<% 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 %>
-<h1>Configured Interfaces</h1>
+<% htmlviewfunctions.displayheader(view, page_info) %>
<% for i,entry in ipairs(view.value) do
local interface = entry.value %>
<div class='item'><div class='left'><IMG SRC='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/devices/network-wired.png' width='16' height='16'> <%= html.html_escape(interface.name.value) %></div>
@@ -55,9 +55,6 @@ end %>
</div></div><!-- end .item -->
<% end %>
-<h1>Restart Networking</h1>
-<p class="error">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.</p>
-<div class='item'><p class='left'>Restart Networking</p>
-<div class='right'>
-<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/restart?redir=read") %>"><input class="submit" type="submit" name="submit" value="Restart"></form>
-</div></div><!-- end .item -->
+<% 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") %>
-<h1>System Info</h1>
<%
+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
});
</script>
-<h1><%= html.html_escape(form.label) %><% if page_info.action == "update" then io.write(html.html_escape(" - "..form.value.name.value)) end %></h1>
<%
- 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) %>
-<h1>Available Logfiles</h1>
+<% htmlviewfunctions.displayheader(view, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<% 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 @@
});
</script>
-<h1>Tail File</h1>
<%
+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
index 66a0248..15b1930 100644..120000
--- a/logfiles-view-html.lsp
+++ b/logfiles-view-html.lsp
@@ -1,35 +1 @@
-<% local form, viewlibrary, page_info = ... %>
-<% htmlviewfunctions = require("htmlviewfunctions") %>
-<% html = require("acf.html") %>
-
-<% if form.type == "form" then %>
-<h1>Configuration</h1>
-<h2>Expert Configuration</h2>
-<% else %>
-<h1>View File</h1>
-<% end %>
-<h3>File Details</h3>
-<%
-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
-%>
-
-<h3>File Content</h3>
-<% if form.type == "form" then %>
-<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
-<% htmlviewfunctions.displayformstart(form) %>
-<input type="hidden" name="filename" value="<%= html.html_escape(form.value.filename.value) %>">
-<% end %>
-<textarea name="filecontent">
-<%= html.html_escape(form.value.filecontent.value) %>
-</textarea>
-<% if form.value.filecontent.errtxt then %><p class='error'><%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "<br/>") %></p><% end %>
-<% if form.value.filecontent.descr then %><p class='descr'><%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "<br/>") %></p><% end %>
-
-<% if form.type == "form" then %>
-<% htmlviewfunctions.displayformend(form) %>
-<% end %>
+../filedetails-html.lsp \ No newline at end of file
diff --git a/modules-edit-html.lsp b/modules-edit-html.lsp
index 84ad35b..15b1930 100644..120000
--- a/modules-edit-html.lsp
+++ b/modules-edit-html.lsp
@@ -1,39 +1 @@
-<% local form, viewlibrary, page_info, session = ... %>
-<% htmlviewfunctions = require("htmlviewfunctions") %>
-<% html = require("acf.html") %>
-
-<% htmlviewfunctions.displaycommandresults({"reload"}, session) %>
-
-<% if form.type == "form" then %>
-<h1>Configuration</h1>
-<h2>Expert Configuration</h2>
-<% else %>
-<h1>View File</h1>
-<% end %>
-<h3>File Details</h3>
-<%
-htmlviewfunctions.displayitem(form.value.filename)
-htmlviewfunctions.displayitem(form.value.filesize)
-htmlviewfunctions.displayitem(form.value.mtime)
-%>
-
-<h3>File Content</h3>
-<% if form.type == "form" then %>
-<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
-<% htmlviewfunctions.displayformstart(form) %>
-<input type="hidden" name="filename" value="<%= form.value.filename.value %>">
-<% end %>
-<textarea name="filecontent">
-<%= html.html_escape(form.value.filecontent.value) %>
-</textarea>
-<% if form.value.filecontent.errtxt then %><p class='error'><%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "<br/>") %></p><% end %>
-<% if form.value.filecontent.descr then %><p class='descr'><%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "<br/>") %></p><% end %>
-
-<% if form.type == "form" then %>
-<% htmlviewfunctions.displayformend(form) %>
-<% end %>
-</form>
-
-<h1>Reload Modules</h1>
-<div class='item'><p class='left'>Reload Modules</p>
-<div class='right'><form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/reload?redir=edit" %>"><input class="submit" type="submit" name="submit" value="Reload"></form></div></div><!-- end .item -->
+../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") %>
-<h1>Modules</h1>
-
-<h2>Installed modules</h2>
+<%
+local header_level = htmlviewfunctions.displayheader(cfe({label="Modules"}), page_info)
+htmlviewfunctions.displayheader(cfe({label="Installed modules"}), page_info, htmlviewfunctions.incrementheader(header_level))
+%>
<pre><%= html.html_escape(view.value) %></pre>
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) %>
-<h1><%= html.html_escape(view.label) %></h1>
+<% htmlviewfunctions.displayheader(view, page_info) %>
<table id="list" class="tablesorter"><thead>
<tr>
<% 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 %>
-<h1>Configuration</h1>
-<h2>Advanced Configuration</h2>
-<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
-<% htmlviewfunctions.displayformstart(form) %>
-<h3>General</h3>
-<%
+<%
+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")
-%>
-<h3>Log Rotate</h3>
-<%
+htmlviewfunctions.displayheader(cfe({label="Log Rotate"}), page_info, header_level)
htmlviewfunctions.displayformitem(form.value.maxsize, "maxsize")
htmlviewfunctions.displayformitem(form.value.numrotate, "numrotate")
-%>
-<h3>Remote Logging</h3>
-<%
+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)
%>
-<h2>Save and Apply Above Settings</h2>
-<% 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 %>
-<% --]] %>
-<h2>Program Specific Options/Information</h2>
<%
-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()