Multiple small template improvements

This commit is contained in:
Slatian
2023-08-06 02:08:54 +02:00
parent cf806ad8f5
commit ae95539c7b
6 changed files with 14 additions and 4 deletions

View File

@ -8,6 +8,7 @@
<li><a href="{{ extra.base_url}}">The homepage</a></li>
<li>The <code>/ip/</code> or <code>/dig/</code> endpoints.</li>
<li><a href="{{ extra.base_url }}/ua">The <code>/ua</code> endpoint wich just displays your user agent.</a></li>
<li><a href="{{ extra.base_url }}/dns_resolver">The list of configured dns resolvers.</a></li>
</ul>
</section>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block path %}dig/{{ data.query | urlencode_strict }}{% endblock %}
{% block content -%}
# dig {{data.query}}
# dig {{data.query}} via {{ data.result.used_dns_resolver }}
{% if data.result.idn -%}
{%- set idn = data.result.idn -%}

View File

@ -17,7 +17,7 @@
{% else %}
{% set ip = a | split(pat=":") | first %}
{% endif %}
<dd>{{ helper::ip(extra=extra, ip=ip) }}</dd>
<dd>{{ helper::ip(extra=extra, ip=ip, text=a) }}</dd>
{%- endfor %}
{%- else %}
<dd>None Configured</dd>
@ -53,5 +53,6 @@
</ul>
<p class="box hint">You can use this DNS server by typing <code>via {{c.aliases | first }}</code> {% if c.aliases | length > 1 %}(or any other alias){% endif %} in the searchfield.</p>
</section>
<p><a href="{{extra.base_url}}/dns_resolver">Back to DNS Resolver list</a></p>
{% endif %}
{% endblock %}

View File

@ -17,8 +17,8 @@
<a href="{{ self::dig_link(extra=extra, name=name) }}">{% if prefix %}{{ prefix }} {% endif %}{% if fqdn or name=="." %}{{ name }}{% else %}{{ name | trim_end_matches(pat=".") }}{% endif %}</a>
{% endmacro dig %}
{% macro ip(extra, ip) %}
<a href="{{ extra.base_url }}/ip/{{ ip | urlencode_strict | replace(from="%2e", to=".") | replace(from="%3a", to=":") | safe }}"><code>{{ ip }}</code></a>
{% macro ip(extra, ip, text="") %}
<a href="{{ extra.base_url }}/ip/{{ ip | urlencode_strict | replace(from="%2e", to=".") | replace(from="%3a", to=":") | safe }}"><code>{{ text | default(value=ip) }}</code></a>
{% endmacro dig %}
{% macro breadcrumb_domain(extra, name) %}

View File

@ -33,5 +33,7 @@
<section>
<h2>Did you know?</h2>
<p>If you share this site and the Link gets a preview. The IP-Address after the dash is the one of the machine that generated that preview.</p>
<p>This service exports a <a href="{{ extra.base_url }}/dns_resolver">list of dns resolvers it supports</a>, with configuration.</p>
<p>Every query that can output html can also output json or plain text using the <code>?format=json</code> or <code>?format=text</code> url parameters?</p>
</section>
{% endblock %}