From 14e3e950546d7f9d590dd9d11816e4f1407c1d27 Mon Sep 17 00:00:00 2001 From: arussac Date: Mon, 10 Mar 2025 15:34:37 +0100 Subject: [PATCH] =?UTF-8?q?=C3=A0=20jour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- html/videos.html | 46 --------------------------------------------- index.html | 7 ------- js/index.js | 4 +++- js/projet_detail.js | 5 ++++- js/videos.js | 31 ------------------------------ 5 files changed, 7 insertions(+), 86 deletions(-) delete mode 100644 html/videos.html delete mode 100644 js/videos.js diff --git a/html/videos.html b/html/videos.html deleted file mode 100644 index 4b9ca94..0000000 --- a/html/videos.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - Vidéos - - - - - -
-
- -
- - - - - - - - - - - - \ No newline at end of file diff --git a/index.html b/index.html index f82772a..af00bbc 100644 --- a/index.html +++ b/index.html @@ -39,7 +39,6 @@
-
@@ -66,12 +65,6 @@ diff --git a/js/index.js b/js/index.js index 4dafd7e..936b3e7 100644 --- a/js/index.js +++ b/js/index.js @@ -24,7 +24,9 @@ function display_projects() { 'veuillez en trouver un autre'); return 0; } - PostNewProject(nameProject, description); + PostNewProject(nameProject, description).then(() => { + location.reload();}) + } function checkName(Projects, name) { diff --git a/js/projet_detail.js b/js/projet_detail.js index 6227ea1..4a8d777 100644 --- a/js/projet_detail.js +++ b/js/projet_detail.js @@ -38,12 +38,15 @@ document.addEventListener("DOMContentLoaded", async () => { const hours = document.getElementById('hours').value; const minutes = document.getElementById('minutes').value; const frequency = days * 1440 + hours * 60 + minutes; - start_timelapse(projectId, frequency) + start_timelapse(projectId, frequency).then(()=>{ + location.reload(); + }) }) } if(document.getElementById('stop-camera') != null){ document.getElementById('stop-camera').addEventListener('click', async () => { stopCamera(projectId) + location.reload(); }) } } diff --git a/js/videos.js b/js/videos.js deleted file mode 100644 index 22bd99c..0000000 --- a/js/videos.js +++ /dev/null @@ -1,31 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - // Fetch data from the API - fetch("https://timelapse.kerboul.me/api/itemsdb") - .then(response => response.json()) - .then(data => { - // Get the table body element - const tableBody = document.querySelector("#table-metrics tbody"); - - // Loop through the data and create a new row for each item - data.forEach(item => { - const row = document.createElement("tr"); - - // Create a new cell for each property (metrics, hygrometry, temperature) - const metricsCell = document.createElement("td"); - metricsCell.textContent = item.metrics; - row.appendChild(metricsCell); - - const hygrometryCell = document.createElement("td"); - hygrometryCell.textContent = item.hygrometry; - row.appendChild(hygrometryCell); - - const temperatureCell = document.createElement("td"); - temperatureCell.textContent = item.temperature; - row.appendChild(temperatureCell); - - // Append the row to the table body - tableBody.appendChild(row); - }); - }) - .catch(error => console.error(error)); - }); \ No newline at end of file