Sunil Mohan Adapa c45bdf56dd
ui: js: Load all JS files in deferred mode to speed up page load
- This improves page rendering time. If JS files are not loaded in deferred or
async mode, they will halt the page rendering until JS files are loaded from
network.

- 'defer' mode guarantees that the load order is same as the order in which JS
files appeared in the HTML page.

Tests:

- Run at least one function of each affected JS file and ensure that is works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2025-01-07 12:08:51 +02:00

60 lines
1.7 KiB
HTML

{% extends "app.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% load static %}
{% block page_js %}
<script type="text/javascript" src="{% static 'dynamicdns/dynamicdns.js' %}"
defer></script>
{% endblock %}
{% block extra_content %}
<h3>{% trans "Status" %}</h3>
{% if domains_status %}
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>{% trans "Domain" %}</th>
<th>{% trans "Last update" %}</th>
<th>{% trans "Result" %}</th>
<th>{% trans "IP Address" %}</th>
</tr>
</thead>
<tbody>
{% for domain in domains_status.values %}
<tr>
<td>{{ domain.domain }}</td>
<td>{{ domain.timestamp|timesince }}</td>
<td>
{% if domain.result %}
<span class="badge text-bg-success">
{% trans "Success" %}
</span>
{% else %}
<span class="badge text-bg-warning">
{% trans "Failed" %}
</span>
{% endif %}
{% if domain.error_message %}
({{ domain.error_message }})
{% elif domain.error_code %}
({{ domain.error_code }})
{% endif %}
</td>
<td>{{ domain.ip_address|default_if_none:'-' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
{% trans "No status available." %}
{% endif %}
{% endblock %}