Zdalne-systemy-z-kit-uVPN/templates/index.html
Mateusz779 bfd11c6d7d navbar
2023-04-19 12:50:49 +02:00

101 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Panel administracyjny</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<style>
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;
}
</style>
</head>
<body>
{% extends 'navbar.html' %}
<div class="container">
<h1 class="my-5">Lista maszyn</h1>
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Nazwa maszyny(token)</th>
<th>Obraz</th>
<th>Czas uruchomienia ({{ timezone }})</th>
<th>IP uVPN</th>
<th>IP lokalne</th>
<th></th>
</tr>
</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>
<td><button class="btn btn-primary" onclick="ssh('{{ machine.ipvpn }}', '{{ machine.username }}', '{{ machine.password }}')">SSH</button></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script>
function ssh(ipvpn, username, password) {
const currentLocation = window.location;
const newUrl = currentLocation.protocol + '//' + currentLocation.hostname + ':' + {{ ssh_port }} + "/?hostname="+ipvpn+"&username="+username+"&password="+btoa(password);
window.open(newUrl,"_blank");
}
</script>
</body>
</html>