{%- extends "_layout.html" %} {%- block content %}

{{ hawat_current_view.get_view_title() }}

{{ search_form.search.label(class_='sr-only') }}
{{ get_icon('action-search') }}
{{ search_form.search(class_='form-control', placeholder=_('IPv4 address'), size='50') }}
{{ search_form.submit(class_='btn btn-primary') }} {{ _('Clear') }}
{{ macros_form.render_form_errors(search_form.search.errors) }}
{%- if search_item %}

{{ get_icon('search') }} {{ _('Search externally in NERD service') }}

{%- if search_result %} {%- if 'rep' in search_result and search_result['rep'] %} {%- endif %} {%- if 'fmp' in search_result and search_result['fmp'] and 'general' in search_result['fmp'] and search_result['fmp']['general'] %} {%- endif %} {%- if 'hostname' in search_result and search_result['hostname'] %} {%- endif %} {%- if 'asn' in search_result and search_result['asn'] %} {%- endif %} {%- if 'geo' in search_result and search_result['geo'] and 'ctry' in search_result['geo'] and search_result['geo']['ctry'] %} {%- endif %} {%- if 'bgppref' in search_result and search_result['bgppref'] %} {%- endif %} {%- if 'ipblock' in search_result and search_result['ipblock'] %} {%- endif %} {%- if 'bl' in search_result and search_result['bl'] %} {%- endif %} {%- if 'tags' in search_result and search_result['tags'] %} {%- endif %}
{{ _('Reputation') }}: {{ '{:.3f}'.format(search_result['rep']) }}
{{ _('FMP score') }}: {{ '{:.3f}'.format(search_result['fmp']['general']) }}
{{ _('Hostname') }}: {{ search_result['hostname'] }}
{{ _('AS number') }}: {{ search_result['asn'] | join(', ') }}
{{ _('Country') }}: {{ search_result['geo']['ctry'] | upper }} {{ get_country_flag(search_result['geo']['ctry']) }}
{{ _('BGP prefix') }}: {{ search_result['bgppref'] }}
{{ _('IP block') }}: {{ search_result['ipblock'] }}
{{ _('Blacklists') }}: {% for bl in search_result['bl'] %} {{ bl }} {% endfor %}
{{ _('Tags') }}: {% for tag in search_result['tags'] %} {{ tag['n'] }} ({{ tag['c'] }}x) {% endfor %}
{%- else %} {%- call macros_site.render_alert('info', False) %} {{ _('There are no records for %(item_id)s in NERD service.', item_id = search_item) | safe }} {%- endcall %} {%- endif %}
{%- if permission_can('developer') %}
{{ macros_site.render_raw_var('search_result', search_result) }} {{ macros_site.render_raw_var('form_data', form_data) }} {{ macros_site.render_raw_var('request_args', request_args) }} {{ macros_site.render_raw_var('query_params', query_params) }} {%- endif %} {%- endif %} {%- endblock content %}