Merge branch 'main' of https://gitea.kerboul.me/timelapse/timelapse-frontend
This commit is contained in:
@@ -5,10 +5,17 @@ document.addEventListener("DOMContentLoaded", async () => {
|
||||
const data = await getAllProject();
|
||||
const DataMetrics = await getDataMetrics(projectId);
|
||||
|
||||
document.getElementById("name_project").innerHTML = data[projectId].name;
|
||||
console.log(projectId);
|
||||
console.log(data);
|
||||
|
||||
const project = data.find(project => project.id == projectId);
|
||||
if (project) {
|
||||
document.getElementById("name_project").innerHTML = project.name;
|
||||
} else {
|
||||
console.error("Project not found");
|
||||
}
|
||||
const videoSelector = document.getElementById("video_selector");
|
||||
const numberPicker = document.getElementById('number-picker');
|
||||
const resultContainer = document.getElementById('result-container');
|
||||
const choiceSelect = document.getElementById('choice');
|
||||
const oneByOneContainer = document.getElementById('one-by-one-container');
|
||||
const firstLastContainer = document.getElementById('first-last-container');
|
||||
@@ -165,7 +172,7 @@ function populateImageTable(DataMetrics) {
|
||||
let i = 0;
|
||||
DataMetrics.forEach((measure) => {
|
||||
let imageTD = document.createElement("td");
|
||||
imageTD.innerHTML = `<img id="${i}" src="${api_url}/image/${measure.image_path}"/>`;
|
||||
imageTD.innerHTML = `<img id="${i}" src="${api_url}/images/${measure.project_id}/${measure.order_id}"/>`;
|
||||
row.appendChild(imageTD);
|
||||
|
||||
if ((i + 1) % 3 === 0 && i !== 0) {
|
||||
|
||||
@@ -23,9 +23,8 @@ function getAllProject() {
|
||||
return $.ajax({
|
||||
url: api_url.concat("/projects"),
|
||||
method: "GET",
|
||||
dataType: "json",
|
||||
dataType: "json"
|
||||
}).then((data) => {
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
return data;
|
||||
});
|
||||
}
|
||||
@@ -38,6 +37,7 @@ function getDataMetrics(projectId){
|
||||
}).then((data) => {
|
||||
// If the request is successful, store the data in the cache and return it
|
||||
localStorage.setItem("project_list", JSON.stringify(data));
|
||||
console.log(data);
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user