This commit is contained in:
Mateusz779 2023-04-19 09:46:53 +02:00
parent 9795f4295f
commit 5e537eee50

View File

@ -77,7 +77,7 @@
<td>{{ machine.image_name }}</td> <td>{{ machine.image_name }}</td>
<td>{{ machine.start_time }}</td> <td>{{ machine.start_time }}</td>
<td>{{ machine.ip }}</td> <td>{{ machine.ip }}</td>
<td><button onclick="ssh('{{ machine.ip, machine.username, machine.password }}')">SSH</button></td> <td><button onclick="ssh({{ machine.ip, machine.username, machine.password }})">SSH</button></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -87,9 +87,10 @@
function ssh(ipvpn, username, password) { function ssh(ipvpn, username, password) {
const currentLocation = window.location; const currentLocation = window.location;
console.log("dziala");
// budowanie nowego URL // budowanie nowego URL
const newUrl = currentLocation.protocol + '//' + currentLocation.hostname + ':' + ssh_port + "/?hostname="+ipvpn+"&username="+username+"&password="+btoa(password); const newUrl = currentLocation.protocol + '//' + currentLocation.hostname + ':' + ssh_port + "/?hostname="+ipvpn+"&username="+username+"&password="+btoa(password);
console.log(newUrl);
// przekierowanie na nowy URL // przekierowanie na nowy URL
window.location.replace(newUrl); window.location.replace(newUrl);