summaryrefslogtreecommitdiffstats
path: root/provisioning-listrequests-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-10-14 13:35:23 +0000
committerTed Trask <ttrask01@yahoo.com>2011-10-14 13:35:23 +0000
commit83657e146b87a2318c6fe0da349c8b54d0efe07f (patch)
treecfe86e9d541611b5119cf1257887a9e029b50c03 /provisioning-listrequests-html.lsp
parentee94e970f43e462f6ad44cbe9ede26ca2471a894 (diff)
downloadacf-provisioning-83657e146b87a2318c6fe0da349c8b54d0efe07f.tar.bz2
acf-provisioning-83657e146b87a2318c6fe0da349c8b54d0efe07f.tar.xz
Added new listrequests, deleterequest, and createdevicefromrequest actions
Diffstat (limited to 'provisioning-listrequests-html.lsp')
-rw-r--r--provisioning-listrequests-html.lsp66
1 files changed, 66 insertions, 0 deletions
diff --git a/provisioning-listrequests-html.lsp b/provisioning-listrequests-html.lsp
new file mode 100644
index 0000000..b2c1e6e
--- /dev/null
+++ b/provisioning-listrequests-html.lsp
@@ -0,0 +1,66 @@
+<% local view, viewlibrary, page_info, session = ...
+require("viewfunctions")
+%>
+
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script>
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script>
+<script type="text/javascript">
+<% -- Since we're including a submission of searchdevices, we need to overcome the automatic redirect
+ if session.searchdevicesresult then
+ -- Use JavaScript to redirect to the searchdevices page
+%>
+ window.location.assign("<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller) %>/searchdevices");
+<%
+ end
+ -- Since we're including a submission of createdevicefromrequest, we need to overcome the automatic redirect
+ if session.createdevicefromrequestresult then
+ -- Use JavaScript to redirect to the createdevicefromrequest page
+%>
+ window.location.assign("<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller) %>/createdevicefromrequest");
+<%
+ end
+%>
+
+ $(document).ready(function() {
+ $("#list").tablesorter();
+ $(".deleterequest").click(function(){ return confirm("Are you sure you want to delete this request?")});
+ });
+</script>
+
+<% displaycommandresults({"deleterequest"}, session) %>
+
+<h1>Requests</h1>
+<DL>
+<TABLE id="list" class="tablesorter"><THEAD>
+ <TR style="background:#eee;font-weight:bold;">
+ <TH>Action</TH>
+ <TH>Timestamp</TH>
+ <TH>MAC Address</TH>
+ <TH>IP Address</TH>
+ <TH>User Agent</TH>
+ </TR>
+</THEAD><TBODY>
+<% for k,v in ipairs( view.value ) do %>
+ <TR>
+ <TD>
+ <% if viewlibrary.check_permission("deleterequest") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleterequest?mac="..v.mac, label="Delete ", class="deleterequest"} %>
+ <% end %>
+ <% if v.device_id then %>
+ <% if viewlibrary.check_permission("searchdevices") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/searchdevices?id=device_id&value="..v.device_id.."&redir=searchdevices&Search=Search", label="Search "} %>
+ <% end %>
+ <% else %>
+ <% if viewlibrary.check_permission("createdevicefromrequest") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/createdevicefromrequest?mac="..v.mac.."&Create=Create", label="Create "} %>
+ <% end %>
+ <% end %>
+ </TD>
+ <TD><%= html.html_escape(v.date) %></TD>
+ <TD><%= html.html_escape(v.mac) %></TD>
+ <TD><%= html.html_escape(v.ip) %></TD>
+ <TD><%= html.html_escape(v.agent) %></TD>
+ </TR>
+<% end %>
+</TBODY>
+</TABLE>