Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
id tmeplate
Browse files Browse the repository at this point in the history
  • Loading branch information
elouanjef committed Jan 31, 2024
1 parent c5956c8 commit c5eb44c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions templates/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<button id="openVncUrl" class="btn btn-light">Mode plein écran <i class="bi bi-box-arrow-up-right"></i></button>
</li>
<li class="nav-item">
<button id="openVncUrl" class="btn btn-light" onclick="refreshVnc()">Rafraîchir l'affichage <i class="bi bi-arrow-clockwise"></i></button>
<button id="refreshVncToken" class="btn btn-light" onclick="refreshVnc()">Rafraîchir l'affichage <i class="bi bi-arrow-clockwise"></i></button>
</li>
</ul>
{% endblock %}
Expand All @@ -18,8 +18,9 @@
<script>

async function refreshVnc() {
var templateId = $("#refreshVncToken").id;
try {
var output = await regenerateUrl();
var output = await regenerateUrl(templateId);
if (output == 1) {
location.reload();
}
Expand All @@ -28,7 +29,7 @@
}
}

function regenerateUrl() {
function regenerateUrl(templateId) {
return new Promise(function (resolve, object) {
$.ajax({
type: 'GET',
Expand Down Expand Up @@ -125,6 +126,7 @@
document.addEventListener("DOMContentLoaded", function () {
var templateId = getParameterByName("templateId");
openVm(templateId);
$("refreshVncToken").id(templateId);

var intervalId = window.setInterval(function(){
active = checkIfVmActive(templateId);
Expand Down

0 comments on commit c5eb44c

Please sign in to comment.