From ffa19ba1baecd36952681f53b8eaa44a00eb4b94 Mon Sep 17 00:00:00 2001 From: Mathis Date: Wed, 2 Apr 2025 23:35:20 +0200 Subject: [PATCH] ajout de la page a propos --- .../com/example/starter/QueryObjects.java | 4 +- Front-end/package-lock.json | 50 ++++++ Front-end/package.json | 1 + Front-end/src/components/BatterieInfo.jsx | 27 +++ Front-end/src/components/BoutonGraphique.jsx | 14 +- Front-end/src/components/MeteoInfos.jsx | 5 + Front-end/src/components/ModifObject.jsx | 14 +- Front-end/src/img/NotreMission.png | Bin 0 -> 2452035 bytes Front-end/src/img/fr-alert.webp | Bin 0 -> 39778 bytes Front-end/src/img/gestioniot.png | Bin 0 -> 144928 bytes Front-end/src/img/iotmeteo.jpg | Bin 0 -> 39007 bytes Front-end/src/img/precisionfiable.jpg | Bin 0 -> 11593 bytes Front-end/src/img/surveillancemeteo.webp | Bin 0 -> 82958 bytes Front-end/src/img/surveillancetempsreel.jpg | Bin 0 -> 78014 bytes Front-end/src/pages/About.jsx | 169 +++++++++++++++++- Front-end/src/pages/Gestion/Gestion.jsx | 2 - Front-end/src/pages/Gestion/Objet.jsx | 43 +++-- Front-end/src/pages/Home.jsx | 9 - 18 files changed, 302 insertions(+), 36 deletions(-) create mode 100644 Front-end/src/components/BatterieInfo.jsx create mode 100644 Front-end/src/img/NotreMission.png create mode 100644 Front-end/src/img/fr-alert.webp create mode 100644 Front-end/src/img/gestioniot.png create mode 100644 Front-end/src/img/iotmeteo.jpg create mode 100644 Front-end/src/img/precisionfiable.jpg create mode 100644 Front-end/src/img/surveillancemeteo.webp create mode 100644 Front-end/src/img/surveillancetempsreel.jpg diff --git a/Back-end/src/main/java/com/example/starter/QueryObjects.java b/Back-end/src/main/java/com/example/starter/QueryObjects.java index 0dba41c..fe186fc 100644 --- a/Back-end/src/main/java/com/example/starter/QueryObjects.java +++ b/Back-end/src/main/java/com/example/starter/QueryObjects.java @@ -76,7 +76,9 @@ public class QueryObjects { .put("type", row.getString("type")) .put("location", row.getString("location")) .put("last_update", row.getLocalDateTime("last_update").format(formatter)) - .put("status", row.getString("status")); + .put("status", row.getString("status")) + .put("batterie",row.getInteger("batterie")) + .put("type_batterie",row.getString("type_batterie")); objects.add(object); } return objects; diff --git a/Front-end/package-lock.json b/Front-end/package-lock.json index 6bf990c..85b49b8 100644 --- a/Front-end/package-lock.json +++ b/Front-end/package-lock.json @@ -13,6 +13,7 @@ "lucide-react": "^0.427.0", "react": "^18.3.1", "react-charts": "^3.0.0-beta.57", + "react-circle-progress-bar": "^0.1.4", "react-dom": "^18.3.1", "react-router-dom": "^7.4.0", "recharts": "^2.15.1" @@ -3584,6 +3585,55 @@ "react-dom": ">=16" } }, + "node_modules/react-circle-progress-bar": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/react-circle-progress-bar/-/react-circle-progress-bar-0.1.4.tgz", + "integrity": "sha512-2a47TDthNyUHJf8p1hv0wcTwIWnJBbEUfj/7dZcO+7BYd1W1sRC2t5x+SEWX9/1QT7hhf4t8ppcLaG0XrdwwgQ==", + "license": "MIT", + "dependencies": { + "react": "^16.8.6", + "react-dom": "^16.8.6" + } + }, + "node_modules/react-circle-progress-bar/node_modules/react": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-circle-progress-bar/node_modules/react-dom": { + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1", + "prop-types": "^15.6.2", + "scheduler": "^0.19.1" + }, + "peerDependencies": { + "react": "^16.14.0" + } + }, + "node_modules/react-circle-progress-bar/node_modules/scheduler": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", + "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + } + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", diff --git a/Front-end/package.json b/Front-end/package.json index e49fb5f..da15ec6 100644 --- a/Front-end/package.json +++ b/Front-end/package.json @@ -14,6 +14,7 @@ "lucide-react": "^0.427.0", "react": "^18.3.1", "react-charts": "^3.0.0-beta.57", + "react-circle-progress-bar": "^0.1.4", "react-dom": "^18.3.1", "react-router-dom": "^7.4.0", "recharts": "^2.15.1" diff --git a/Front-end/src/components/BatterieInfo.jsx b/Front-end/src/components/BatterieInfo.jsx new file mode 100644 index 0000000..642fe31 --- /dev/null +++ b/Front-end/src/components/BatterieInfo.jsx @@ -0,0 +1,27 @@ +import React from "react"; +import { Battery } from "lucide-react"; +import Progress from "react-circle-progress-bar"; + +function BatterieInfo({ object }) { + return ( +
+
+
+ +
+

+ Etat de la batterie +

+
+
+ +

+ Type de batterie :{" "} + {object.type_batterie} +

+
+
+ ); +} + +export default BatterieInfo; diff --git a/Front-end/src/components/BoutonGraphique.jsx b/Front-end/src/components/BoutonGraphique.jsx index 560559a..932725f 100644 --- a/Front-end/src/components/BoutonGraphique.jsx +++ b/Front-end/src/components/BoutonGraphique.jsx @@ -1,17 +1,23 @@ -import React from "react"; +import React, {useRef} from "react"; import { ChartLine } from "lucide-react"; -function BoutonGraphique({ TypeAff, setAffichage }) { +function BoutonGraphique({ TypeAff, setAffichage,graphCible}) { + const handleClick = (newAffichage) =>{ + setAffichage(newAffichage); + if(graphCible.current){ + graphCible.current.scrollIntoView({ behavior: "smooth" }); + } + }; return !TypeAff ? ( ) : ( diff --git a/Front-end/src/components/MeteoInfos.jsx b/Front-end/src/components/MeteoInfos.jsx index 50571a5..1e2604b 100644 --- a/Front-end/src/components/MeteoInfos.jsx +++ b/Front-end/src/components/MeteoInfos.jsx @@ -14,10 +14,12 @@ function MeteoInfos({ AffPressionGraph, defAffHumiditeGraph, AffHumiditeGraph, + graphCible }) { const [rawData, setRawData] = useState([]); const [AffAlert,setAffAlert] = useState(false); const identifiant = object.id; + useEffect(() => { axios.get(`${API_BASE_URL}/meteo?id=${identifiant}`).then((response) => { setRawData(response.data); @@ -61,6 +63,8 @@ function MeteoInfos({ @@ -84,6 +88,7 @@ function MeteoInfos({ diff --git a/Front-end/src/components/ModifObject.jsx b/Front-end/src/components/ModifObject.jsx index f1d8b9c..b3658d1 100644 --- a/Front-end/src/components/ModifObject.jsx +++ b/Front-end/src/components/ModifObject.jsx @@ -70,7 +70,10 @@ function ModifObject({ object, defafficherModif }) {
-