Commit 3e6ff7725a34eb92494717ad58c6202322c532b6
1 parent
deabfae9
Page home restructurée et fonctionnel
Tableau des noeuds enlevé, il reste seulement la dropzone pour uploader un fichier
Showing
4 changed files
with
9 additions
and
18 deletions
Show diff stats
PFE06/src/main/java/com/PFE/ServerManager/MainController.java
@@ -107,10 +107,7 @@ public class MainController { | @@ -107,10 +107,7 @@ public class MainController { | ||
107 | 107 | ||
108 | @RequestMapping(value = "/file", method = RequestMethod.POST) | 108 | @RequestMapping(value = "/file", method = RequestMethod.POST) |
109 | @ResponseStatus(value = HttpStatus.OK) | 109 | @ResponseStatus(value = HttpStatus.OK) |
110 | - public void submit( | ||
111 | - @RequestParam MultipartFile file, @RequestParam String nodes, | ||
112 | - @RequestParam String filename) { | ||
113 | - | 110 | + public void submit(@RequestParam MultipartFile file) { |
114 | 111 | ||
115 | Authentication auth = SecurityContextHolder.getContext().getAuthentication(); | 112 | Authentication auth = SecurityContextHolder.getContext().getAuthentication(); |
116 | Customer customer = customerRepository.findByEmail(auth.getName()); | 113 | Customer customer = customerRepository.findByEmail(auth.getName()); |
PFE06/src/main/resources/application.properties
@@ -8,9 +8,9 @@ spring.jpa.hibernate.ddl-auto=create | @@ -8,9 +8,9 @@ spring.jpa.hibernate.ddl-auto=create | ||
8 | #"update" met à jour la base données | 8 | #"update" met à jour la base données |
9 | 9 | ||
10 | #Postgres config : | 10 | #Postgres config : |
11 | -spring.datasource.url=jdbc:postgresql://localhost:5432/sql_only | 11 | +spring.datasource.url=jdbc:postgresql://localhost:3306/sql_only |
12 | spring.datasource.username=postgres | 12 | spring.datasource.username=postgres |
13 | -spring.datasource.password=idalurf123 | 13 | +spring.datasource.password=admin |
14 | 14 | ||
15 | 15 | ||
16 | # montre les communications JPA avec la BDD | 16 | # montre les communications JPA avec la BDD |
PFE06/src/main/resources/static/js/home.js
@@ -2,6 +2,7 @@ $(document).ready(function() { | @@ -2,6 +2,7 @@ $(document).ready(function() { | ||
2 | 2 | ||
3 | /********** Tableau **********/ | 3 | /********** Tableau **********/ |
4 | 4 | ||
5 | +/* | ||
5 | var tableNodes = $('#nodes-table').DataTable( { | 6 | var tableNodes = $('#nodes-table').DataTable( { |
6 | responsive: true, | 7 | responsive: true, |
7 | select: { | 8 | select: { |
@@ -32,6 +33,9 @@ $(document).ready(function() { | @@ -32,6 +33,9 @@ $(document).ready(function() { | ||
32 | } | 33 | } |
33 | req.send("salut"); | 34 | req.send("salut"); |
34 | }); | 35 | }); |
36 | + | ||
37 | + */ | ||
38 | + | ||
35 | /********** Drop Zone **********/ | 39 | /********** Drop Zone **********/ |
36 | 40 | ||
37 | var formData = new FormData(); | 41 | var formData = new FormData(); |
@@ -50,7 +54,6 @@ $(document).ready(function() { | @@ -50,7 +54,6 @@ $(document).ready(function() { | ||
50 | file.addEventListener('change', function() { | 54 | file.addEventListener('change', function() { |
51 | dropZone.innerHTML = this.files[0].name; | 55 | dropZone.innerHTML = this.files[0].name; |
52 | formData.append("file", this.files[0]); | 56 | formData.append("file", this.files[0]); |
53 | - formData.append("filename", this.files[0].name); | ||
54 | readyToSend = true; | 57 | readyToSend = true; |
55 | }, false) | 58 | }, false) |
56 | 59 | ||
@@ -67,7 +70,6 @@ $(document).ready(function() { | @@ -67,7 +70,6 @@ $(document).ready(function() { | ||
67 | } | 70 | } |
68 | dropZone.innerHTML = files[0].name; | 71 | dropZone.innerHTML = files[0].name; |
69 | formData.append("file", files[0]); | 72 | formData.append("file", files[0]); |
70 | - formData.append("filename", files[0].name); | ||
71 | readyToSend = true; | 73 | readyToSend = true; |
72 | }, false) | 74 | }, false) |
73 | 75 | ||
@@ -88,8 +90,7 @@ $(document).ready(function() { | @@ -88,8 +90,7 @@ $(document).ready(function() { | ||
88 | document.getElementById("sendButton").addEventListener('click', function() { | 90 | document.getElementById("sendButton").addEventListener('click', function() { |
89 | var modalContent = document.getElementById("modal-content"); | 91 | var modalContent = document.getElementById("modal-content"); |
90 | var modalTitle = document.getElementById("modal-title"); | 92 | var modalTitle = document.getElementById("modal-title"); |
91 | - if(readyToSend && nodeSet.size > 0) { | ||
92 | - formData.append("nodes", Array.from(nodeSet).join(';')); | 93 | + if(readyToSend) { |
93 | var request = new XMLHttpRequest(); | 94 | var request = new XMLHttpRequest(); |
94 | request.open("POST", "/file"); | 95 | request.open("POST", "/file"); |
95 | 96 | ||
@@ -129,14 +130,7 @@ $(document).ready(function() { | @@ -129,14 +130,7 @@ $(document).ready(function() { | ||
129 | 130 | ||
130 | } | 131 | } |
131 | else { | 132 | else { |
132 | - if(readyToSend) { | ||
133 | - modalContent.innerHTML = "Veuillez choisir un ou plusieurs noeuds !"; | ||
134 | - } | ||
135 | - else { | ||
136 | modalContent.innerHTML = "Veuillez choisir un fichier !"; | 133 | modalContent.innerHTML = "Veuillez choisir un fichier !"; |
137 | - } | ||
138 | - modalTitle.innerHTML = "Attention"; | ||
139 | - $("#warningFilesNumber").modal() | ||
140 | } | 134 | } |
141 | }) | 135 | }) |
142 | 136 |
PFE06/src/main/resources/templates/all.html
@@ -48,7 +48,7 @@ | @@ -48,7 +48,7 @@ | ||
48 | <th scope="col">Id</th> | 48 | <th scope="col">Id</th> |
49 | </tr> | 49 | </tr> |
50 | <tr th:each="prod : ${list}"> | 50 | <tr th:each="prod : ${list}"> |
51 | - <td th:text="${prod.pseudo}">pseudo</td> | 51 | + <td th:text="${prod.getEmail()}">pseudo</td> |
52 | <td th:text="${prod.getRole()}">role</td> | 52 | <td th:text="${prod.getRole()}">role</td> |
53 | <td th:text="${prod.customer_id}">id</td> | 53 | <td th:text="${prod.customer_id}">id</td> |
54 | </tr> | 54 | </tr> |