Adding datatables

v0.1.7
Dan Krieger 2016-07-19 11:10:12 -07:00
parent 591cbd0012
commit 9099e5fbf4
1 changed files with 21 additions and 10 deletions

View File

@ -4,7 +4,10 @@
<script src="jquery.js"></script> <script src="jquery.js"></script>
<script src="script.js"></script> <script src="script.js"></script>
<script src="bootstrap.min.js"></script> <script src="bootstrap.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/bs/dt-1.10.12/datatables.min.js"></script>
<link rel="stylesheet" href="bootstrap.min.css" /> <link rel="stylesheet" href="bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/dataTables.bootstrap.min.css"/>
<script type="text/javascript"> <script type="text/javascript">
var crontabs = []; var crontabs = [];
var routes = []; var routes = [];
@ -38,14 +41,17 @@
<br/> <br/>
<br/> <br/>
<table class="table"> <table class="table table-striped" id="main_table">
<tr> <thead>
<th>Name</th> <tr>
<th>Job</th> <th>Name</th>
<th>Time</th> <th>Job</th>
<th>Last Modified</th> <th>Time</th>
<th></th> <th>Last Modified</th>
</tr> <th></th>
</tr>
</thead>
<tbody>
<% var index = 1 %> <% var index = 1 %>
<% JSON.parse(crontabs).forEach(function(crontab){ %> <% JSON.parse(crontabs).forEach(function(crontab){ %>
<!-- color based on crontab state --> <!-- color based on crontab state -->
@ -98,10 +104,15 @@
</tr> </tr>
<% }); %> <% }); %>
</tbody>
</table> </table>
</div> </div>
<% include popup.ejs %> <% include popup.ejs %>
<script>
jQuery(function($) {
$('#main_table').DataTable();
});
</script>
</body> </body>
</html> </html>