This commit is contained in:
arussac
2025-03-10 15:34:37 +01:00
parent f6eb291ef6
commit 14e3e95054
5 changed files with 7 additions and 86 deletions

View File

@@ -1,46 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vidéos</title>
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div id="section"></div>
<div class="buttons-container">
<button class="btn btn-primary" id="projets" ><span>
Mes projets
</span>
</button>
</div>
</div>
<footer>
<p>&copy; 2024 Timelapse. All rights reserved.</p>
</footer>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"
integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"
integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>
<script src="../js/utilities/constVariables.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
document.getElementById("projets").addEventListener('click', () => {
window.location.href = '../index.html';
});
});
</script>
</body>
</html>

View File

@@ -39,7 +39,6 @@
</div> </div>
<div id="section" class="container mt-5"> <div id="section" class="container mt-5">
<div class="buttons-container mb-4"> <div class="buttons-container mb-4">
<button class="btn btn-primary" id="video" ><span>Mes vidéos</span></button>
<button class="btn btn-primary" id="download" ><span>Download App</span></button> <button class="btn btn-primary" id="download" ><span>Download App</span></button>
<button class="btn btn-primary" id="show-form-button"><span>+</span></button> <button class="btn btn-primary" id="show-form-button"><span>+</span></button>
</div> </div>
@@ -66,12 +65,6 @@
<script src="../js/utilities/routes.js"></script> <script src="../js/utilities/routes.js"></script>
<script src="../js/index.js"></script> <script src="../js/index.js"></script>
<script> <script>
// Redirect to videos.php when the "Mes vidéos" button is clicked
document.addEventListener('DOMContentLoaded', () => {
document.getElementById("video").addEventListener('click', () => {
window.location.href = 'html/videos.html';
});
});
</script> </script>
</body> </body>

View File

@@ -24,7 +24,9 @@ function display_projects() {
'veuillez en trouver un autre'); 'veuillez en trouver un autre');
return 0; return 0;
} }
PostNewProject(nameProject, description); PostNewProject(nameProject, description).then(() => {
location.reload();})
} }
function checkName(Projects, name) { function checkName(Projects, name) {

View File

@@ -38,12 +38,15 @@ document.addEventListener("DOMContentLoaded", async () => {
const hours = document.getElementById('hours').value; const hours = document.getElementById('hours').value;
const minutes = document.getElementById('minutes').value; const minutes = document.getElementById('minutes').value;
const frequency = days * 1440 + hours * 60 + minutes; const frequency = days * 1440 + hours * 60 + minutes;
start_timelapse(projectId, frequency) start_timelapse(projectId, frequency).then(()=>{
location.reload();
})
}) })
} }
if(document.getElementById('stop-camera') != null){ if(document.getElementById('stop-camera') != null){
document.getElementById('stop-camera').addEventListener('click', async () => { document.getElementById('stop-camera').addEventListener('click', async () => {
stopCamera(projectId) stopCamera(projectId)
location.reload();
}) })
} }
} }

View File

@@ -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));
});