Indent and formatting

This commit is contained in:
Eduardo Silva 2025-03-13 08:43:49 -03:00
parent a61b0128ec
commit e386b3f269

View File

@ -2,16 +2,16 @@
{% block content %} {% block content %}
<div class="container mt-3"> <div class="container mt-3">
<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">{{ form.instance.pk|yesno:"Edit User,Create New User" }}</h3> <h3 class="card-title">{{ form.instance.pk|yesno:"Edit User,Create New User" }}</h3>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<form method="post"> <form method="post">
{% csrf_token %} {% csrf_token %}
<div class="form-group"> <div class="form-group">
<label for="id_description">Description</label> <label for="id_description">Description</label>
@ -25,7 +25,6 @@
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="id_port">Port</label> <label for="id_port">Port</label>
<input type="number" class="form-control" id="id_port" name="port" value="{{ form.port.value|default_if_none:'' }}"> <input type="number" class="form-control" id="id_port" name="port" value="{{ form.port.value|default_if_none:'' }}">
@ -43,7 +42,6 @@
<option value="ipAddress" {% if instance.ip_address %}selected{% endif %}>IP Address</option> <option value="ipAddress" {% if instance.ip_address %}selected{% endif %}>IP Address</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="id_peer">Peer</label> <label for="id_peer">Peer</label>
@ -85,12 +83,8 @@
<a href="/firewall/port_forward/" class="btn btn-outline-secondary">Back</a> <a href="/firewall/port_forward/" class="btn btn-outline-secondary">Back</a>
{% if instance %}<a href='javascript:void(0)' class='btn btn-outline-danger' data-command='delete' onclick='openCommandDialog(this)'>Delete Rule</a>{% endif %} {% if instance %}<a href='javascript:void(0)' class='btn btn-outline-danger' data-command='delete' onclick='openCommandDialog(this)'>Delete Rule</a>{% endif %}
</form> </form>
</div> </div>
<div class="col-md-8"> <div class="col-md-8">
<h5>Default Ports</h5> <h5>Default Ports</h5>
<p>The default <code>docker-compose.yml</code> file specifies the <b>TCP</b> port range <b>8080-8089</b>. If you wish to change the port forwarding to a different range, you must manually edit the <code>docker-compose.yml</code> file and rerun the Docker Compose step outlined in the <a href="https://github.com/eduardogsilva/wireguard_webadmin?tab=readme-ov-file#deployment">deployment instructions</a>.</p> <p>The default <code>docker-compose.yml</code> file specifies the <b>TCP</b> port range <b>8080-8089</b>. If you wish to change the port forwarding to a different range, you must manually edit the <code>docker-compose.yml</code> file and rerun the Docker Compose step outlined in the <a href="https://github.com/eduardogsilva/wireguard_webadmin?tab=readme-ov-file#deployment">deployment instructions</a>.</p>
@ -108,20 +102,15 @@
<p>This serves as a temporary solution when a peer does not use the VPN as its default gateway. It's important to note that this configuration is not recommended, as it alters the source address of all connections to match the IP address of the WireGuard instance.</p> <p>This serves as a temporary solution when a peer does not use the VPN as its default gateway. It's important to note that this configuration is not recommended, as it alters the source address of all connections to match the IP address of the WireGuard instance.</p>
</div> </div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
{% endblock %} {% endblock %}
{% block custom_page_scripts %} {% block custom_page_scripts %}
<script> <script>
function adjustVisibilityBasedOnDestinationType() { function adjustVisibilityBasedOnDestinationType() {
var selectedType = document.getElementById("destinationType").value; var selectedType = document.getElementById("destinationType").value;
var peerField = document.getElementById("id_peer").closest(".form-group"); var peerField = document.getElementById("id_peer").closest(".form-group");
@ -147,11 +136,9 @@
// E também na mudança do campo // E também na mudança do campo
document.getElementById("destinationType").addEventListener("change", adjustVisibilityBasedOnDestinationType); document.getElementById("destinationType").addEventListener("change", adjustVisibilityBasedOnDestinationType);
</script> </script>
<script>
<script>
function openCommandDialog(element) { function openCommandDialog(element) {
var command = element.getAttribute('data-command'); var command = element.getAttribute('data-command');
var confirmation = prompt("Please type '{{ instance.protocol }}{{ instance.port }}' to remove this rule."); var confirmation = prompt("Please type '{{ instance.protocol }}{{ instance.port }}' to remove this rule.");
@ -160,6 +147,6 @@
window.location.href = url; window.location.href = url;
} }
} }
</script> </script>
{% endblock %} {% endblock %}