From 6536a229d7faf4ee4b1cc5a6fa1e4452682e1514 Mon Sep 17 00:00:00 2001 From: sfeutrie Date: Thu, 28 Feb 2019 16:37:56 +0100 Subject: [PATCH] modifications mineures --- PFE06/src/main/java/com/PFE/ServerManager/AppConfig.java | 12 ++++++------ PFE06/src/main/java/com/PFE/ServerManager/Customer.java | 11 ----------- PFE06/src/main/java/com/PFE/ServerManager/MainController.java | 4 ---- PFE06/src/main/resources/application.properties | 11 ++--------- PFE06/src/main/resources/static/js/update.js | 97 ++++++++++++++++++++++++++++++++++++------------------------------------------------------------- PFE06/src/main/resources/templates/all.html | 3 +-- PFE06/src/main/resources/templates/history.html | 1 - PFE06/src/main/resources/templates/home.html | 1 - PFE06/src/main/resources/templates/login.html | 1 - PFE06/src/main/resources/templates/update.html | 117 ++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------- PFE06/src/main/resources/templates/upload.html | 1 - 11 files changed, 81 insertions(+), 178 deletions(-) diff --git a/PFE06/src/main/java/com/PFE/ServerManager/AppConfig.java b/PFE06/src/main/java/com/PFE/ServerManager/AppConfig.java index f651baa..1214615 100644 --- a/PFE06/src/main/java/com/PFE/ServerManager/AppConfig.java +++ b/PFE06/src/main/java/com/PFE/ServerManager/AppConfig.java @@ -65,12 +65,12 @@ public class AppConfig { if(temp == null) { customerRepository.save(n); + /* Partie sur les groupes */ + Team g = new Team(); + g.setTeamId((int)(teamRepository.count() +1)); + g.setTeam("Labo1"); + g.addCustomer(n); + teamRepository.save(g); } - /* Partie sur les groupes */ - Team g = new Team(); - g.setTeamId((int)(teamRepository.count() +1)); - g.setTeam("Labo1"); - g.addCustomer(n); - teamRepository.save(g); } } \ No newline at end of file diff --git a/PFE06/src/main/java/com/PFE/ServerManager/Customer.java b/PFE06/src/main/java/com/PFE/ServerManager/Customer.java index da315ab..c409880 100644 --- a/PFE06/src/main/java/com/PFE/ServerManager/Customer.java +++ b/PFE06/src/main/java/com/PFE/ServerManager/Customer.java @@ -30,11 +30,6 @@ public class Customer{ @JoinTable(name = "customer_role", joinColumns = @JoinColumn(name = "customerId"), inverseJoinColumns = @JoinColumn(name = "roleId")) private Set roles; - @ManyToMany(cascade = CascadeType.ALL) - @JoinTable(name = "customer_update", joinColumns = @JoinColumn(name = "customerId"), inverseJoinColumns = @JoinColumn(name = "updateId")) - private Set update; - - public void setRoles(Set roles) { this.roles = roles; } public void addRole(Role role){ if(roles == null){ @@ -47,12 +42,6 @@ public class Customer{ return roles.iterator().next().getRole(); } - public void setUpdate(Set update) { - this.update = update; - } - public Set getUpdate() { - return update; - } public void setCustomerId(Integer id) { this.customerId = id; diff --git a/PFE06/src/main/java/com/PFE/ServerManager/MainController.java b/PFE06/src/main/java/com/PFE/ServerManager/MainController.java index cc9f45a..c50f8aa 100644 --- a/PFE06/src/main/java/com/PFE/ServerManager/MainController.java +++ b/PFE06/src/main/java/com/PFE/ServerManager/MainController.java @@ -149,7 +149,6 @@ public class MainController { Role userRole = roleRepository.findByRole(role); n.addRole(userRole); customerRepository.save(n); - System.out.println("team found : " + team); Team temp = teamRepository.findByTeam(team); temp.addCustomer(n); teamRepository.save(temp); @@ -312,7 +311,6 @@ public class MainController { } } List> table = new ArrayList<>(); - System.out.println("size = " + updateYAMLS.size()); int i=0, j=0, k=0; for(Node node : nodes){ @@ -326,7 +324,6 @@ public class MainController { LocalDateTime updateDate = LocalDateTime.parse(update.getDate(),formatter_date); LocalDateTime now = LocalDateTime.now(); if(state_sensor.get(k).equals("started")){ - System.out.println("Time : " + update.getTime()); System.out.println("duration between in minutes " + Duration.between(now,updateDate).toMinutes()); LocalTime duration = LocalTime.parse(update.getTime(),formatter_time); updateDate = updateDate.plusMinutes(duration.getMinute()); @@ -342,7 +339,6 @@ public class MainController { } k=0; if(table.get(i).size()==j){ - System.out.println("fonctionne"); table.get(i).add(j,"disponible"); } j++; diff --git a/PFE06/src/main/resources/application.properties b/PFE06/src/main/resources/application.properties index 30caaa3..81eed70 100644 --- a/PFE06/src/main/resources/application.properties +++ b/PFE06/src/main/resources/application.properties @@ -2,20 +2,13 @@ #-----------------------------------------------# #---------- Spring Database management ---------# #-----------------------------------------------# -spring.jpa.hibernate.ddl-auto=create-drop -#update -#"create" ajoute les tables qui n'existent pas encore à la base de données à chaque lancement -#"create-drop" supprime tout à la fin de la session donc tout est recréé à la suivante -#"update" met à jour la base données +spring.jpa.hibernate.ddl-auto=update #Postgres config : -spring.datasource.url=jdbc:postgresql://localhost:5432/sql_only +spring.datasource.url=jdbc:postgresql://localhost:5432/nodes_manager spring.datasource.username=postgres spring.datasource.password=glopglop -# montre les communications JPA avec la BDD -# spring.jpa.show-sql = true - # exécute le fichier data.sql pour préciser le role ADMIN spring.datasource.initialization-mode=always diff --git a/PFE06/src/main/resources/static/js/update.js b/PFE06/src/main/resources/static/js/update.js index 2eca102..2b5ef18 100644 --- a/PFE06/src/main/resources/static/js/update.js +++ b/PFE06/src/main/resources/static/js/update.js @@ -34,70 +34,43 @@ $(document).ready(function() { } }) - - /********** Configuration file ***********/ - - - - - - - - /* - var configName = document.getElementById("config_name"); - var configSend = document.getElementById("config_send"); - var file = document.getElementById("configInputFile"); - var readyToSend = false; - var formData = new FormData(); - - if(file != null) { - file.addEventListener('change', function () { - delete formData; - formData = new FormData(); - configName.innerHTML = this.files[0].name; - formData.append("file", this.files[0]); - readyToSend = true; - }, false) - - configSend.addEventListener('click', function () { - var modalContent = document.getElementById("modal-content"); - var modalTitle = document.getElementById("modal-title"); - if (readyToSend) { - var request = new XMLHttpRequest(); - request.open("POST", "/config"); - - request.onreadystatechange = function () { - if (this.readyState === XMLHttpRequest.DONE && this.status === 200) { - var modalButton = document.getElementById("modal-button"); - modalButton.addEventListener('click', function (e) { - location.reload(); - }) - modalContent.innerHTML = "Upload terminé !"; - modalTitle.innerHTML = "Félicitations"; - $("#warningFilesNumber").modal(); - } - } - - request.send(formData); - } - else { - modalContent.innerHTML = "Veuillez sélectionner un fichier !"; - $("#warningFilesNumber").modal() - } - - }) - } - -*/ - /********** Tableau **********/ var tableNodes = $('#nodes-table').DataTable( { - responsive: true, - select: { - style: 'multi' - } - } ); + "language":{ + "sProcessing": "Traitement en cours...", + "sSearch": "Rechercher :", + "sLengthMenu": "Afficher _MENU_ éléments", + "sInfo": "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments", + "sInfoEmpty": "Affichage de l'élément 0 à 0 sur 0 élément", + "sInfoFiltered": "(filtré de _MAX_ éléments au total)", + "sInfoPostFix": "", + "sLoadingRecords": "Chargement en cours...", + "sZeroRecords": "Aucun élément à afficher", + "sEmptyTable": "Aucune donnée disponible dans le tableau", + "oPaginate": { + "sFirst": "Premier", + "sPrevious": "Précédent", + "sNext": "Suivant", + "sLast": "Dernier" + }, + "oAria": { + "sSortAscending": ": activer pour trier la colonne par ordre croissant", + "sSortDescending": ": activer pour trier la colonne par ordre décroissant" + }, + "select": { + "rows": { + _: "%d lignes séléctionnées", + 0: "Aucune ligne séléctionnée", + 1: "1 ligne séléctionnée" + } + } + }, + responsive: true, + select: { + style: 'multi' + } + }); var nodeSet = new Set(); var arch = ""; @@ -114,6 +87,8 @@ $(document).ready(function() { tableNodes.rows().deselect(); nodeSet.clear(); first = true; + arch = ""; + return; } first = false; } ); diff --git a/PFE06/src/main/resources/templates/all.html b/PFE06/src/main/resources/templates/all.html index ab4a779..1b0c75c 100644 --- a/PFE06/src/main/resources/templates/all.html +++ b/PFE06/src/main/resources/templates/all.html @@ -79,8 +79,7 @@ - - + diff --git a/PFE06/src/main/resources/templates/history.html b/PFE06/src/main/resources/templates/history.html index 6ed360b..a558996 100644 --- a/PFE06/src/main/resources/templates/history.html +++ b/PFE06/src/main/resources/templates/history.html @@ -76,7 +76,6 @@ - diff --git a/PFE06/src/main/resources/templates/home.html b/PFE06/src/main/resources/templates/home.html index 0443a37..adf02f7 100644 --- a/PFE06/src/main/resources/templates/home.html +++ b/PFE06/src/main/resources/templates/home.html @@ -96,7 +96,6 @@ - diff --git a/PFE06/src/main/resources/templates/login.html b/PFE06/src/main/resources/templates/login.html index 92467d2..75a778d 100644 --- a/PFE06/src/main/resources/templates/login.html +++ b/PFE06/src/main/resources/templates/login.html @@ -43,7 +43,6 @@ - diff --git a/PFE06/src/main/resources/templates/update.html b/PFE06/src/main/resources/templates/update.html index 92de20e..e0b2cbf 100644 --- a/PFE06/src/main/resources/templates/update.html +++ b/PFE06/src/main/resources/templates/update.html @@ -46,98 +46,54 @@
- - - -

Paramétrer le réseau

- -
-
- Nom -
- -
- -
-
- IP +
+
+ IP +
+
- -
- -
-
- Architecture +
+
+ Architecture +
+
- -
- -

Capteurs


- -
-
- Nom +

Capteurs


+
+
+ Nom +
+
- + + +
+ + + + +
+ + +
- - - - -
- - - - - - -
- - - - - - - -- libgit2 0.21.2