Working settings file! (partially)

This commit is contained in:
Slatian
2023-02-18 22:16:09 +01:00
parent 2394d90087
commit 645a0eed69
8 changed files with 478 additions and 39 deletions

View File

@ -8,30 +8,36 @@
<body>
<h1>Lookup for: {{ q.name }}</h1>
{% if r.a %}
<p>A (IPv4) records:</p>
<p><code>A</code> (IPv4) records:</p>
<ul>
{% for address in r.a%}
<li><code>{{address}}</code></li>
<li><code><a href="/ip?ip={{address}}">{{address}}</a></code></li>
{% endfor %}
</ul>
{% else %}
<p>No <code>A</code> (IPv4) Records.</p>
{% endif %}
{% if r.aaaa %}
<p>AAAA (IPv6) records:</p>
<p><code>AAAA</code> (IPv6) records:</p>
<ul>
{% for address in r.aaaa%}
<li><code>{{address}}</code></li>
<li><code><a href="/ip?ip={{address}}">{{address}}</a></code></li>
{% endfor %}
</ul>
{% else %}
<p>No <code>AAAA</code> (IPv6) Records.</p>
{% endif %}
{% if r.mx %}
<p>MX (Mail Exchange) records:</p>
<p><code>MX</code> (Mail Exchange) records:</p>
<ul>
{% for mx in r.mx%}
<li>{{mx.preference}} <code><a href="/dig?name={{mx.exchange}}">{{mx.exchange}}</a></code></li>
{% endfor %}
</ul>
{% else %}
<p>No <code>MX</code> (Mail Exchange) records.</p>
{% endif %}
</body>

57
templates/ip.html Normal file
View File

@ -0,0 +1,57 @@
{% import "helpers.html" as helper %}
<!DOCTYPE html>
<html>
<head>
<title>{{ data.query.ip }}</title>
</head>
<body>
{% set r = data.result %}
<h1>About IP-Address: {{ data.query.ip }}</h1>
<section>
<h2>Network Information</h2>
<dl>
{% if r.hostname %}
<dh>Hostname</dh>
<dd><a href="/dig?name={{r.hostname}}">{{r.hostname}}</a></dd>
{% endif %}
{% if r.asn %}
<dh><abbr="Autonomous System Number">ASN</abbr></dh>
<dd>AS{{r.asn.asn}}</dd>
<dh>AS Name</dh>
<dd>{{ r.asn.name }}</dd>
</dl>
{% endif %}
</section>
{% if r.location %}
<section>
<h2>Geolocation</h2>
<dl>
{{ helper::place_dl(place=r.location.continent, label="Continent") }}
{{ helper::place_dl(place=r.location.country, label="Country") }}
{{ helper::place_dl(place=r.location.registered_country, label="Registred in") }}
{{ helper::place_dl(place=r.location.represented_country, label="Represents") }}
{% if r.location.subdivisions %}
{% for sd in r.location.subdivisions %}
{{ helper::place_dl(place=sd, label="Subdivision", iso_code_prefix=r.location.country.iso_code|default(value="")) }}
{% endfor %}
{% endif %}
{{ helper::place_dl(place=r.location.city, label="City") }}
{% if r.location.postal_code %}
<dh>Postal Code</dh>
<dd>{{r.location.postal_code}}</dd>
{% endif %}
{% if r.location.time_zone %}
<dh>Timezone</dh>
<dd>{{r.location.time_zone}}</dd>
{% endif %}
</dl>
<!--We have to put that there to comply with maxminds licensing-->
<p><small>
The GeopIP and ASN information is provided by the GeoLite2 database created by
<a target="_blank" href="https://www.maxmind.com">MaxMind</a>.
</small></p>
</section>
{% endif %}
</body>
</html>