commit 21702ff29dcd79622ad6aad5659ba9e47a918e87 Author: Sathyanarayanan Gunasekaran gsathya.ceg@gmail.com Date: Fri Aug 24 22:00:18 2012 +0530
Add more exit filtering options to HTML
Add radio buttons which invoke different filtering options that were newly added to compass. --- app.py | 4 ++++ templates/index.html | 32 ++++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-)
diff --git a/app.py b/app.py index 2c60a01..e7ef634 100644 --- a/app.py +++ b/app.py @@ -21,6 +21,8 @@ class Opt(object): self.exits_only = False self.download = None self.fast_exits_only = False + self.fast_exits_only_any_network = False + self.all_relays = False
class Result(): def __init__(self): @@ -110,6 +112,8 @@ def result(): setattr(options, key, [value]) else: setattr(options, key, None) + elif key == "exits": + setattr(options, value, True) else: setattr(options, key, value)
diff --git a/templates/index.html b/templates/index.html index 14e5866..2ea271d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,4 +1,3 @@ - <!DOCTYPE html> <html lang="en"> <head> @@ -74,15 +73,6 @@ <input type="checkbox" id="exit" value="True" name="exits_only"> select only relays suitable for exit position</label> </div> - <label class="control-label" for="fastExit">Fast - Exit Nodes</label> - <div class="controls"> - <label class="checkbox"> - <input type="checkbox" id="fastExit" value="True" name="fast_exits_only"> - select only 100+ Mbit/s exits allowing ports 80, - 443, 554, and 1755 - </label> - </div> <label class="control-label" for="family">Family</label> <div class="controls"> <input type="text" class="input-xlarge" id="family" name="family" @@ -102,6 +92,26 @@ <span class="help-inline">select only relays from country with code</span> </div> </div> + <label class="control-label" for="exits">Exits</label> + <div class="controls"> + <label class="radio"> + <input type="radio" name="exits" id="all_relays" value="all_relays" checked> + All relays + </label> + <label class="radio"> + <input type="radio" name="exits" id="exits_only" value="fast_exits_only"> + Fast exit relays (95+ Mbit/s, 5000+ KB/s, + 80/443/554/1755, 2 relays per /24) + </label> + <label class="radio"> + <input type="radio" name="exits" id="almost_fast_relays" value="almost_fast_exits_only"> + Almost fast exit relays (80+ Mbit/s, 2000+ KB/s, 80/443, not in set of fast exits) + </label> + <label class="radio"> + <input type="radio" name="exits" id="exit_relays_any_nw" value="fast_exits_only_any_network"> + Fast exits relays any network (95+ Mbit/s, 5000+ KB/s, 80/443/554/1755) + </label> + </div> <div class="control-group"> <h3> Group </h3> <label class="control-label" for="country">Country</label> @@ -150,6 +160,8 @@ <!-- Placed at the end of the document so the pages load faster --> <script src="{{ url_for('static', filename='js/jquery-1.8.0.min.js') }}"></script> + <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script> + <script src="{{ url_for('static', filename='js/custom.js') }}"></script> <script> var myForm = document.getElementById('form');