You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

192 lines
8.1 KiB
Plaintext

{% extends "base_bootstrap.html.twig" %}
9 years ago
9 years ago
{% block head %}
{{ parent() }}
<script src="/js/panel.js"></script>
{% endblock %}
9 years ago
{% block content %}
<div class="container">
9 years ago
<div class="row">
<h2 id="certificates">Certificates</h2>
</div>
9 years ago
<div class="row">
<table class="table">
<thead>
9 years ago
<tr>
<th>Serial</th>
<th>Name</th>
<th>Expires on</th>
<th>
<a href="/panel/certificates/new" class="btn btn-default pull-right">Create new certificate</a>
</th>
</tr>
</thead>
<tbody>
{% for certificate in user.getCertificates() if certificate.getRevoked() == 0 %}
9 years ago
<tr>
9 years ago
<td>
{{ certificate.getSerial() }}
</td>
<td>
{{ certificate.getName() }}
</td>
<td>
{{ certificate.getExpiresOn().format('Y-m-d H:i:s') }}
</td>
<td>
<div class="pull-right">
<button data-name="{{ certificate.getName() }}" class="revoke btn btn-warning">Revoke
</button>
<a target="_blank" href="/panel/certificates/download/{{ certificate.getName() }}"
class="download btn btn-default">Download certificate</a>
</div>
</td>
9 years ago
</tr>
9 years ago
{% else %}
<tr>
<td colspan="4">
You don't seem to have any certificates yet, <a href="/panel/certificates/new">want to
create one?</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
9 years ago
<div class="row">
<h2>Servers</h2>
</div>
<div class="row">
9 years ago
<table class="table">
<thead>
<tr>
<th>Hostname</th>
<th>Fingerprint</th>
9 years ago
<th>Location</th>
<th>Speed</th>
9 years ago
<th>Actions</th>
</tr>
9 years ago
</thead>
<tbody>
9 years ago
{% for server in servers %}
9 years ago
<tr>
<td>
{{ server.getFqdn() }}
</td>
<td>
{{ server.getFingerprint() }}
</td>
9 years ago
<td>
{{ server.getLocation() }}
</td>
<td>
{{ server.getSpeed() }} MB/s
</td>
9 years ago
<td>
<div class="pull-right">
9 years ago
<div class="btn-group">
<a href="/panel/server/{{ server.getFingerprint() }}/config" class="btn btn-default">Download config</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu">
{% for certificate in user.getCertificates() if certificate.getRevoked() == 0 %}
<li>
<a href="/panel/server/{{ server.getFingerprint() }}/config/{{ certificate.getName() }}">Download config for "{{ certificate.getName() }}"</a>
</li>
{% else %}
<li>
<a>You dont have any certificates</a>
</li>
{% endfor %}
</ul>
</div>
{% if user.isSuperUser() %}
<a href="/panel/server/{{ server.getFingerprint() }}" class="btn btn-default">Edit</a>
{% endif %}
9 years ago
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">
There don't seem to be any servers yet :(
</td>
</tr>
{% endfor %}
9 years ago
</tbody>
</table>
9 years ago
</div>
{% if user.getSuperuser() %}
<div class="row">
<h2>Registered servers</h2>
</div>
<div class="row">
<table class="table">
<thead>
<tr>
<th>Hostname</th>
<th>Fingerprint</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for server in registeredServers %}
<tr>
<td>
{{ server.getFqdn() }}
</td>
<td>
{{ server.getFingerprint() }}
</td>
<td>
<div class="pull-right">
<button data-fingerprint="{{ server.getFingerprint() }}" class="remove btn btn-warning">Remove</button>
<a href="/panel/server/{{ server.getFingerprint() }}" class="btn btn-default">Edit</a>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="5">
There don't seem to be any servers yet :(
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
9 years ago
{% endif %}
</div>
<div class="modal fade in revoke-modal" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">&times;</span></button>
<h4 class="modal-title">Are you sure?</h4>
</div>
<div class="modal-body">
<div id="revoke-put-error-after-me" class="alert alert-danger modal-top-alert">
<h4>This may not be what you want!</h4>
<p>Revoking the certificate means that you <b>can't use</b> the VPN anymore with that
certificate</p>
</div>
<p>If you're really sure that you want to do this please enter your <b>password</b></p>
<div>
<input type="password" class="revoke-password form-control">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-warning revoke-confirm">Revoke</button>
</div>
</div>
9 years ago
</div>
</div>
9 years ago
{% endblock %}