summaryrefslogtreecommitdiffstats
path: root/rrdtool-listgraphcfg-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'rrdtool-listgraphcfg-html.lsp')
-rw-r--r--rrdtool-listgraphcfg-html.lsp62
1 files changed, 40 insertions, 22 deletions
diff --git a/rrdtool-listgraphcfg-html.lsp b/rrdtool-listgraphcfg-html.lsp
index a8657da..0beebc4 100644
--- a/rrdtool-listgraphcfg-html.lsp
+++ b/rrdtool-listgraphcfg-html.lsp
@@ -3,6 +3,24 @@ 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() {
+ $("#listconfig").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
+ });
+</script>
+
<% htmlviewfunctions.displaycommandresults({"delete"}, session) %>
<script type="text/javascript">
@@ -19,39 +37,39 @@ function javascript_confirm_graph(formID,filename) {
<form id="confirmDisplay" action="#" onsubmit="return false"></form>
-<TABLE>
- <TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:right;" class="header">Size</TD>
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Last Modified</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">File</TD>
- </TR>
+<table id="listconfig" class="tablesorter"><thead>
+ <tr>
+ <th>Action</th>
+ <th>Size</th>
+ <th>Last Modified</th>
+ <th>File</th>
+ </tr>
+</thead><tbody>
<% for i,file in ipairs(form.value) do %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td>
<% if viewlibrary.check_permission("delete") then %>
- <A STYLE="cursor: pointer;" onclick="javascript_confirm_graph('confirmDisplay','<% io.write(file.value.filename.value) %>')">Delete</A>
+ <A style="cursor: pointer;" onclick="javascript_confirm_graph('confirmDisplay','<% io.write(file.value.filename.value) %>')">Delete</A>
<% end %>
<%
if viewlibrary.check_permission("editgraphcfg") then io.write(html.link{value = "editgraphcfg?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end
%>
- </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;" width="90%"><%= html.html_escape(string.gsub(file.value.filename.value, "^.*/", "")) %></TD>
- </TR>
+ </td>
+ <td><%= html.html_escape(file.value.filesize.value) %></td>
+ <td><%= html.html_escape(file.value.mtime.value) %></td>
+ <td><%= html.html_escape(string.gsub(file.value.filename.value, "^.*/", "")) %></td>
+ </tr>
<% end %>
<% if viewlibrary.check_permission("createrrd") then %>
- <TR>
- <TD style="padding-right:20px;white-space:nowrap;">
+ <tr>
+ <td>
<% io.write(html.link{value = "newgraphcfg", label="Create new graph " }) %>
- </TD>
- <TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD>
- </TR>
+ </td>
+ <td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
+ </tr>
<% end %>
-
-</TABLE>
+</tbody></table>
<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then
local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %>