fix: cast to float & rendering

pull/12/head
Raphaël Vinot 2018-07-30 15:17:57 +02:00
parent c278f83517
commit ed14f7f5e8
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ class Querying():
key = f'{d}|asns|{ipversion}'
r = self.ranking.zscore(key, asn)
if r:
return r
return float(r)
return 0
def get_sources(self, date: Dates=datetime.date.today()):

View File

@ -3,14 +3,14 @@
<input name="date" type="date" value="{{ date }}">
<input type="submit" value="Set date">
</form>
<form style="width:250px; display:inline-block;" action="" method=post>
<form style="width:220px; display:inline-block;" action="" method=post>
<select name="ipversion">
<option value="v4" {% if ipversion == 'v4' %} selected="selected"{% endif %}>v4</option>
<option value="v6" {% if ipversion == 'v6' %} selected="selected"{% endif %}>v6</option>
</select>
<input type="submit" value="Set IP version">
</form>
<form style="width:300px; display:inline-block;" action="" method=post>
<form style="width:350px; display:inline-block;" action="" method=post>
<select name="source">
<option value="" {% if not source %} selected="selected"{% endif %}>all</option>
{% for s in sources %}
@ -19,7 +19,7 @@
</select>
<input type="submit" value="Set source">
</form>
<form style="width:400px; display:inline-block;" action="{{ url_for('asn_details') }}" method=post>
<form style="width:350px; display:inline-block;" action="{{ url_for('asn_details') }}" method=post>
ASN to search: <input type=number name=asn>
<input type="submit" value="Search">
</form>