Skip to content
Snippets Groups Projects
Commit ac2ff8a7 authored by leo.muff's avatar leo.muff
Browse files

frontend ptdr

parent 90e80dae
No related branches found
No related tags found
No related merge requests found
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<a href="/newcommand/{{id}}"> Commands </a> <div class="mt-4" style="text-align:center">
<div> <h2>Info from client @ {{client}}</h3>
<h3>Info from client @ {{client}}</h3> <a href="/newcommand/{{id}}" class="m-2 mb-4 text-center btn btn-secondary active" role="button" aria-pressed="true" > Commands </a>
</div>
<div class="mx-auto w-75 border p-5" >
<div class="row">
<div class="col">
<h3 style="margin-bottom:90px">System Info</h3>
<div class="card" > <div class="card" >
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
<li class="list-group-item"><b>Adresse :</b> {{info.socket_addr}}</li> <li class="list-group-item"><b>Adresse :</b> {{info.socket_addr}}</li>
...@@ -13,8 +18,9 @@ ...@@ -13,8 +18,9 @@
<li class="list-group-item"><b>Kernel :</b> {{info.kernel}}</li> <li class="list-group-item"><b>Kernel :</b> {{info.kernel}}</li>
</ul> </ul>
</div> </div>
</div>
<div class="col">
<h3>Open Ports</h3> <h3>Open Ports</h3>
<div>
<table class="table" id="ports" name="ports"> <table class="table" id="ports" name="ports">
<thead> <thead>
<tr> <tr>
...@@ -33,9 +39,10 @@ ...@@ -33,9 +39,10 @@
</table> </table>
</div> </div>
</div> </div>
<h3>Data sent</h3> </div>
<div> <h3 class="mt-5" style="text-align:center">Data sent</h3>
<table class="table"> <div class="w-75 mx-auto mt-2">
<table class="table" id="data">
<thead> <thead>
<tr> <tr>
<th scope="col">Id</th> <th scope="col">Id</th>
...@@ -60,5 +67,6 @@ ...@@ -60,5 +67,6 @@
<script src="/static/datatables/datatables.min.js"></script> <script src="/static/datatables/datatables.min.js"></script>
<script> <script>
new DataTable('#ports'); new DataTable('#ports');
new DataTable('#data');
</script> </script>
{% endblock scripts %} {% endblock scripts %}
\ No newline at end of file
{% extends "base" %} {% extends "base" %}
{% block content %} {% block content %}
<h2>Registered clients</h2> <h2 class="m-4">Registered clients</h2>
<div> <div class="w-75 mx-auto mt-5">
<table class="table"> <table class="table border">
<thead> <thead>
<tr> <tr>
<th scope="col">Id</th> <th scope="col">Id</th>
...@@ -16,20 +16,9 @@ ...@@ -16,20 +16,9 @@
<tr> <tr>
<th scope="row">{{client.id}}</th> <th scope="row">{{client.id}}</th>
<td>{{client.address}}</td> <td>{{client.address}}</td>
<td><a href="client/{{client.id}}"> Data </a></td> <td><a href="client/{{client.id}}" class="btn btn-secondary active" role="button" aria-pressed="true"> Data </a></td>
<td> <td>
<form action="/newcommand" method="post"> <a href="/newcommand/{{client.id}}" class="btn btn-secondary active" role="button" aria-pressed="true"> Commands </a>
<label for="command">Choose a command :</label>
<select id="command" name="command">
{% for c in commands %}
<option value="{{loop.index}}">{{c}}</option>
{% endfor %}
</select>
<input type="text" placeholder="Option" name=option/>
<input name="client_id" type="hidden" value={{client.id}} />
<input type="submit" />
</form>
<a href="/newcommand/{{client.id}}"> Commands </a>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
......
...@@ -35,7 +35,6 @@ impl fmt::Display for ClientError { ...@@ -35,7 +35,6 @@ impl fmt::Display for ClientError {
Self::InvalidHeader(e) => write!(f,"Error setting custom header : {:?}", e), Self::InvalidHeader(e) => write!(f,"Error setting custom header : {:?}", e),
Self::SysinfoError(e) => write!(f, "Error sending data : cannot get info from system : {}", e), Self::SysinfoError(e) => write!(f, "Error sending data : cannot get info from system : {}", e),
Self::OtherError => write!(f, "Error sending data : not specified") Self::OtherError => write!(f, "Error sending data : not specified")
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment