diff --git a/lg.py b/lg.py index 43922c6..847371c 100644 --- a/lg.py +++ b/lg.py @@ -491,7 +491,10 @@ def show_bgpmap(): hop_label = "" - add_node(_as, fillcolor=(first and "#F5A9A9" or "white")) + if _as == asmap[-1]: + add_node(_as, fillcolor="#F5A9A9", shape="box", ) + else: + add_node(_as, fillcolor=(first and "#F5A9A9" or "white"), ) if hop_label: edge = add_edge(nodes[previous_as], nodes[_as], label=hop_label, fontsize="7") else: @@ -499,20 +502,16 @@ def show_bgpmap(): hop_label = "" - if first: + if first or _as == asmap[-1]: edge.set_style("bold") edge.set_color("red") - elif edge.get_color() != "red": + elif edge.get_style() != "bold": edge.set_style("dashed") edge.set_color(color) previous_as = _as first = False - if previous_as: - node = add_node(previous_as) - node.set_shape("box") - for _as in prepend_as: graph.add_edge(pydot.Edge(*(_as, _as), label=" %dx" % prepend_as[_as], color="grey", fontcolor="grey")) diff --git a/static/js/lg.js b/static/js/lg.js index 18424b0..358fc95 100644 --- a/static/js/lg.js +++ b/static/js/lg.js @@ -14,7 +14,7 @@ function reload(){ loc = "/" + request_type + "/" + hosts + "/" + proto; if (request_type != "summary" ){ if( request_args != undefined && request_args != ""){ - loc = loc + "?q=" + escape(request_args); + loc = loc + "?q=" + encodeURIComponent(request_args); change_url(loc) } } else { diff --git a/templates/layout.html b/templates/layout.html index a5e92f0..34071b0 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -84,7 +84,7 @@ {% for hosts, proto, request_type, request_args in session.history %} - + {{hosts}}/{{proto}}: {{ commands_dict[request_type]|replace("...", request_args) }} diff --git a/templates/route.html b/templates/route.html index 4e11ecc..72eac07 100644 --- a/templates/route.html +++ b/templates/route.html @@ -3,7 +3,7 @@ {% for host in detail %}

{{host}}: {{command}} - View the BGP map + View the BGP map

{% if session.request_args != expression|replace("/32","")|replace("/128","") %} DNS: {{session.request_args}} => {{expression|replace("/32","")|replace("/128","")}}