improve identation

This commit is contained in:
Eduardo Silva
2026-01-26 14:00:53 -03:00
parent 5b21f24b7c
commit a0d813d389

View File

@@ -3,7 +3,7 @@
{% block content %} {% block content %}
<div class="card card-primary card-outline"> <div class="card card-primary card-outline">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">{% trans 'Peer Configuration' %}</h3> <h3 class="card-title">{% trans 'Peer Configuration' %}</h3>
</div> </div>
@@ -92,10 +92,13 @@
</div> </div>
<center> <center>
<img id="graphImg" src="/rrd/graph/?peer={{ current_peer.uuid }}{% if request.GET.period %}&period={{ request.GET.period }}{% endif %}" class="img-fluid" alt="{% trans 'No traffic history, please wait a few minutes' %}" onerror="this.onerror=null; this.style.display='none'; this.insertAdjacentHTML('afterend', this.alt);"> <img id="graphImg" src="/rrd/graph/?peer={{ current_peer.uuid }}{% if request.GET.period %}&period={{ request.GET.period }}{% endif %}"
class="img-fluid" alt="{% trans 'No traffic history, please wait a few minutes' %}"
onerror="this.onerror=null; this.style.display='none'; this.insertAdjacentHTML('afterend', this.alt);">
</center> </center>
<div class="d-flex justify-content-between align-items-center border-bottom mb-3" style="padding-top: 16px;"></div> <div class="d-flex justify-content-between align-items-center border-bottom mb-3"
style="padding-top: 16px;"></div>
</div> </div>
</div> </div>
@@ -107,7 +110,10 @@
<i class="fas fa-info-circle" title="{% trans 'AllowedIPs at Peer section of wg' %}{{ current_peer.wireguard_instance.instance_id }}.conf"></i> <i class="fas fa-info-circle" title="{% trans 'AllowedIPs at Peer section of wg' %}{{ current_peer.wireguard_instance.instance_id }}.conf"></i>
{% trans 'Peer IP Addresses and networks' %} {% trans 'Peer IP Addresses and networks' %}
</label> </label>
<a class="btn btn-outline-primary btn-xs" href="/peer/manage_ip_address/?peer={{ current_peer.uuid }}&config=server" >{% trans 'Add IP Address' %}</a> <a class="btn btn-outline-primary btn-xs"
href="/peer/manage_ip_address/?peer={{ current_peer.uuid }}&config=server">
{% trans 'Add IP Address' %}
</a>
</div> </div>
{% for ip_address in peer_ip_list %} {% for ip_address in peer_ip_list %}
@@ -115,7 +121,7 @@
<p> <p>
<a href="/peer/manage_ip_address/?ip={{ ip_address.uuid }}"> <a href="/peer/manage_ip_address/?ip={{ ip_address.uuid }}">
<i class="fas fa-network-wired"></i> <i class="fas fa-network-wired"></i>
{{ ip_address}} {{ ip_address }}
</a> </a>
</p> </p>
<p class="d-flex flex-column text-right small"> <p class="d-flex flex-column text-right small">
@@ -134,12 +140,19 @@
<div class="col-md-12"> <div class="col-md-12">
<div class="d-flex justify-content-between align-items-center"> <div class="d-flex justify-content-between align-items-center">
<label> <label>
<i class="fas fa-info-circle" title="{% trans 'AllowedIPs at client configuration file' %}"></i> <i class="fas fa-info-circle"
title="{% trans 'AllowedIPs at client configuration file' %}"></i>
{% trans 'Client Routing' %} {% trans 'Client Routing' %}
</label> </label>
<div> <div>
<a class="btn btn-outline-info btn-xs" href="/peer/apply_route_template/?peer={{ current_peer.uuid }}" >{% trans 'Apply template' %}</a> <a class="btn btn-outline-info btn-xs"
<a class="btn btn-outline-primary btn-xs" href="/peer/manage_ip_address/?peer={{ current_peer.uuid }}&config=client" >{% trans 'Add Client route' %}</a> href="/peer/apply_route_template/?peer={{ current_peer.uuid }}">
{% trans 'Apply template' %}
</a>
<a class="btn btn-outline-primary btn-xs"
href="/peer/manage_ip_address/?peer={{ current_peer.uuid }}&config=client">
{% trans 'Add Client route' %}
</a>
</div> </div>
</div> </div>
@@ -158,9 +171,9 @@
{% for ip_address in current_peer.routing_template.template_routes %} {% for ip_address in current_peer.routing_template.template_routes %}
<div class="d-flex justify-content-between align-items-center text-muted"> <div class="d-flex justify-content-between align-items-center text-muted">
<p> <p>
<span > <span>
<i class="fas fa-network-wired"></i> <i class="fas fa-network-wired"></i>
{{ ip_address}} {{ ip_address }}
</span> </span>
</p> </p>
<p class="d-flex flex-column text-right small"> <p class="d-flex flex-column text-right small">
@@ -180,7 +193,6 @@
{% else %} {% else %}
onclick="alert('{% trans 'The client is configured to use the VPN as the default gateway. \n\nThis setting routes all client internet traffic through the VPN, enhancing privacy and security across all connections.' %}');" onclick="alert('{% trans 'The client is configured to use the VPN as the default gateway. \n\nThis setting routes all client internet traffic through the VPN, enhancing privacy and security across all connections.' %}');"
{% endif %} {% endif %}
> >
<i class="fas fa-network-wired"></i> <i class="fas fa-network-wired"></i>
0.0.0.0/0, ::/0 0.0.0.0/0, ::/0
@@ -198,7 +210,7 @@
<p> <p>
<a href="/peer/manage_ip_address/?ip={{ ip_address.uuid }}"> <a href="/peer/manage_ip_address/?ip={{ ip_address.uuid }}">
<i class="fas fa-network-wired"></i> <i class="fas fa-network-wired"></i>
{{ ip_address}} {{ ip_address }}
</a> </a>
</p> </p>
<p class="d-flex flex-column text-right small"> <p class="d-flex flex-column text-right small">
@@ -215,21 +227,23 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<a class="btn btn-outline-secondary" href="/peer/list/?uuid={{ current_peer.wireguard_instance.uuid }}#peer-{{ current_peer.public_key }}">{% trans 'Back' %}</a> <a class="btn btn-outline-secondary"
<a href='javascript:void(0)' class='btn btn-outline-danger' data-command='delete' onclick='openCommandDialog(this)'>{% trans 'Delete Peer' %}</a> href="/peer/list/?uuid={{ current_peer.wireguard_instance.uuid }}#peer-{{ current_peer.public_key }}">
{% trans 'Back' %}
</a>
<a href='javascript:void(0)' class='btn btn-outline-danger' data-command='delete'
onclick='openCommandDialog(this)'>{% trans 'Delete Peer' %}</a>
</div>
</div> </div>
</div>
{% endblock %} {% endblock %}
{% block custom_page_scripts %} {% block custom_page_scripts %}
<script> <script>
function openCommandDialog(element) { function openCommandDialog(element) {
var command = element.getAttribute('data-command'); var command = element.getAttribute('data-command');
var confirmation = prompt("{% trans 'Please type \"delete\" to remove peer configuration.' %}"); var confirmation = prompt("{% trans 'Please type \"delete\" to remove peer configuration.' %}");
@@ -238,23 +252,23 @@
window.location.href = url; window.location.href = url;
} }
} }
</script> </script>
<script> <script>
document.addEventListener('DOMContentLoaded', function(){ document.addEventListener('DOMContentLoaded', function () {
var buttons = document.querySelectorAll('.btn-group a'); var buttons = document.querySelectorAll('.btn-group a');
buttons.forEach(function(button){ buttons.forEach(function (button) {
button.addEventListener('click', function(e){ button.addEventListener('click', function (e) {
e.preventDefault(); e.preventDefault();
var period = this.getAttribute('data-period'); var period = this.getAttribute('data-period');
var newSrc = '/rrd/graph/?peer={{ current_peer.uuid }}&period=' + period; var newSrc = '/rrd/graph/?peer={{ current_peer.uuid }}&period=' + period;
var imgElement = document.getElementById('graphImg'); var imgElement = document.getElementById('graphImg');
if(imgElement){ if (imgElement) {
imgElement.setAttribute('src', newSrc); imgElement.setAttribute('src', newSrc);
} }
}); });
}); });
}); });
</script> </script>
{% endblock %} {% endblock %}