add routing templates management views and templates

This commit is contained in:
Eduardo Silva
2026-01-16 14:31:04 -03:00
parent c29037779b
commit b37c871bcb
7 changed files with 232 additions and 1 deletions

View File

@@ -146,6 +146,16 @@
</a>
</li>
<li class="nav-item">
<a href="/routing-templates/list/"
class="nav-link {% if '/routing-templates/' in request.path %}active{% endif %}">
<i class="fas fa-route nav-icon"></i>
<p>
{% trans 'Routing Templates' %}
</p>
</a>
</li>
<li class="nav-item">
<a href="/vpn_invite/" class="nav-link {% if '/vpn_invite/' in request.path %}active{% endif %}">
<i class="fas fa-share-square nav-icon"></i>

View File

@@ -0,0 +1,42 @@
{% extends "base.html" %}
{% load i18n %}
{% block content %}
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{% trans 'Name' %}</th>
<th>{% trans 'WireGuard Instance' %}</th>
<th>{% trans 'Route Type' %}</th>
<th class="text-center">{% trans 'Default' %}</th>
<th class="text-center">{% trans 'Updated' %}</th>
<th class="text-center"><i class="far fa-edit"></i></th>
</tr>
</thead>
<tbody>
{% for template in routing_templates %}
<tr>
<td>{{ template.name }}</td>
<td>{{ template.wireguard_instance }}</td>
<td>{{ template.get_route_type_display }}</td>
<td class="text-center">
{% if template.default_template %}
<i class="fas fa-check text-success" title="{% trans 'Default Template' %}"></i>
{% endif %}
</td>
<td class="text-center">{{ template.updated|date:"SHORT_DATE_FORMAT" }}</td>
<td class="text-center" style="width: 1%; white-space: nowrap;">
<a href="/routing-templates/manage/?uuid={{ template.uuid }}" title="{% trans 'Edit' %}"><i class="far fa-edit"></i></a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="row">
<div class="col-md-12">
<a href="/routing-templates/manage/" class="btn btn-primary"><i class="fas fa-plus"></i> {% trans 'Add Routing Template' %}</a>
</div>
</div>
{% endblock %}