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 %}
<div class="card card-primary card-outline">
<div class="card card-primary card-outline">
<div class="card-header">
<h3 class="card-title">{% trans 'Peer Configuration' %}</h3>
</div>
@@ -92,10 +92,13 @@
</div>
<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>
<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>
@@ -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>
{% trans 'Peer IP Addresses and networks' %}
</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>
{% for ip_address in peer_ip_list %}
@@ -115,7 +121,7 @@
<p>
<a href="/peer/manage_ip_address/?ip={{ ip_address.uuid }}">
<i class="fas fa-network-wired"></i>
{{ ip_address}}
{{ ip_address }}
</a>
</p>
<p class="d-flex flex-column text-right small">
@@ -134,12 +140,19 @@
<div class="col-md-12">
<div class="d-flex justify-content-between align-items-center">
<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' %}
</label>
<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-primary btn-xs" href="/peer/manage_ip_address/?peer={{ current_peer.uuid }}&config=client" >{% trans 'Add Client route' %}</a>
<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-primary btn-xs"
href="/peer/manage_ip_address/?peer={{ current_peer.uuid }}&config=client">
{% trans 'Add Client route' %}
</a>
</div>
</div>
@@ -158,9 +171,9 @@
{% for ip_address in current_peer.routing_template.template_routes %}
<div class="d-flex justify-content-between align-items-center text-muted">
<p>
<span >
<span>
<i class="fas fa-network-wired"></i>
{{ ip_address}}
{{ ip_address }}
</span>
</p>
<p class="d-flex flex-column text-right small">
@@ -180,7 +193,6 @@
{% 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.' %}');"
{% endif %}
>
<i class="fas fa-network-wired"></i>
0.0.0.0/0, ::/0
@@ -198,7 +210,7 @@
<p>
<a href="/peer/manage_ip_address/?ip={{ ip_address.uuid }}">
<i class="fas fa-network-wired"></i>
{{ ip_address}}
{{ ip_address }}
</a>
</p>
<p class="d-flex flex-column text-right small">
@@ -215,21 +227,23 @@
</div>
</div>
</div>
</div>
<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 href='javascript:void(0)' class='btn btn-outline-danger' data-command='delete' onclick='openCommandDialog(this)'>{% trans 'Delete Peer' %}</a>
<a class="btn btn-outline-secondary"
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>
{% endblock %}
{% block custom_page_scripts %}
<script>
<script>
function openCommandDialog(element) {
var command = element.getAttribute('data-command');
var confirmation = prompt("{% trans 'Please type \"delete\" to remove peer configuration.' %}");
@@ -238,23 +252,23 @@
window.location.href = url;
}
}
</script>
</script>
<script>
document.addEventListener('DOMContentLoaded', function(){
<script>
document.addEventListener('DOMContentLoaded', function () {
var buttons = document.querySelectorAll('.btn-group a');
buttons.forEach(function(button){
button.addEventListener('click', function(e){
buttons.forEach(function (button) {
button.addEventListener('click', function (e) {
e.preventDefault();
var period = this.getAttribute('data-period');
var newSrc = '/rrd/graph/?peer={{ current_peer.uuid }}&period=' + period;
var imgElement = document.getElementById('graphImg');
if(imgElement){
if (imgElement) {
imgElement.setAttribute('src', newSrc);
}
});
});
});
</script>
});
</script>
{% endblock %}