From db50c4a219e0199bebd8a9fd70a87a4d3c6a123e Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Mon, 3 Feb 2014 21:16:54 +0000 Subject: Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags --- cron-listjobs-html.lsp | 57 +++++++++++++++++++++++++------------ health-network-html.lsp | 6 ---- health-networkstats-html.lsp | 44 ++++++++++++++-------------- health-proc-html.lsp | 4 --- health-storage-html.lsp | 48 +++++++++++++------------------ health-system-html.lsp | 68 +++++++++++++++++++------------------------- hostname-read-html.lsp | 2 -- interfaces-read-html.lsp | 66 +++++++++++++++++++++--------------------- interfaces-status-html.lsp | 4 +-- logfiles-status-html.lsp | 67 ++++++++++++++++++++++++++++--------------- logfiles-tail-html.lsp | 16 +++++------ logfiles-view-html.lsp | 19 +++++-------- modules-edit-html.lsp | 24 +++++++--------- modules-status-html.lsp | 2 -- rc-status-html.lsp | 45 ++++++++++++++++++++--------- syslog-config-html.lsp | 20 ++++--------- syslog-loginfo-html.lsp | 4 +-- 17 files changed, 253 insertions(+), 243 deletions(-) diff --git a/cron-listjobs-html.lsp b/cron-listjobs-html.lsp index fc18ee3..6dd3b14 100644 --- a/cron-listjobs-html.lsp +++ b/cron-listjobs-html.lsp @@ -2,6 +2,28 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"editjob", "deletejob", "movejob"}, session) %> <% htmlviewfunctions.displaycommandresults({"createjob"}, session, true) %> @@ -26,33 +48,32 @@ local function createmoveform(name) end %> -

Cron Jobs

+

Cron Jobs

<% for i,tabl in ipairs(view.value) do %> -

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

-
+

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

<% if #tabl.jobs == 0 then %> -No jobs +

No jobs

<% else %> - - - - - - +
JobAction
+ + + + + + <% for i,job in ipairs(tabl.jobs) do %> - - - + + - + + <% end %> -
JobAction
<%= html.html_escape(string.gsub(job, "^.*/", "")) %> +
<%= html.html_escape(string.gsub(job, "^.*/", "")) %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editjob?name="..job.."&redir="..page_info.orig_action, label="Edit "} %> <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletejob?name="..job.."&submit=true", label="Delete "} %> - + <% createmoveform(job, tabl.period) %> -
+ <% end %> -
<% end %> <% if viewlibrary.check_permission("createjob") then diff --git a/health-network-html.lsp b/health-network-html.lsp index da90a68..0e34906 100644 --- a/health-network-html.lsp +++ b/health-network-html.lsp @@ -4,18 +4,12 @@

Network

Interface status

-
<%= html.html_escape(view.value.interfaces.value) %>
-

Routes

-
<%= html.html_escape(view.value.routes.value) %>
-
<% if view.value.tunnel.value ~= "" then %>

Tunnels

-
<%= html.html_escape(view.value.tunnel.value) %>
-
<% end %> diff --git a/health-networkstats-html.lsp b/health-networkstats-html.lsp index fcc2476..3963773 100644 --- a/health-networkstats-html.lsp +++ b/health-networkstats-html.lsp @@ -141,34 +141,36 @@ }); -

Network Statistics

-
+

Network Statistics

Network traffic in bytes/second
-
Display Options
-
- +

Display Options

+
+
InterfaceIP AddressRXTX
+ + <% for i,intf in ipairs(interfaces) do %> - - - - - + + + + + <% end %> -
InterfaceIP AddressRXTX
<%= html.html_escape(intf) %><%= html.html_escape(view.value[intf].ipaddr) %>
TX checked="checked">
<%= html.html_escape(intf) %><%= html.html_escape(view.value[intf].ipaddr) %>
TX checked="checked">
-
Start / Stop
-
- - -
-
+ + + +

Start / Stop

+
+ + +
<% --[[ -- display table of colors %> - +
<% for i=1,#rgb do %> - - + + <% end %> -
+ <% --]] %> diff --git a/health-proc-html.lsp b/health-proc-html.lsp index d5f0a0a..443e34e 100644 --- a/health-proc-html.lsp +++ b/health-proc-html.lsp @@ -4,11 +4,7 @@

Hardware information

Processor

-
<%= html.html_escape(view.value.processor.value) %>
-

Memory

