1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
<% local data, viewlibrary, page_info, session = ...
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() {
$("#sources").tablesorter({headers: {0:{sorter: false}}, widgets: ['zebra']});
});
</script>
<% htmlviewfunctions.displaycommandresults({"deletesource", "editsource", "testsource", "createsource", "importlogs"}, session) %>
<h1><%= html.html_escape(data.label) %></h1>
<table id="sources" class="tablesorter"><thead>
<tr>
<th>Action</th>
<th>Name</th>
<th>Enabled</th>
<th>Source</th>
<th>Method</th>
</tr>
</thead><tbody>
<% for i,source in ipairs(data.value) do %>
<tr>
<td>
<%= html.link{value = "editsource?sourcename=" .. source.sourcename.."&redir="..page_info.orig_action, label="Edit "} %>
<%= html.link{value = "deletesource?submit=true&sourcename=" .. source.sourcename, label="Delete "} %>
<%= html.link{value = "testsource?submit=true&sourcename=" .. source.sourcename, label="Test "} %>
</td>
<td><%= html.html_escape(source.sourcename) %></td>
<td><%= html.html_escape(tostring(source.enabled)) %></td>
<td><%= html.html_escape(source.source) %></td>
<td><%= html.html_escape(source.method) %></td>
</tr>
<% end %>
</tbody>
</table>
<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
<% end %>
<% if #data.value == 0 then %>
<p>No sources found</p>
<% end %>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/createsource") %>">
<div class='item'><p class='left'>Create New Source</p>
<div class='right'>
<input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action) %>" >
<input class="submit" type="submit" value="Create">
</div></div><!-- end .item -->
</form>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/importlogs") %>">
<div class='item'><p class='left'>Import Logs</p>
<div class='right'>
<input class="submit" type="submit" name="submit" value="Import">
</div></div><!-- end .item -->
</form>
|