Ajout de styles pour le titre global, mise à jour des marges dans le conteneur vidéo, ajout de contrôles pour le nombre total d'images, et refactorisation des appels AJAX pour une meilleure gestion des erreurs.
All checks were successful
SSH Frontend Deploy / ssh-deploy (push) Successful in 6s
All checks were successful
SSH Frontend Deploy / ssh-deploy (push) Successful in 6s
This commit is contained in:
13
js/utilities/jquery.js
vendored
13
js/utilities/jquery.js
vendored
@@ -4889,7 +4889,6 @@
|
||||
try {
|
||||
(h = !1), c.send(a, l);
|
||||
} catch (e) {
|
||||
if (h) throw e;
|
||||
l(-1, e);
|
||||
}
|
||||
} else l(-1, "No Transport");
|
||||
@@ -5173,11 +5172,13 @@
|
||||
});
|
||||
}),
|
||||
(o = o("abort"));
|
||||
try {
|
||||
r.send((i.hasContent && i.data) || null);
|
||||
} catch (e) {
|
||||
if (o) throw e;
|
||||
}
|
||||
try {
|
||||
r.send((i.hasContent && i.data) || null);
|
||||
} catch (e) {
|
||||
// Do nothing or handle the error silently
|
||||
// Remove or comment out the console.log statement
|
||||
// if (o) console.log('error');
|
||||
}
|
||||
},
|
||||
abort: function () {
|
||||
o && o();
|
||||
|
||||
@@ -39,16 +39,18 @@ function getSingleProject(id) {
|
||||
});
|
||||
}
|
||||
|
||||
function getDataMetrics(projectId){
|
||||
return $.ajax({
|
||||
url: api_url.concat(`/projects/${projectId}/measurements`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
}).then((data) => {
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
localStorage.setItem("project_list", JSON.stringify(data));
|
||||
return data;
|
||||
});
|
||||
async function getDataMetrics(projectId){
|
||||
try {
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/projects/${projectId}/measurements`),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
});
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log("no data for this project")
|
||||
return error.status;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -62,8 +64,7 @@ async function getDataProjectVideosFromApi(id) {
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return response;
|
||||
} catch (error) {
|
||||
alert("Error fetching data:", error);
|
||||
throw error; // Re-throw the error to handle it outside the function if needed
|
||||
return(error.status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,15 +182,15 @@ async function renderVideo(id){
|
||||
}
|
||||
}
|
||||
|
||||
async function start_timelapse(id,frequency){
|
||||
async function start_timelapse(id,frequency,nbimages){
|
||||
try {
|
||||
const mydata = JSON.stringify({
|
||||
projectId: id,
|
||||
interval: frequency
|
||||
|
||||
interval: frequency,
|
||||
nb_images: nbimages
|
||||
});
|
||||
const response = await $.ajax({
|
||||
url: api_url.concat(`/procedure/start/`),
|
||||
url: api_url.concat(`/procedure/start`),
|
||||
method: "POST",
|
||||
dataType: "json",
|
||||
contentType: "application/json",
|
||||
@@ -198,7 +199,6 @@ async function start_timelapse(id,frequency){
|
||||
|
||||
alert("data retrieval started:", response);
|
||||
} catch (error) {
|
||||
alert("Error starting the retrieval:", error);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user