-
<%= html.html_escape(view.value.memory.value) %>
-
diff --git a/health-storage-html.lsp b/health-storage-html.lsp index 0aa11ae..786a32c 100644 --- a/health-storage-html.lsp +++ b/health-storage-html.lsp @@ -3,72 +3,64 @@ <% displaydisk = function(disk, name) io.write("
"..html.html_escape(disk.value).."
\n") -io.write('\n') -io.write(" \n") -io.write(" \n") +io.write('
0%
\n') +io.write(" \n") +io.write(" \n") if tonumber(disk.used) > 0 then - io.write(' \n') + io.write('\n') end if tonumber(disk.used) < 100 then - io.write(' \n') + io.write('\n') end -io.write(' \n') -io.write(" \n") -io.write("
0%
') + io.write('">
') if ( tonumber(disk.used) > 10) then io.write(html.html_escape(disk.used) .. "%") end - io.write('
') + io.write('">
') if ( 90 > tonumber(disk.used)) then io.write((100-tonumber(disk.used)) .. "%") end - io.write('
100%
\n") -io.write('\n') -io.write(" \n") -io.write(' \n') -io.write(" \n") -io.write("
'..html.html_escape(name)..'=Used=Free
\n") +io.write(' 100%\n') +io.write(" \n") +io.write("\n") +io.write('\n') +io.write(" \n") +io.write(' \n') +io.write(" \n") +io.write("
'..html.html_escape(name)..'=Used=Free
\n") end %>

Storage

Floppy capacity

-
<% if (view.value.floppy) then for name,floppy in pairs(view.value.floppy.value) do displaydisk(floppy, name) end else %> -No Floppy mounted +

No Floppy mounted

<% end %> -

Harddrive capacity

-
<% if (view.value.hd) then for name,hd in pairs(view.value.hd.value) do displaydisk(hd, name) end else %> -No Harddrive mounted +

No Harddrive mounted

<% end %> -

RAM Disk capacity

-
<% if (view.value.ramdisk) then for name,ramdisk in pairs(view.value.ramdisk.value) do displaydisk(ramdisk, name) end else %> -No RAM Disk mounted +

No RAM Disk mounted

<% end %> -
<% if view.value.partitions then %>

Disk partitions

-
<%= html.html_escape(view.value.partitions.value) %>
-
<% end %> diff --git a/health-system-html.lsp b/health-system-html.lsp index d07b155..b4a352f 100644 --- a/health-system-html.lsp +++ b/health-system-html.lsp @@ -4,24 +4,17 @@

System

Versions and names

-
<%= html.html_escape(view.value.version.value) %>
<%= html.html_escape(view.value.uname.value) %>
-

Uptime

-
<%= html.html_escape(view.value.uptime.value) %>
-

Time/TimeZone

-
<%= html.html_escape(view.value.date.value) %>
<%= html.html_escape(view.value.timezone.value) %>
-

Memory

-
<%= html.html_escape(view.value.memory.value) %>
<% @@ -32,34 +25,33 @@ local function print_percent(val) end %> - - - - - - - - -
0% -
<% print_percent(view.value.memory.used) %>
-
-
<% print_percent(view.value.memory.buffers) %>
-
-
<% print_percent(view.value.memory.free) %>
-
100%
- - - - - - - - - - - -
Legend:=Used=Buffers / Cached=Free
-
+ + + + + + + + +
0% +
<% print_percent(view.value.memory.used) %>
+
+
<% print_percent(view.value.memory.buffers) %>
+
+
<% print_percent(view.value.memory.free) %>
+
100%
+ + + + + + + + + + + +
Legend:=Used=buffers / Cached=Free
diff --git a/hostname-read-html.lsp b/hostname-read-html.lsp index d1419fc..2ab5d0a 100644 --- a/hostname-read-html.lsp +++ b/hostname-read-html.lsp @@ -3,6 +3,4 @@ <% html = require("acf.html") %>

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

-
<% htmlviewfunctions.displayitem(view) %> -
diff --git a/interfaces-read-html.lsp b/interfaces-read-html.lsp index b736209..a0cb44a 100644 --- a/interfaces-read-html.lsp +++ b/interfaces-read-html.lsp @@ -5,11 +5,11 @@ html = require("acf.html") <% showoption = function(option) if option.errtxt or option.value ~= "" then %> - <%= html.html_escape(option.label) %> - > - <%= string.gsub(html.html_escape(tostring(option.value)), "\n", "
") %> - <% if option.errtxt then io.write("
"..html.html_escape(option.errtxt)) end %> - + <%= html.html_escape(option.label) %> + > + <%= string.gsub(html.html_escape(tostring(option.value)), "\n", "
") %> + <% if option.errtxt then io.write("
"..html.html_escape(option.errtxt)) end %> + <% end %> <% end %> @@ -19,43 +19,45 @@ html = require("acf.html") viewlibrary.dispatch_component("status") end %> -

Configured interfaces

-
+

Configured Interfaces

<% for i,entry in ipairs(view.value) do local interface = entry.value %> -
<%= html.html_escape(interface.name.value) %>
- +
<%= html.html_escape(interface.name.value) %>
+
+
- <% - showoption(interface.family) - if interface.method then showoption(interface.method) end - for name,option in pairs(interface) do - if name~="name" and name~="family" and name~="method" then - showoption(option) - end - end %> - + <% if viewlibrary.check_permission("update") or viewlibrary.check_permission("delete") or viewlibrary.check_permission("ifup") or viewlibrary.check_permission("ifdown") then %> + <% end %> - -
<% if viewlibrary.check_permission("update") then %> - Edit + Edit <% end if viewlibrary.check_permission("delete") then %> - Delete + Delete <% end if viewlibrary.check_permission("ifup") then %> - ifup + ifup <% end if viewlibrary.check_permission("ifdown") then %> - ifdown + ifdown + <% end %> +
+ + <% + showoption(interface.family) + if interface.method then showoption(interface.method) end + for name,option in pairs(interface) do + if name~="name" and name~="family" and name~="method" then + showoption(option) + end + 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
-
">
-
+

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

+
+
">
+
diff --git a/interfaces-status-html.lsp b/interfaces-status-html.lsp index dd01099..90b0e19 100644 --- a/interfaces-status-html.lsp +++ b/interfaces-status-html.lsp @@ -1,8 +1,7 @@ <% local view = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> -

SYSTEM INFO

-
+

System Info

<% htmlviewfunctions.displayitem(view.value.filename) htmlviewfunctions.displayitem(view.value.ipaddr) @@ -11,4 +10,3 @@ if view.value.iptunnel.value ~= "" then htmlviewfunctions.displayitem(view.value.iptunnel) end %> -
diff --git a/logfiles-status-html.lsp b/logfiles-status-html.lsp index 62b28eb..a8282bf 100644 --- a/logfiles-status-html.lsp +++ b/logfiles-status-html.lsp @@ -2,40 +2,61 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"delete"}, session) %>

