Skip to content

Commit

Permalink
Merge pull request #80 from skx/79-sort-searches
Browse files Browse the repository at this point in the history
Update search-results page to allow sorting
  • Loading branch information
skx authored Jan 20, 2021
2 parents 90445f6 + 19c4414 commit da9bd0f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion data/results.template
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<link href="{{.Urlprefix }}/css/bootstrap.min.css" rel="stylesheet">
<script src="{{.Urlprefix }}/js/jquery-1.12.4.min.js"></script>
<script src="{{.Urlprefix }}/js/bootstrap.min.js"></script>
<script src="{{.Urlprefix }}/js/jquery.tablesorter.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default">
Expand Down Expand Up @@ -53,11 +54,13 @@
<!-- Results -->
<div id="all" class="tab-pane fade in active">
<table id="all_table" class="table table-bordered table-striped table-condensed table-hover">
<thead>
<tr>
<th>Node</th>
<th>State</th>
<th>Seen</th>
</tr>
</thead>
{{range .Nodes }}
<tr
{{if eq .State "failed" }} class="danger" {{ end }}
Expand All @@ -66,7 +69,7 @@
data-href="{{$.Urlprefix}}/node/{{.Fqdn}}">
<td>{{.Fqdn}}</td>
<td>{{.State}}</td>
<td title="{{.At}}">{{.Ago}}</td>
<td data-text="{{.Epoch}}" data-sort-value="{{.Epoch}}" title="{{.At}}">{{.Ago}}</td>
</tr>
{{end}}
</table>
Expand Down Expand Up @@ -100,6 +103,9 @@
</footer>
<script type="text/javascript">
$(function(){
// Allow the table to be sorted
$('#all_table').tablesorter();

$('.table tr[data-href]').each(function(){
$(this).css('cursor','pointer').hover(
function(){
Expand Down
4 changes: 2 additions & 2 deletions static.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ var RESOURCES = map[string]EmbeddedResource{

"data/results.template": {
Filename: "data/results.template",
Contents: "H4sIAAAAAAAC/8xY/Y7cthH//55iQhvdXeQk+owAbWOtgNTpB9A0MXyXFoURBJQ4WvGOImVytOvDYh+or9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0THcd6SnX2najzMJbz/Z/TsAAP//WMD35MMTAAA=",
Length: 5059,
},

"data/robots.txt": {
Expand Down

0 comments on commit da9bd0f

Please sign in to comment.