2023-04-19 10:58:31 +00:00
|
|
|
{% extends "base.html" %}
|
|
|
|
{% block title %}Panel administracyjny{% endblock %}
|
|
|
|
{% block style %}
|
2023-04-19 10:27:09 +00:00
|
|
|
body {
|
|
|
|
font-family: Arial, sans-serif;
|
|
|
|
background-color: #f5f5f5;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
font-size: 32px;
|
|
|
|
font-weight: bold;
|
|
|
|
color: #333;
|
|
|
|
margin: 20px 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
table {
|
|
|
|
border-collapse: collapse;
|
|
|
|
margin: 20px 0;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
table th, table td {
|
|
|
|
padding: 10px;
|
|
|
|
text-align: left;
|
|
|
|
vertical-align: middle;
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
}
|
|
|
|
|
|
|
|
table th {
|
|
|
|
background-color: #eee;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
table tr:hover {
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
}
|
|
|
|
|
|
|
|
button {
|
|
|
|
background-color: #4CAF50;
|
|
|
|
border: none;
|
|
|
|
color: white;
|
|
|
|
padding: 10px 20px;
|
|
|
|
text-align: center;
|
|
|
|
text-decoration: none;
|
|
|
|
display: inline-block;
|
|
|
|
font-size: 16px;
|
|
|
|
margin: 10px 0;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
button:hover {
|
|
|
|
background-color: #3e8e41;
|
|
|
|
}
|
|
|
|
|
2023-04-19 10:58:31 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
|
|
{% block content %}
|
2023-04-19 10:12:38 +00:00
|
|
|
<div class="container">
|
2023-04-21 08:46:46 +00:00
|
|
|
<h1 class="my-5 mx-auto">Lista maszyn</h1>
|
2023-04-19 10:12:38 +00:00
|
|
|
<table class="table table-striped table-hover">
|
|
|
|
<thead>
|
2023-04-19 07:43:00 +00:00
|
|
|
<tr>
|
2023-04-19 10:16:23 +00:00
|
|
|
<th>Nazwa maszyny(token)</th>
|
2023-04-19 10:12:38 +00:00
|
|
|
<th>Obraz</th>
|
2023-04-19 10:16:23 +00:00
|
|
|
<th>Czas uruchomienia ({{ timezone }})</th>
|
2023-04-19 10:12:38 +00:00
|
|
|
<th>IP uVPN</th>
|
|
|
|
<th>IP lokalne</th>
|
|
|
|
<th></th>
|
2023-04-19 07:43:00 +00:00
|
|
|
</tr>
|
2023-04-19 10:12:38 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{% for machine in machines %}
|
|
|
|
<tr>
|
|
|
|
<td>{{ machine.name }}</td>
|
|
|
|
<td>{{ machine.image_name }}</td>
|
|
|
|
<td>{{ machine.start_time }}</td>
|
|
|
|
<td>{{ machine.ipvpn }}</td>
|
|
|
|
<td>{{ machine.iplocal }}</td>
|
2023-04-21 08:05:58 +00:00
|
|
|
<td><button class="btn btn-primary" onclick="ssh('{{ machine.ipvpn }}','{{machine.iplocal}}', '{{ machine.username }}', '{{ machine.password }}')">SSH</button></td>
|
2023-04-19 10:12:38 +00:00
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
2023-04-19 07:34:40 +00:00
|
|
|
|
|
|
|
<script>
|
2023-04-21 08:11:58 +00:00
|
|
|
function ssh(ipvpn, iplocal, username, password) {
|
2023-04-19 10:12:38 +00:00
|
|
|
const currentLocation = window.location;
|
2023-04-21 08:05:58 +00:00
|
|
|
let ip = ipvpn != null ? ipvpn : iplocal;
|
|
|
|
const newUrl = currentLocation.protocol + '//' + currentLocation.hostname + ':' + {{ ssh_port }} + "/?hostname="+ip+"&username="+username+"&password="+btoa(password);
|
2023-04-19 10:12:38 +00:00
|
|
|
window.open(newUrl,"_blank");
|
2023-04-19 07:34:40 +00:00
|
|
|
}
|
|
|
|
</script>
|
2023-04-19 10:58:31 +00:00
|
|
|
{% endblock %}
|