Available Logfiles

-
- - +
+ <% if viewlibrary.check_permission("delete") then %> - + <% end %> - - - - - - - + + + + + + + + <% for i,file in ipairs(view.value) do %> - + <% if viewlibrary.check_permission("delete") then %> - + <% end %> <% end %> - - - - - - - + + + + + + + <% end %> -
DeleteDeleteViewTailSaveSizeLast ModifiedFile
ViewTailSaveSizeLast ModifiedFile
+ <% if file.value.inuse.value then %> in use <% else %> <%= html.link{value = "delete?filename="..file.value.filename.value.."&submit=true", label="Delete" } %> - <% end %><%= html.link{value = "view?filename="..file.value.filename.value, label="View" } %><%= html.link{value = "tail?filename="..file.value.filename.value, label="Tail" } %><%= html.link{value = "download?viewtype=stream&filename="..file.value.filename.value, label="Download" } %><%= html.html_escape(file.value.filesize.value) %><%= html.html_escape(file.value.mtime.value) %><%= html.html_escape(file.value.filename.value) %>
<%= html.link{value = "view?filename="..file.value.filename.value, label="View" } %><%= html.link{value = "tail?filename="..file.value.filename.value, label="Tail" } %><%= html.link{value = "download?viewtype=stream&filename="..file.value.filename.value, label="Download" } %><%= html.html_escape(file.value.filesize.value) %><%= html.html_escape(file.value.mtime.value) %><%= html.html_escape(file.value.filename.value) %>
-
+ diff --git a/logfiles-tail-html.lsp b/logfiles-tail-html.lsp index 24366a7..b75429b 100644 --- a/logfiles-tail-html.lsp +++ b/logfiles-tail-html.lsp @@ -48,7 +48,7 @@ ID=window.setTimeout("Update();", 1000); } function handleerror(event, request, settings){ - $(this).append("Error requesting page " + settings.url + "
Perhaps the session has timed out."); + $(this).append("Error requesting page " + settings.url + "
Perhaps the session has timed out."); $("#Stop").click(); }; $(function(){ @@ -62,8 +62,7 @@ }); -

Tail File

-
+

Tail File

<% htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) @@ -74,9 +73,8 @@ end

-
Start / Stop tailing file
-
- - -
-
+

Start / Stop tailing file

+
+ + +
diff --git a/logfiles-view-html.lsp b/logfiles-view-html.lsp index e46dc80..66a0248 100644 --- a/logfiles-view-html.lsp +++ b/logfiles-view-html.lsp @@ -3,13 +3,12 @@ <% html = require("acf.html") %> <% if form.type == "form" then %> -

Configuration

-

Expert Configuration

+

Configuration

+

Expert Configuration

<% else %> -

View File

+

View File

<% end %> -

File Details

-
+

File Details

<% htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) @@ -18,10 +17,8 @@ if form.value.grep.value ~= "" then htmlviewfunctions.displayitem(form.value.grep) end %> -
-

