From a6ca4423ffaf4ed1687dc8ff4fddef48c503efb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 3 Aug 2018 18:04:35 +0200 Subject: [PATCH] new: add some meta information --- website/web/__init__.py | 16 ++++++++++++++++ website/web/templates/asn.html | 9 ++++++++- website/web/templates/country_asn_map.html | 3 --- website/web/templates/index.html | 5 +++++ website/web/templates/main.html | 5 +++++ 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/website/web/__init__.py b/website/web/__init__.py index e21018a..763e275 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -95,6 +95,22 @@ def asn_details(): return render_template('asn.html', sources=sources, ranks=ranks, prefix_ips=prefix_ips, asn_descriptions=asn_descriptions, **session) +@app.route('/asn_description', methods=['POST']) +def asn_description(): + load_session() + asn = None + if request.form.get('asn'): + asn = request.form.get('asn') + elif session.get('asn'): + asn = session.get('asn') + else: + to_return = {'error': 'asn required'} + if asn: + q = Querying() + to_return = q.get_asn_descriptions(asn, session.get('all_descriptions')) + return Response(json.dumps(to_return), mimetype='application/json') + + @app.route('/asn_history', methods=['GET', 'POST']) def asn_history(): load_session() diff --git a/website/web/templates/asn.html b/website/web/templates/asn.html index 526a219..a352f14 100644 --- a/website/web/templates/asn.html +++ b/website/web/templates/asn.html @@ -5,7 +5,9 @@ {% endblock %} -{% block title %}Ranking - {{ asn }}{% endblock %} +{% block title %} + Ranking - {{ asn }} +{% endblock %} {% block scripts %} {{ super() }} @@ -16,6 +18,11 @@ {% block content %}

Ranking - {{asn}}



+
{% include ['top_forms.html'] %} diff --git a/website/web/templates/country_asn_map.html b/website/web/templates/country_asn_map.html index ff59b6b..7b29542 100644 --- a/website/web/templates/country_asn_map.html +++ b/website/web/templates/country_asn_map.html @@ -15,6 +15,3 @@ {% endfor %}
{% endfor %} - - - diff --git a/website/web/templates/index.html b/website/web/templates/index.html index e851ae0..2b7a608 100644 --- a/website/web/templates/index.html +++ b/website/web/templates/index.html @@ -5,6 +5,11 @@ {% block content %}

BGP Ranking



+
{% include ['top_forms.html'] %} diff --git a/website/web/templates/main.html b/website/web/templates/main.html index 08a0dd8..45a1aa8 100644 --- a/website/web/templates/main.html +++ b/website/web/templates/main.html @@ -4,6 +4,11 @@ {{ super() }} + {% endblock %} {% block head %}