mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2025-04-19 08:55:12 +00:00
better placeholder for status page
This commit is contained in:
parent
cac0c9f280
commit
1b1b97d874
@ -1,5 +1,28 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
this page is just a placeholder for the moment
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-lg-12'>
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">WireGuard Status</h3>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class='row'>
|
||||
<div class='col-md-12'>
|
||||
<pre>{{command_output}}</pre>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<p style="text-align: right" class="small">
|
||||
This is just a placeholder for the WireGuard status page. It will be updated with more information in the near future.
|
||||
</p>
|
||||
|
||||
{% endblock %}
|
||||
|
@ -75,7 +75,15 @@ def view_welcome(request):
|
||||
@login_required
|
||||
def view_wireguard_status(request):
|
||||
page_title = 'WireGuard Status'
|
||||
context = {'page_title': page_title}
|
||||
bash_command = ['bash', '-c', 'wg show']
|
||||
try:
|
||||
command_output = subprocess.check_output(bash_command, stderr=subprocess.STDOUT).decode('utf-8')
|
||||
command_success = True
|
||||
except subprocess.CalledProcessError as e:
|
||||
command_output = e.output.decode('utf-8')
|
||||
command_success = False
|
||||
|
||||
context = {'page_title': page_title, 'command_output': command_output, 'command_success': command_success}
|
||||
return render(request, 'wireguard/wireguard_status.html', context)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user