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

Commit

Permalink
remove useless console debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
elouanjef committed Jan 25, 2024
1 parent f30ae19 commit 142cd30
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 39 deletions.
8 changes: 0 additions & 8 deletions templates/admin.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ <h1 class="text-left">Templates de VMs</h1>
withCredentials: true
},
success: function (response) {
console.log(response);
hideLoadingModal();
location.reload();
},
Expand All @@ -167,7 +166,6 @@ <h1 class="text-left">Templates de VMs</h1>
},
success: function (response) {
var vms = response;
console.log(vms);
vmsDiv = $('#vms-div');
vms.forEach(addVMToDOM);
},
Expand Down Expand Up @@ -199,7 +197,6 @@ <h1 class="text-left">Templates de VMs</h1>
$('<p>').addClass('card-text').text('Date de création: ' + vm.creationDate),
$('<button>').addClass('btn btn-danger').text('Supprimer').on('click', function () {
deleteVm(vm.id);
console.log('suppression de la VM ' + vm.id);
})
);
return form;
Expand Down Expand Up @@ -250,7 +247,6 @@ <h1 class="text-left">Templates de VMs</h1>
email: email
};

console.log("User data for creation:" + userData);

$.ajax({
type: 'POST',
Expand All @@ -261,11 +257,9 @@ <h1 class="text-left">Templates de VMs</h1>
withCredentials: true
},
success: function (response) {
console.log(response);
alert('Utilisateur créé avec succès! Mot de passe: ' + response.password);
},
error: function (error) {
console.error(error);
alert('Erreur lors de la création de l\'utilisateur.');
}
});
Expand Down Expand Up @@ -307,11 +301,9 @@ <h1 class="text-left">Templates de VMs</h1>
withCredentials: true
},
success: function (response) {
console.log(response);
alert('Mot de passe changé avec succès!');
},
error: function (error) {
console.error(error);
alert('Erreur lors du changement de mot de passe.');
}
});
Expand Down
4 changes: 0 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
withCredentials: true
},
success: function (response) {
console.log("VM: " + vmId + ": STATE: " + response.vm_state + " STATUS: " + response.status);
if (response.vm_state == "1" && response.status == "ACTIVE") {
hideLoadingCardModal(vmId);
resolve(1);
Expand Down Expand Up @@ -125,7 +124,6 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
withCredentials: true
},
success: function (response) {
console.log("VM: " + id + ": STATE: " + response.vm_state + " STATUS: " + response.status);
if (response.vm_state == "1" && response.status == "ACTIVE") {
hideLoadingCardModal(id);
resolve(1);
Expand Down Expand Up @@ -169,7 +167,6 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
withCredentials: true
},
success: function (response) {
console.log(response);
if (response.cas === true) {
window.location = "https://cas.insa-cvl.fr/cas/logout?service=https://api.insa-cvl.com"
}
Expand Down Expand Up @@ -209,7 +206,6 @@ <h5 class="modal-title" id="alertModalLabel"></h5>
},
success: function (response) {
var user = response;
console.log(user);
$('#email').text('Email: ' + user.email);
$('#name').text('Name: ' + user.first_name);
$('#surname').text('Surname: ' + user.last_name);
Expand Down
4 changes: 0 additions & 4 deletions templates/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
withCredentials: true
},
success: function (response) {
console.log("VM: " + templateId + ": STATE: " + response.vm_state + " STATUS: " + response.status);
if (response.vm_state == "1" && response.status == "ACTIVE") {
hideLoadingCardModal(templateId);
resolve(1);
Expand Down Expand Up @@ -168,12 +167,9 @@
withCredentials: true
},
success: function (response) {
console.log(response);
hideLoadingModal();
var vncUrl = response.url;
//window.open(vncUrl, '_blank');
window.location = "/viewer?vncUrl=" + encodeURIComponent(vncUrl);
//location.href = vncUrl;
},
error: function (error) {
alert('Erreur de d\'ouverture de la VM');
Expand Down
4 changes: 0 additions & 4 deletions templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ <h2 class="text-center">Se connecter</h2>
const errorMessage = decodeURIComponent(urlParams.get('error'));
const successMessage = decodeURIComponent(urlParams.get('success'));


console.log("error: " + errorMessage);
console.log("success: " + successMessage);

if (errorMessage != "null") {
updateAlert(errorMessage);
}
Expand Down
9 changes: 0 additions & 9 deletions templates/professor.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ <h5 class="modal-title" id="editUserModalLabel">Modifier le mot de passe</h5>
$('<p>').addClass('card-text').text('Date de création: ' + vm.creationDate),
$('<button>').addClass('btn btn-danger').text('Supprimer').on('click', function () {
deleteVmProf(vm.id);
console.log('suppression de la VM ' + vm.id);
})
);

Expand Down Expand Up @@ -263,11 +262,9 @@ <h5 class="modal-title" id="editUserModalLabel">Modifier le mot de passe</h5>
withCredentials: true
},
success: function (response) {
console.log(response);
alert('Mot de passe changé avec succès!');
},
error: function (error) {
console.error(error);
alert('Erreur lors du changement de mot de passe. L\'utilisateur est peut-être du CAS.');
}
});
Expand All @@ -283,12 +280,10 @@ <h5 class="modal-title" id="editUserModalLabel">Modifier le mot de passe</h5>
withCredentials: true
},
success: function (response) {
console.log(response);
alert('Utilisateur supprimé avec succès!');
location.reload();
},
error: function (error) {
console.error(error);
alert('Erreur lors de la suppression de l\'utilisateur.');
}
});
Expand All @@ -305,8 +300,6 @@ <h5 class="modal-title" id="editUserModalLabel">Modifier le mot de passe</h5>
email: email
};

console.log("User data for creation:" + userData);

$.ajax({
type: 'POST',
url: 'https://api.insa-cvl.com/createuser',
Expand All @@ -316,12 +309,10 @@ <h5 class="modal-title" id="editUserModalLabel">Modifier le mot de passe</h5>
withCredentials: true
},
success: function (response) {
console.log(response);
alert('Utilisateur créé avec succès! Mot de passe: ' + response.password);
location.reload();
},
error: function (error) {
console.error(error);
alert('Erreur lors de la création de l\'utilisateur.');
}
});
Expand Down
10 changes: 0 additions & 10 deletions templates/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
{% block title %}VNC Viewer{% endblock %}

{% block content %}

<!-- Add HTML elements for the VNC viewer here -->
<div id="vncViewerContainer" style="height:90vh"></div>

<script>
document.addEventListener("DOMContentLoaded", function () {
// Function to get the value of a URL parameter by name
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
Expand All @@ -20,20 +16,15 @@
return decodeURIComponent(results[2].replace(/\+/g, " "));
}

// Get the VNC URL parameter from the URL
var vncUrl = getParameterByName("vncUrl");

// Check if a VNC URL is present
if (vncUrl) {
// Display the VNC viewer using the provided URL
displayVNCViewer(vncUrl);
} else {
// Handle the case where the VNC URL parameter is missing
console.error("VNC URL parameter is missing.");
}
});

// Function to display the VNC viewer with the provided URL
function displayVNCViewer(vncUrl) {
var iframe = document.createElement('iframe');
iframe.src = vncUrl;
Expand All @@ -43,5 +34,4 @@
document.getElementById('vncViewerContainer').appendChild(iframe);
}
</script>

{% endblock %}

0 comments on commit 142cd30

Please sign in to comment.