File Content

-
+

File Content

<% if form.type == "form" then %> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> <% htmlviewfunctions.displayformstart(form) %> @@ -30,11 +27,9 @@ 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.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/modules-edit-html.lsp b/modules-edit-html.lsp index 2677ca0..84ad35b 100644 --- a/modules-edit-html.lsp +++ b/modules-edit-html.lsp @@ -5,21 +5,19 @@ <% htmlviewfunctions.displaycommandresults({"reload"}, session) %> <% if form.type == "form" then %> -

Configuration

-

Expert Configuration

+

Configuration

+

Expert Configuration

<% else %> -

View File

+

View File

<% end %> -

File Details

-
+

File Details

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

File Content

+

File Content

<% if form.type == "form" then %> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> <% htmlviewfunctions.displayformstart(form) %> @@ -28,16 +26,14 @@ htmlviewfunctions.displayitem(form.value.mtime) -<% 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.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
-
">
-
+

Reload Modules

+

Reload Modules

+
">
diff --git a/modules-status-html.lsp b/modules-status-html.lsp index c2fc9dd..d817df5 100644 --- a/modules-status-html.lsp +++ b/modules-status-html.lsp @@ -4,6 +4,4 @@

Modules

Installed modules

-
<%= html.html_escape(view.value) %>
-
diff --git a/rc-status-html.lsp b/rc-status-html.lsp index ef9173f..9e8d2b8 100644 --- a/rc-status-html.lsp +++ b/rc-status-html.lsp @@ -2,12 +2,29 @@ <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> + + + + + + <% htmlviewfunctions.displaycommandresults({"edit", "startstop"}, session) %> -

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

-
- - +

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

+
+ <% if viewlibrary.check_permission("edit") then %> <% end %> @@ -15,23 +32,23 @@ - + + <% for i,item in ipairs(view.value) do %> - + <% if viewlibrary.check_permission("edit") then %> - - - - - + + + + + <% end %> -
ActionStatus Runlevels Description
<%= html.link{value="edit?servicename="..item.servicename.."&redir="..page_info.orig_action, label="Edit " } %> + <%= html.link{value="edit?servicename="..item.servicename.."&redir="..page_info.orig_action, label="Edit " } %> <% end %> <% if viewlibrary.check_permission("startstop") and item.actions then for i,a in ipairs(item.actions) do print(html.link{value="startstop?servicename="..item.servicename.."&redir=status&submit=true&action="..a, label=a:gsub("^%l", string.upper).." " }) end end %> - <%= html.html_escape(item.servicename) %><%= html.html_escape(item.status) %><%= html.html_escape(table.concat(item.runlevels, ", ")) %> <%= html.html_escape(item.description) %>
<%= html.html_escape(item.servicename) %><%= html.html_escape(item.status) %><%= html.html_escape(table.concat(item.runlevels, ", ")) %> <%= html.html_escape(item.description) %>
-
+ diff --git a/syslog-config-html.lsp b/syslog-config-html.lsp index 2c9069b..2e86661 100644 --- a/syslog-config-html.lsp +++ b/syslog-config-html.lsp @@ -5,33 +5,25 @@ viewlibrary.dispatch_component("status") end %> -

Configuration

-

Advanced Configuration

+

Configuration

+

Advanced Configuration

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

General

-
+

General

<% htmlviewfunctions.displayformitem(form.value.logfile, "logfile") htmlviewfunctions.displayformitem(form.value.loglevel, "loglevel") htmlviewfunctions.displayformitem(form.value.smallerlogs, "smallerlogs") %> -
-

Log Rotate

-
+

Log Rotate

<% htmlviewfunctions.displayformitem(form.value.maxsize, "maxsize") htmlviewfunctions.displayformitem(form.value.numrotate, "numrotate") %> -
-

Remote Logging

-
+

Remote Logging

<% htmlviewfunctions.displayformitem(form.value.localandnetworklog, "localandnetworklog") htmlviewfunctions.displayformitem(form.value.remotelogging, "remotelogging") %> -
-

Save and Apply Above Settings

-
+

Save and Apply Above Settings

<% htmlviewfunctions.displayformend(form) %> diff --git a/syslog-loginfo-html.lsp b/syslog-loginfo-html.lsp index 0e9b408..5e1a19f 100644 --- a/syslog-loginfo-html.lsp +++ b/syslog-loginfo-html.lsp @@ -7,10 +7,8 @@ end %> <% --]] %> -

Program Specific Options/Information

-
+

Program Specific Options/Information

<% htmlviewfunctions.displayitem(form.value.logfile) htmlviewfunctions.displayitem(form.value.remote) %> -
-- cgit v1.2.3