Console OpenVPN, développée en Django Permet de gérer des instances, serveurs, et comptes OpenVPN
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

112 lines
4.8 KiB

{% extends "ovpnconsole/base.html" %}
{% block title %}Détail du serveur OpenVPN{% endblock %}
{% block menu_top %}
{% if user.is_authenticated %}
<li><a href="{% url admin_page %}">Administration</a></li>
<li><a href="{% url logout %}">Deconnexion</a></li>
{% else %}
<li><a href="{% url login %}">Connexion</a></li>
{% endif %}
{% endblock %}
{% block navigation %}
<i>{{ object.ovpnauthority.ovpnsite }} : {{ object.ovpnauthority }} : {{ object.name }}</i>
{% endblock %}
{% block menu %}
<a href="{% url ovpnuser_create object.id %}"> <img src="{{ MEDIA_URL }}images/add.png" />Ajouter un nouvel utilisateur </a>
<a href="{% url ovpnserver_modify object.id %}"> <img src="{{ MEDIA_URL }}images/modify_properties.png" /> Paramètres OpenVPN</a>
<a href="{% url ovpnserver_settings object.id %}"><img src="{{ MEDIA_URL }}images/configure.png"/> Modifier la configuration</a>
{% if object.is_configured %}
<a href="{% url ovpnserver_config_apply object.id %}"> <img src="{{ MEDIA_URL }}images/apply.png" /> Appliquer la configuration </a>
<a href="{% url ovpnserver_restart object.id %}"> <img src="{{ MEDIA_URL }}images/service_restart.png" /> Red&eacute;marrer le service </a>
{% endif %}
<a href="{% url ovpnserver_delete object.id %}"> <img src="{{ MEDIA_URL }}images/delete.png" /> Supprimer le serveur </a>
<a href="{% url ovpnauthority_property object.ovpnauthority.id %}"><img src="{{ MEDIA_URL }}images/back.png" /> Retour</a>
{% endblock %}
{% block contenu %}
{% ifequal detail '1' %}
<h2>D&eacute;tail du serveur : {{ object.name }} ({{ object.ovpnauthority.ovpnsite }}/{{object.ovpnauthority }}) </h2>
<p>Nom : {{ object.name }}</p>
<p>Adresse IP : {{ object.ip_address }}</p>
<p>Port : {{ object.port }}</p>
<p>Protocol : {{ object.protocol }}</p>
<p>Device : {{ object.device }}</p>
<p>Compress Data : {{ object.compress_data }}</p>
<p>Floating Server : {{ object.floating_server }}</p>
<p>Redirect Gateway : {{ object.redirect_gw }}</p>
{% else %}
<h2>Liste des utilisateurs</h2>
<div id="element_list">
<table>
<tr>
<th>Utilisateur</th>
<th>Etat</th>
<th>Actions</th>
</tr>
{% for user in object.ovpnusers_sorted_by_name %}
<tr>
<td>
{{ user.name }} : {{ user.email }}
</td>
<td>
{% if user.is_valid %}
<div class="status_ok">Valide</div>
{% else %}
<div class="status_nok">R&eacute;voqu&eacute;</div>
{% endif %}
</td>
<td>
<div class="action_img">
<a href="{% url ovpnuser_detail user.id %}"><img src="{{ MEDIA_URL }}images/user_properties.png" alt="Informations" title="Informations" /> </a>
<a href="{% url ovpnuser_modify user.id %}"><img src="{{ MEDIA_URL }}images/modify_properties.png" alt="modifier" title="Modifier"/> </a>
{% if user.is_valid %}
<a href="{% url ovpnuser_chpasswd user.id %}"><img src="{{ MEDIA_URL }}images/password.png" alt="Changer mot de passe" title="Changer mot de passe"/> </a>
<a href="/ovpnconsole/user/notify/{{ user.id }}"><img src="{{ MEDIA_URL }}images/send_email.png" alt="Envoi des informations" title="Envoi des informations"/> </a>
<a href="/ovpnconsole/user/revoke/{{ user.id }}"><img src="{{ MEDIA_URL }}images/revoke_user.png" alt="R&eacute;voquer" title="R&eacute;voquer"/> </a>
{% else %}
<a href="/ovpnconsole/user/delete/{{ user.id }}"><img src="{{ MEDIA_URL }}images/delete.png" alt="Supprimer" title="Supprimer"/> </a>
{% endif %}
</div>
</td>
</tr>
{% endfor %}
</table>
<h2>Historiques de connexions</h2>
<table>
<tr>
<th>Utilisateur</th>
<th>IP r&eacute;elle</th>
<th>Adresse VPN</th>
<th>Connection</th>
<th>Deconnexion</th>
<th>Etat</th>
</tr>
{% for line in object.get_last_five_connhist %}
<tr>
<td>{{ line.user_name }}</td>
<td>{{ line.real_ip }}</td>
<td>{{ line.virt_ip }}</td>
<td>{{ line.conn_date }}</td>
<td>{{ line.disc_date }}</td>
{% ifequal line.state 'c' %}
<td class="status_ok">
{% else %}
<td class="status_nok">
{% endifequal %}
{{ line.get_state_display }}</td>
</tr>
{% endfor %}
</table>
<i><a href="/ovpnconsole/server/hist/{{ object.id }}">Voir l'historique complet</a></i>
</div>
<br>
Etat du serveur :
{% ifequal object.is_up_to_date 1 %}
<td>Changements appliqu&eacute;s <img src="{{ MEDIA_URL }}images/state_ok.png" alt="ok" title="ok"/> </td>
{% else %}
<td>Changements non appliqu&eacute;s <img src="{{ MEDIA_URL }}images/state_nok.png" alt="no ok" title="no ok"/> </td>
{% endifequal %}
{% endifequal %}
{% endblock %}