diff options
author | Ted Trask <ttrask01@yahoo.com> | 2014-02-03 21:16:54 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2014-02-03 21:16:54 +0000 |
commit | db50c4a219e0199bebd8a9fd70a87a4d3c6a123e (patch) | |
tree | 30a7dd126382030425767f00948ce3f19e3c8be4 | |
parent | 0abf04fdfd4e0c26c6e43007d188d2b6c75c696e (diff) | |
download | acf-alpine-baselayout-db50c4a219e0199bebd8a9fd70a87a4d3c6a123e.tar.bz2 acf-alpine-baselayout-db50c4a219e0199bebd8a9fd70a87a4d3c6a123e.tar.xz |
Cleanup HTML including removing DL/DT/DD, use tablesorter where possible, and use lowercase tags
-rw-r--r-- | cron-listjobs-html.lsp | 57 | ||||
-rw-r--r-- | health-network-html.lsp | 6 | ||||
-rw-r--r-- | health-networkstats-html.lsp | 44 | ||||
-rw-r--r-- | health-proc-html.lsp | 4 | ||||
-rw-r--r-- | health-storage-html.lsp | 48 | ||||
-rw-r--r-- | health-system-html.lsp | 68 | ||||
-rw-r--r-- | hostname-read-html.lsp | 2 | ||||
-rw-r--r-- | interfaces-read-html.lsp | 66 | ||||
-rw-r--r-- | interfaces-status-html.lsp | 4 | ||||
-rw-r--r-- | logfiles-status-html.lsp | 67 | ||||
-rw-r--r-- | logfiles-tail-html.lsp | 16 | ||||
-rw-r--r-- | logfiles-view-html.lsp | 19 | ||||
-rw-r--r-- | modules-edit-html.lsp | 24 | ||||
-rw-r--r-- | modules-status-html.lsp | 2 | ||||
-rw-r--r-- | rc-status-html.lsp | 45 | ||||
-rw-r--r-- | syslog-config-html.lsp | 20 | ||||
-rw-r--r-- | 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") %> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { +<% for i,tabl in ipairs(view.value) do %> + <% if #tabl.jobs ~= 0 then %> + $("#joblist<%= i %>").tablesorter({headers: {1:{sorter: false}, 2:{sorter: false}}, widgets: ['zebra']}); + <% end %> +<% end %> + }); +</script> + <% htmlviewfunctions.displaycommandresults({"editjob", "deletejob", "movejob"}, session) %> <% htmlviewfunctions.displaycommandresults({"createjob"}, session, true) %> @@ -26,33 +48,32 @@ local function createmoveform(name) end %> -<H1>Cron Jobs</H1> +<h1>Cron Jobs</h1> <% for i,tabl in ipairs(view.value) do %> -<H2><%= html.html_escape(tabl.period) %></H2> -<DL> +<h2><%= html.html_escape(tabl.period) %></h2> <% if #tabl.jobs == 0 then %> -No jobs +<p>No jobs</p> <% else %> -<TABLE> - <TR style="background:#eee;font-weight:bold;"> - <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Job</TD> - <TD style="white-space:nowrap;text-align:left;" class="header">Action</TD> - <TD style="white-space:nowrap;text-align:left;" class="header"></TD> - </TR> +<table id="joblist<%= i %>" class="tablesorter"><thead> + <tr> + <th>Job</th> + <th>Action</th> + <th></th> + </tr> +</thead><tbody> <% for i,job in ipairs(tabl.jobs) do %> - <TR> - <TD style="white-space:nowrap;"><%= html.html_escape(string.gsub(job, "^.*/", "")) %></TD> - <TD style="padding-right:20px;white-space:nowrap;"> + <tr> + <td><%= html.html_escape(string.gsub(job, "^.*/", "")) %></td> + <td> <%= 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 "} %> - </TD><TD> + </td><td> <% createmoveform(job, tabl.period) %> - </TD> - </TR> + </td> + </tr> <% end %> -</TABLE> +</tbody></table> <% end %> -</DL> <% 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 @@ <h1>Network</h1> <h2>Interface status</h2> -<DL> <pre><%= html.html_escape(view.value.interfaces.value) %></pre> -</DL> <h2>Routes</h2> -<DL> <pre><%= html.html_escape(view.value.routes.value) %></pre> -</DL> <% if view.value.tunnel.value ~= "" then %> <h2>Tunnels</h2> -<DL> <pre><%= html.html_escape(view.value.tunnel.value) %></pre> -</DL> <% 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 @@ }); </script> -<H1>Network Statistics</H1> -<DL> +<h1>Network Statistics</h1> Network traffic in bytes/second <div id="chart" style="width:680px; height:300px;"></div> -<DT>Display Options</DT> -<DD><TABLE style="width:auto;"> -<TR><TD><B>Interface</B></TD><TD><B>IP Address</B></TD><TD colspan="2" style="text-align:center;"><B>RX</B></TD><TD colspan="2" style="text-align:center;"><B>TX</B></TD></TR> +<div class='item'><p class='left'>Display Options</p> +<div class='right'> +<table class="tablesorter"><thead> +<tr><th>Interface</th><th>IP Address</th><th colspan="2">RX</th><th colspan="2">TX</th></tr> +</thead><tbody> <% for i,intf in ipairs(interfaces) do %> - <TR><TD><%= html.html_escape(intf) %></TD><TD><%= html.html_escape(view.value[intf].ipaddr) %></TD> - <TD><INPUT type="checkbox" name="<%= html.html_escape(intf) %>RX" checked="checked"></TD> - <TD><DIV style="border:1px solid #ccc;padding:1px"><DIV style="width:14px;height:10px;background-color:<%= rgb[i][1] %>;overflow:hidden"></DIV></DIV></TD> - <TD><INPUT type="checkbox" name=<%= html.html_escape(intf) %>TX checked="checked"></TD> - <TD><DIV style="border:1px solid #ccc;padding:1px"><DIV style="width:14px;height:10px;background-color:<%= rgb[i][2] %>;overflow:hidden"></DIV></DIV></TD></TR> + <tr><td><%= html.html_escape(intf) %></td><td><%= html.html_escape(view.value[intf].ipaddr) %></td> + <td><input type="checkbox" name="<%= html.html_escape(intf) %>RX" checked="checked"></td> + <td><div style="width:14px;height:10px;border:1px solid #ccc;padding:1px"><div style="width:14px;height:10px;background-color:<%= rgb[i][1] %>;overflow:hidden"></div></div></td> + <td><input type="checkbox" name=<%= html.html_escape(intf) %>TX checked="checked"></td> + <td><div style="width:14px;height:10px;border:1px solid #ccc;padding:1px"><div style="width:14px;height:10px;background-color:<%= rgb[i][2] %>;overflow:hidden"></div></div></td></tr> <% end %> -</TABLE></DD> -<DT>Start / Stop</DT> -<DD> -<input CLASS="submit" TYPE="button" ID="Start" VALUE="Start"> -<input CLASS="submit" TYPE="button" ID="Stop" VALUE="Stop"> -</DD> -</DL> +</tbody></table> +</div></div><!-- end .item --> + +<div class='item'><p class='left'>Start / Stop</p> +<div class='right'> +<input class="submit" type="button" id="Start" value="Start"> +<input class="submit" type="button" id="Stop" value="Stop"> +</div></div><!-- end .item --> <% --[[ -- display table of colors %> -<TABLE style="width:auto;"> +<table style="width:auto;"> <% for i=1,#rgb do %> -<TR><TD><DIV style="border:1px solid #ccc;padding:1px"><DIV style="width:14px;height:10px;background-color:<%= rgb[i][1] %>;overflow:hidden"></DIV></DIV></TD> -<TD><DIV style="border:1px solid #ccc;padding:1px"><DIV style="width:14px;height:10px;background-color:<%= rgb[i][2] %>;overflow:hidden"></DIV></DIV></TD></TR> +<tr><td><div style="border:1px solid #ccc;padding:1px"><div style="width:14px;height:10px;background-color:<%= rgb[i][1] %>;overflow:hidden"></div></div></td> +<td><div style="border:1px solid #ccc;padding:1px"><div style="width:14px;height:10px;background-color:<%= rgb[i][2] %>;overflow:hidden"></div></div></td></tr> <% end %> -</TABLE> +</table> <% --]] %> 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 @@ <h1>Hardware information</h1> <h2>Processor</h2> -<DL> <pre><%= html.html_escape(view.value.processor.value) %></pre> -</DL> <h2>Memory</h2> -<DL> <pre><%= html.html_escape(view.value.memory.value) %></pre> -</DL> 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("<pre>"..html.html_escape(disk.value).."</pre>\n") -io.write('<TABLE STYLE="margin:0px;padding:0px;border:0px">\n') -io.write(" <TR>\n") -io.write(" <TD>0%</TD>\n") +io.write('<table style="margin:0px;padding:0px;border:0px">\n') +io.write(" <tr>\n") +io.write(" <td>0%</td>\n") if tonumber(disk.used) > 0 then - io.write(' <TD WIDTH="'..html.html_escape(disk.used)..'%" STYLE="background:red;border:2px solid black;') + io.write(' <td width="'..html.html_escape(disk.used)..'%" style="background:red;border:2px solid black;') if tonumber(disk.used) < 100 then io.write('border-right:none;') end - io.write('"><CENTER><B>') + io.write('"><center><b>') if ( tonumber(disk.used) > 10) then io.write(html.html_escape(disk.used) .. "%") end - io.write('</B></CENTER></TD>\n') + io.write('</b></center></td>\n') end if tonumber(disk.used) < 100 then - io.write(' <TD WIDTH="'..(100-tonumber(disk.used))..'%" STYLE="background:#0c0;border:2px solid black;') + io.write(' <td width="'..(100-tonumber(disk.used))..'%" style="background:#0c0;border:2px solid black;') if tonumber(disk.used) > 0 then io.write('border-left:none;') end - io.write('"><CENTER><B>') + io.write('"><center><b>') if ( 90 > tonumber(disk.used)) then io.write((100-tonumber(disk.used)) .. "%") end - io.write('</B></CENTER></TD>\n') + io.write('</b></center></td>\n') end -io.write(' <TD>100%</TD>\n') -io.write(" </TR>\n") -io.write("</TABLE>\n") -io.write('<TABLE STYLE="margin:0px;padding:0px;border:0px;margin-top:5px;">\n') -io.write(" <TR>\n") -io.write(' <TD WIDTH="100px"><B>'..html.html_escape(name)..'</B></TD><TD STYLE="background:red;border:2px solid black;" WIDTH="20px"></TD><TD WIDTH="70px"><B>=Used</B></TD><TD STYLE="background:#0c0;border:2px solid black;" WIDTH="20px"></TD><TD><B>=Free</B></TD>\n') -io.write(" </TR>\n") -io.write("</TABLE>\n") +io.write(' <td>100%</td>\n') +io.write(" </tr>\n") +io.write("</table>\n") +io.write('<table style="margin:0px;padding:0px;border:0px;margin-top:5px;">\n') +io.write(" <tr>\n") +io.write(' <td width="100px"><b>'..html.html_escape(name)..'</b></td><td style="background:red;border:2px solid black;" width="20px"></td><td width="70px"><b>=Used</b></td><td style="background:#0c0;border:2px solid black;" width="20px"></td><td><b>=Free</b></td>\n') +io.write(" </tr>\n") +io.write("</table>\n") end %> <h1>Storage</h1> <h2>Floppy capacity</h2> -<DL> <% if (view.value.floppy) then for name,floppy in pairs(view.value.floppy.value) do displaydisk(floppy, name) end else %> -No Floppy mounted +<p>No Floppy mounted</p> <% end %> -</DL> <h2>Harddrive capacity</h2> -<DL> <% if (view.value.hd) then for name,hd in pairs(view.value.hd.value) do displaydisk(hd, name) end else %> -No Harddrive mounted +<p>No Harddrive mounted</p> <% end %> -</DL> <h2>RAM Disk capacity</h2> -<DL> <% if (view.value.ramdisk) then for name,ramdisk in pairs(view.value.ramdisk.value) do displaydisk(ramdisk, name) end else %> -No RAM Disk mounted +<p>No RAM Disk mounted</p> <% end %> -</DL> <% if view.value.partitions then %> <h2>Disk partitions</h2> -<DL> <pre><%= html.html_escape(view.value.partitions.value) %></pre> -</DL> <% 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 @@ <h1>System</h1> <h2>Versions and names</h2> -<DL> <pre><%= html.html_escape(view.value.version.value) %></pre> <pre><%= html.html_escape(view.value.uname.value) %></pre> -</DL> <h2>Uptime</h2> -<DL> <pre><%= html.html_escape(view.value.uptime.value) %></pre> -</DL> <h2>Time/TimeZone</h2> -<DL> <pre><%= html.html_escape(view.value.date.value) %></pre> <pre><%= html.html_escape(view.value.timezone.value) %></pre> -</DL> <h2>Memory</h2> -<DL> <pre><%= html.html_escape(view.value.memory.value) %></pre> <% @@ -32,34 +25,33 @@ local function print_percent(val) end %> -<TABLE STYLE="margin:0px;padding:0px;border:0px"> - <TR> - <TD>0%</TD> - <TD WIDTH="<%= html.html_escape(view.value.memory.used) %>%" - STYLE="background:red;border:2px solid black;border-right:none;"> - <CENTER><B><% print_percent(view.value.memory.used) %></B></CENTER> - </TD> - <TD WIDTH="<%= html.html_escape(view.value.memory.buffers) %>%" - STYLE="background:yellow;border:2px solid black;"> - <CENTER><B><% print_percent(view.value.memory.buffers) %></B></CENTER> - </TD> - <TD WIDTH="<%= tonumber(view.value.memory.free) %>%" - STYLE="background:#0c0;border:2px solid black;border-left:none;"> - <CENTER><B><% print_percent(view.value.memory.free) %></B></CENTER> - </TD> - <TD>100%</TD> - </TR> -</TABLE> - -<TABLE STYLE="margin:0px;padding:0px;border:0px;margin-top:5px;"> - <TR> - <TD WIDTH="100px"><B>Legend:</B></TD> - <TD STYLE="background:red;;border:2px solid black;" WIDTH="20px"></TD> - <TD WIDTH="70px"><B>=Used</B></TD> - <TD STYLE="background:yellow;;border:2px solid black;" WIDTH="20px"></TD> - <TD WIDTH="70px"><B>=Buffers / Cached</B></TD> - <TD STYLE="background:#0c0;border:2px solid black;" WIDTH="20px"></TD> - <TD><B>=Free</B></TD> - </TR> -</TABLE> -</DL> +<table style="margin:0px;padding:0px;border:0px"> + <tr> + <td>0%</td> + <td width="<%= html.html_escape(view.value.memory.used) %>%" + style="background:red;border:2px solid black;border-right:none;"> + <center><b><% print_percent(view.value.memory.used) %></b></center> + </td> + <td width="<%= html.html_escape(view.value.memory.buffers) %>%" + style="background:yellow;border:2px solid black;"> + <center><b><% print_percent(view.value.memory.buffers) %></b></center> + </td> + <td width="<%= tonumber(view.value.memory.free) %>%" + style="background:#0c0;border:2px solid black;border-left:none;"> + <center><b><% print_percent(view.value.memory.free) %></b></center> + </td> + <td>100%</td> + </tr> +</table> + +<table style="margin:0px;padding:0px;border:0px;margin-top:5px;"> + <tr> + <td width="100px"><b>Legend:</b></td> + <td style="background:red;;border:2px solid black;" width="20px"></td> + <td width="70px"><b>=Used</b></td> + <td style="background:yellow;;border:2px solid black;" width="20px"></td> + <td width="70px"><b>=buffers / Cached</b></td> + <td style="background:#0c0;border:2px solid black;" width="20px"></td> + <td><b>=Free</b></td> + </tr> +</table> 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") %> <h1><%= html.html_escape(view.label) %></h1> -<DL> <% htmlviewfunctions.displayitem(view) %> -</DL> 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 %> - <TR><TD WIDTH='120px' STYLE='font-weight:bold;border:none;'><%= html.html_escape(option.label) %></TD> - <TD STYLE='border:none;'<% if option.errtxt then io.write("class='error'") end %>> - <%= string.gsub(html.html_escape(tostring(option.value)), "\n", "<BR>") %> - <% if option.errtxt then io.write("<BR>"..html.html_escape(option.errtxt)) end %> - </TD></TR> + <tr><td width='120px' style='font-weight:bold;border:none;'><%= html.html_escape(option.label) %></td> + <td style='border:none;'<% if option.errtxt then io.write("class='error'") end %>> + <%= string.gsub(html.html_escape(tostring(option.value)), "\n", "<br/>") %> + <% if option.errtxt then io.write("<br/>"..html.html_escape(option.errtxt)) end %> + </td></tr> <% end %> <% end %> @@ -19,43 +19,45 @@ html = require("acf.html") viewlibrary.dispatch_component("status") end %> -<H1>Configured interfaces</H1> -<DL> +<h1>Configured Interfaces</h1> <% for i,entry in ipairs(view.value) do local interface = entry.value %> - <DT><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) %></DT><DD> - <TABLE STYLE='margin-bottom:10px'> + <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> + <div class='right'> + <table style='margin-bottom:10px'> - <% - 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 %> - <TR> + <% if viewlibrary.check_permission("update") or viewlibrary.check_permission("delete") or viewlibrary.check_permission("ifup") or viewlibrary.check_permission("ifdown") then %> + <tr><td colspan=2 style='border:none;'> <% if viewlibrary.check_permission("update") then %> - <A HREF='update?name=<%= html.html_escape(interface.name.value) %>&redir=read'>Edit </A> + <a href='update?name=<%= html.html_escape(interface.name.value) %>&redir=read'>Edit </a> <% end if viewlibrary.check_permission("delete") then %> - <A HREF='delete?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>Delete </A> + <a href='delete?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>Delete </a> <% end if viewlibrary.check_permission("ifup") then %> - <A HREF='ifup?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>ifup </A> + <a href='ifup?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>ifup </a> <% end if viewlibrary.check_permission("ifdown") then %> - <A HREF='ifdown?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>ifdown </A> + <a href='ifdown?name=<%= html.html_escape(interface.name.value) %>&submit=true&redir=read'>ifdown </a> + <% end %> + </td></tr> <% end %> - </TR> - </TABLE> + + <% + 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 %> + </table> + </div></div><!-- end .item --> <% end %> -</DD> -</DL> -<H1>Restart Networking</H1> -<DL> -<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> -<DT>Restart Networking</DT> -<DD><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></DD> -</DL> +<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 --> 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") %> -<H1>SYSTEM INFO</H1> -<DL> +<h1>System Info</h1> <% 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 %> -</DL> 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") %> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { + <% if viewlibrary.check_permission("delete") then %> + $("#list").tablesorter({headers: {1:{sorter: false}, 2:{sorter: false}, 3:{sorter: false}}, widgets: ['zebra']}); + <% else %> + $("#list").tablesorter({headers: {0:{sorter: false}, 1:{sorter: false}, 2:{sorter: false}}, widgets: ['zebra']}); + <% end %> + }); +</script> + <% htmlviewfunctions.displaycommandresults({"delete"}, session) %> <h1>Available Logfiles</h1> -<DL> -<TABLE> - <TR style="background:#eee;font-weight:bold;"> +<table id="list" class="tablesorter"><thead> + <tr> <% if viewlibrary.check_permission("delete") then %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Delete</TD> + <th>Delete</th> <% end %> - <TD style="padding-right:20px;white-space:nowrap;" class="header">View</TD> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Tail</TD> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Save</TD> - <TD style="padding-right:20px;white-space:nowrap;text-align:right;" class="header">Size</TD> - <TD style="padding-right:20px;white-space:nowrap;" class="header">Last Modified</TD> - <TD style="white-space:nowrap;" WIDTH="90%" class="header">File</TD> - </TR> + <th>View</th> + <th>Tail</th> + <th>Save</th> + <th>Size</th> + <th>Last Modified</th> + <th>File</th> + </tr> +</thead><tbody> <% for i,file in ipairs(view.value) do %> - <TR> + <tr> <% if viewlibrary.check_permission("delete") then %> - <TD style="padding-right:20px;white-space:nowrap;"> + <td> <% if file.value.inuse.value then %> in use <% else %> <%= html.link{value = "delete?filename="..file.value.filename.value.."&submit=true", label="Delete" } %> - <% end %></TD> + <% end %></td> <% end %> - <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "view?filename="..file.value.filename.value, label="View" } %></TD> - <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "tail?filename="..file.value.filename.value, label="Tail" } %></TD> - <TD style="padding-right:20px;white-space:nowrap;"><%= html.link{value = "download?viewtype=stream&filename="..file.value.filename.value, label="Download" } %></TD> - <TD style="padding-right:20px;white-space:nowrap;text-align:right"><%= html.html_escape(file.value.filesize.value) %></TD> - <TD style="padding-right:20px;white-space:nowrap;"><%= html.html_escape(file.value.mtime.value) %></TD> - <TD style="white-space:nowrap;"><%= html.html_escape(file.value.filename.value) %></TD> - </TR> + <td><%= html.link{value = "view?filename="..file.value.filename.value, label="View" } %></td> + <td><%= html.link{value = "tail?filename="..file.value.filename.value, label="Tail" } %></td> + <td><%= html.link{value = "download?viewtype=stream&filename="..file.value.filename.value, label="Download" } %></td> + <td><%= html.html_escape(file.value.filesize.value) %></td> + <td><%= html.html_escape(file.value.mtime.value) %></td> + <td><%= html.html_escape(file.value.filename.value) %></td> + </tr> <% end %> -</TABLE> -</DL> +</tbody></table> 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 + "<BR>Perhaps the session has timed out."); + $(this).append("Error requesting page " + settings.url + "<br/>Perhaps the session has timed out."); $("#Stop").click(); }; $(function(){ @@ -62,8 +62,7 @@ }); </script> -<H1>Tail File</H1> -<DL> +<h1>Tail File</h1> <% htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) @@ -74,9 +73,8 @@ end <textarea id="filecontent"> </textarea> <p class="error" id="errtxt"></p> -<DT>Start / Stop tailing file</DT> -<DD> -<input TYPE="button" ID="Start" VALUE="Start" onClick='$("#errtxt").empty(); Update(); $("#Start").attr("disabled","disabled");$("#Stop").removeAttr("disabled");'> -<input TYPE="button" ID="Stop" VALUE="Stop" onClick='window.clearTimeout(ID); $("#Stop").attr("disabled","disabled");$("#Start").removeAttr("disabled");'> -</DD> -</DL> +<div class='item'><p class='left'>Start / Stop tailing file</p> +<div class='right'> +<input type="button" id="Start" value="Start" onClick='$("#errtxt").empty(); Update(); $("#Start").attr("disabled","disabled");$("#Stop").removeAttr("disabled");'> +<input type="button" id="Stop" value="Stop" onClick='window.clearTimeout(ID); $("#Stop").attr("disabled","disabled");$("#Start").removeAttr("disabled");'> +</div></div><!-- end .item --> 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 %> -<H1>Configuration</H1> -<H2>Expert Configuration</H2> +<h1>Configuration</h1> +<h2>Expert Configuration</h2> <% else %> -<H1>View File</H1> +<h1>View File</h1> <% end %> -<H3>File Details</H3> -<DL> +<h3>File Details</h3> <% 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 %> -</DL> -<H3>File Content</H3> -<DL> +<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) %> @@ -30,11 +27,9 @@ 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.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> -</DL> 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 %> -<H1>Configuration</H1> -<H2>Expert Configuration</H2> +<h1>Configuration</h1> +<h2>Expert Configuration</h2> <% else %> -<H1>View File</H1> +<h1>View File</h1> <% end %> -<H3>File Details</H3> -<DL> +<h3>File Details</h3> <% htmlviewfunctions.displayitem(form.value.filename) htmlviewfunctions.displayitem(form.value.filesize) htmlviewfunctions.displayitem(form.value.mtime) %> -</DL> -<H3>File Content</H3> +<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) %> @@ -28,16 +26,14 @@ htmlviewfunctions.displayitem(form.value.mtime) <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.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> -<DL> -<DT>Reload Modules</DT> -<DD><form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/reload?redir=edit" %>"><input class="submit" type="submit" name="submit" value="Reload"></form></DD> -</DL> +<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 --> 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 @@ <h1>Modules</h1> <h2>Installed modules</h2> -<DL> <pre><%= html.html_escape(view.value) %></pre> -</DL> 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") %> +<script type="text/javascript"> + if (typeof jQuery == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + if (typeof $.tablesorter == 'undefined') { + document.write('<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"><\/script>'); + } +</script> + +<script type="text/javascript"> + $(document).ready(function() { + $("#list").tablesorter({widgets: ['zebra']}); + }); +</script> + <% htmlviewfunctions.displaycommandresults({"edit", "startstop"}, session) %> -<H1><%= html.html_escape(view.label) %></H1> -<DL> -<TABLE> -<TR> +<h1><%= html.html_escape(view.label) %></h1> +<table id="list" class="tablesorter"><thead> +<tr> <% if viewlibrary.check_permission("edit") then %> <th>Action</th> <% end %> @@ -15,23 +32,23 @@ <th>Status</th> <th>Runlevels</th> <th>Description</th> -</TR> +</tr> +</thead><tbody> <% for i,item in ipairs(view.value) do %> - <TR> + <tr> <% if viewlibrary.check_permission("edit") then %> - <TD><%= html.link{value="edit?servicename="..item.servicename.."&redir="..page_info.orig_action, label="Edit " } %> + <td><%= 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 %> - <TD><%= html.html_escape(item.servicename) %></TD> - <TD><%= html.html_escape(item.status) %></TD> - <TD><%= html.html_escape(table.concat(item.runlevels, ", ")) %> </TD> - <TD><%= html.html_escape(item.description) %></TD> - </TR> + <td><%= html.html_escape(item.servicename) %></td> + <td><%= html.html_escape(item.status) %></td> + <td><%= html.html_escape(table.concat(item.runlevels, ", ")) %> </td> + <td><%= html.html_escape(item.description) %></td> + </tr> <% end %> -</TABLE> -</DL> +</tbody></table> 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 %> -<H1>Configuration</H1> -<H2>Advanced Configuration</H2> +<h1>Configuration</h1> +<h2>Advanced Configuration</h2> <% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> <% htmlviewfunctions.displayformstart(form) %> -</DL> -<H3>General</H3> -<DL> +<h3>General</h3> <% htmlviewfunctions.displayformitem(form.value.logfile, "logfile") htmlviewfunctions.displayformitem(form.value.loglevel, "loglevel") htmlviewfunctions.displayformitem(form.value.smallerlogs, "smallerlogs") %> -</DL> -<H3>Log Rotate</H3> -<DL> +<h3>Log Rotate</h3> <% htmlviewfunctions.displayformitem(form.value.maxsize, "maxsize") htmlviewfunctions.displayformitem(form.value.numrotate, "numrotate") %> -</DL> -<H3>Remote Logging</H3> -<DL> +<h3>Remote Logging</h3> <% htmlviewfunctions.displayformitem(form.value.localandnetworklog, "localandnetworklog") htmlviewfunctions.displayformitem(form.value.remotelogging, "remotelogging") %> -</DL> -<H2>Save and Apply Above Settings</H2> -<DL> +<h2>Save and Apply Above Settings</h2> <% 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 %> <% --]] %> -<H2>Program Specific Options/Information</H2> -<DL> +<h2>Program Specific Options/Information</h2> <% htmlviewfunctions.displayitem(form.value.logfile) htmlviewfunctions.displayitem(form.value.remote) %> -</DL> |