| 1 | {% extends "app.html" %} |
| 2 | {% comment %} |
| 3 | # SPDX-License-Identifier: AGPL-3.0-or-later |
| 4 | {% endcomment %} |
| 5 | |
| 6 | {% load bootstrap %} |
| 7 | {% load i18n %} |
| 8 | {% load extras %} |
| 9 | |
| 10 | {% block extra_content %} |
| 11 | <h3>{% trans "Domains" %}</h3> |
| 12 | |
| 13 | <div class="btn-toolbar"> |
| 14 | <a href="{% url 'dynamicdns:domain-add' %}" class="btn btn-primary" |
| 15 | role="button" title="{% trans 'Add Domain' %}"> |
| 16 | {% icon 'plus' %} |
| 17 | {% trans 'Add Domain' %} |
| 18 | </a> |
| 19 | </div> |
| 20 | |
| 21 | {% if domains_status %} |
| 22 | <div class="table-responsive domains-status"> |
| 23 | <table class="table"> |
| 24 | <thead> |
| 25 | <tr> |
| 26 | <th>{% trans "Domain" %}</th> |
| 27 | <th>{% trans "Last update" %}</th> |
| 28 | <th>{% trans "Result" %}</th> |
| 29 | <th>{% trans "IP Addresses" %}</th> |
| 30 | <th>{% trans "Actions" %}</th> |
| 31 | </tr> |
| 32 | </thead> |
| 33 | <tbody> |
| 34 | {% for domain in domains_status.values %} |
| 35 | <tr> |
| 36 | <td class="domain-name"> |
| 37 | <a href="{% url 'dynamicdns:domain-edit' domain.domain %}" |
| 38 | title="{% blocktrans trimmed with domain=domain.domain %} |
| 39 | Edit domain {{ domain }} |
| 40 | {% endblocktrans %}"> |
| 41 | {{ domain.domain }} |
| 42 | </a> |
| 43 | </td> |
| 44 | <td> |
| 45 | {% if domain.timestamp %} |
| 46 | {{ domain.timestamp|timesince }} |
| 47 | {% else %} |
| 48 | {% trans "Not yet" %} |
| 49 | {% endif %} |
| 50 | </td> |
| 51 | <td> |
| 52 | {% if domain.result %} |
| 53 | <span class="badge text-bg-success"> |
| 54 | {% trans "Success" %} |
| 55 | </span> |
| 56 | {% elif not domain.timestamp %} |
| 57 | - |
| 58 | {% else %} |
| 59 | <span class="badge text-bg-warning"> |
| 60 | {% trans "Failed" %} |
| 61 | </span> |
| 62 | {% endif %} |
| 63 | {% if domain.error_message %} |
| 64 | ({{ domain.error_message }}) |
| 65 | {% elif domain.error_code %} |
| 66 | ({{ domain.error_code }}) |
| 67 | {% endif %} |
| 68 | </td> |
| 69 | <td><pre>{% for ip_address in domain.ip_addresses %}{{ ip_address }} |
| 70 | {% empty %}- |
| 71 | {% endfor %}</pre></td> |
| 72 | <td> |
| 73 | <a href="{% url 'dynamicdns:domain-edit' domain.domain %}" |
| 74 | class="btn btn-default btn-sm domain-edit" role="button" |
| 75 | title="{% blocktrans trimmed with domain=domain.domain %} |
| 76 | Edit domain {{ domain }} |
| 77 | {% endblocktrans %}"> |
| 78 | {% icon 'pencil-square-o' %} |
| 79 | </a> |
| 80 | <a href="{% url 'dynamicdns:domain-delete' domain.domain %}" |
| 81 | class="btn btn-default btn-sm domain-delete" role="button" |
| 82 | title="{% blocktrans trimmed with domain=domain.main %} |
| 83 | Delete domain {{ domain }} |
| 84 | {% endblocktrans %}"> |
| 85 | {% icon 'trash' %} |
| 86 | </a> |
| 87 | </td> |
| 88 | </tr> |
| 89 | {% endfor %} |
| 90 | </tbody> |
| 91 | </table> |
| 92 | </div> |
| 93 | {% else %} |
| 94 | <p>{% trans "No domains configured." %}</p> |
| 95 | {% endif %} |
| 96 | {% endblock %} |