diff --git a/css/style.css b/css/style.css index ad18ab7..5d1b7d8 100644 --- a/css/style.css +++ b/css/style.css @@ -438,4 +438,9 @@ footer { 100% { width: 40vw; } +} + +.global_title_h1 { + color: white; + font-size: 10vh; } \ No newline at end of file diff --git a/css/style_projet.css b/css/style_projet.css index 11cdc3b..8c45e48 100644 --- a/css/style_projet.css +++ b/css/style_projet.css @@ -19,8 +19,10 @@ } .video_placeHolder { - width: 100%; + margin-left: 3vw; margin-top: 10px; + margin-bottom: 5vh; + width: 93%; } .box { diff --git a/docker-compose.yml b/docker-compose.yml index 35f43ae..0e4a734 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,10 +3,10 @@ services: image: nginx:latest container_name: timelapse-frontend ports: - - "80:80" - - "443:443" + - "8093:80" + - "16443:443" volumes: - - ./:/usr/share/nginx/html + - /home/timelapse/nginx:/usr/share/nginx/html - nginx-config:/etc/nginx environment: - NGINX_VERSION=1.27.1 @@ -17,6 +17,7 @@ services: restart: always networks: - bridge + - timelapse_network volumes: nginx-config: @@ -25,3 +26,5 @@ volumes: networks: bridge: driver: bridge + timelapse_network: + driver: bridge diff --git a/html/projet_detail.html b/html/projet_detail.html index 1aeafb7..c7b1b59 100644 --- a/html/projet_detail.html +++ b/html/projet_detail.html @@ -97,6 +97,12 @@ +
+ + + + +
une image sera prise toutes les 0 jours 0 heures 0 minutes
diff --git a/index.html b/index.html index f12874b..5132b68 100644 --- a/index.html +++ b/index.html @@ -40,7 +40,6 @@
-

Caméra Timelapse

diff --git a/js/index.js b/js/index.js index 70df028..19ce055 100644 --- a/js/index.js +++ b/js/index.js @@ -164,7 +164,7 @@ function handleResize() { window.addEventListener('resize', handleResize); function isMobileDevice() { - return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera); + return /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(navigator.userAgent || navigator.vendor || window.opera ) || document.documentElement.clientWidth / document.documentElement.clientHeight < 1; } window.addEventListener('DOMContentLoaded', (event) => { @@ -178,7 +178,7 @@ window.addEventListener('DOMContentLoaded', (event) => { }); const newH1 = document.createElement('h1'); newH1.textContent = "Caméra Timelapse sur mobile, utilisez l'app !!!"; - newH1.classList.add('global_title'); + newH1.classList.add('global_title_h1'); body.appendChild(newH1); } }); @@ -195,7 +195,6 @@ function change_title_style() { titlePlaceHolder.classList.add('container-title'); ball.style.display = 'block'; xyz.style.display = 'block'; - h1_title.style.display = 'none'; } else { titleIsReadable = true; titlePlaceHolder.classList.remove('container-title'); diff --git a/js/utilities/jquery.js b/js/utilities/jquery.js index f840c67..04dc2fc 100644 --- a/js/utilities/jquery.js +++ b/js/utilities/jquery.js @@ -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(); diff --git a/js/utilities/routes.js b/js/utilities/routes.js index abf9219..0a50fe6 100644 --- a/js/utilities/routes.js +++ b/js/utilities/routes.js @@ -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; } }