[tor-commits] [atlas/master] Add type column to search view
phw at torproject.org
phw at torproject.org
Mon Jul 21 17:47:29 UTC 2014
commit b17f704ea16c63211fdb23ed34b5ed01ac69525b
Author: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Date: Sun Jul 20 03:32:24 2014 +0400
Add type column to search view
Add a column representing router type (Bridge/Router) to the search
view.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
---
js/views/search/do.js | 6 ++++++
templates/search/do.html | 11 +++++++++++
2 files changed, 17 insertions(+)
diff --git a/js/views/search/do.js b/js/views/search/do.js
index bcd3231..5e077ec 100644
--- a/js/views/search/do.js
+++ b/js/views/search/do.js
@@ -169,6 +169,9 @@ define([
'Running', 'Stable', 'V2Dir', 'Valid', 'Unnamed',
'Exit']
});
+ $('input#type').typeahead({
+ source: ['Relay', 'Bridge']
+ });
$(".search-query").val(query);
$("#torstatus_results tbody tr").hover(function() {
@@ -217,6 +220,9 @@ define([
oTable.fnDraw();
});
+ $("tfoot input#type").keyup(function() {
+ oTable.fnFilter(this.value, 8);
+ });
},
diff --git a/templates/search/do.html b/templates/search/do.html
index 99b30bd..ddbd21d 100644
--- a/templates/search/do.html
+++ b/templates/search/do.html
@@ -37,6 +37,7 @@ Please report which browser/addons/etc. you're using to <a href="https://trac.to
<th>Flags</th>
<th>ORPort</th>
<th>DirPort</th>
+ <th>Type</th>
</tr>
</thead>
<tbody>
@@ -72,6 +73,13 @@ Please report which browser/addons/etc. you're using to <a href="https://trac.to
</td>
<td><%= relay.get('or_port') %></td>
<td><%= relay.get('dir_port') %></td>
+ <td>
+ <% if (relay.get('is_bridge')) { %>
+ Bridge
+ <% } else { %>
+ Relay
+ <% } %>
+ </td>
</tr>
<% i += 1; %>
<% }); %>
@@ -105,6 +113,9 @@ Please report which browser/addons/etc. you're using to <a href="https://trac.to
<th>
<input type="text" id="dir_port" name="dir_port" placeholder="DirPort" class="search_init span1">
</th>
+ <th>
+ <input type="text" id="type" name="type" placeholder="Type" class="search_init span1">
+ </th>
</tr>
</tfoot>
</table>
More information about the tor-commits
mailing list