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 | 107 | |
108 | 108 | @RequestMapping(value = "/file", method = RequestMethod.POST) |
109 | 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 | 112 | Authentication auth = SecurityContextHolder.getContext().getAuthentication(); |
116 | 113 | Customer customer = customerRepository.findByEmail(auth.getName()); | ... | ... |
PFE06/src/main/resources/application.properties
... | ... | @@ -8,9 +8,9 @@ spring.jpa.hibernate.ddl-auto=create |
8 | 8 | #"update" met à jour la base données |
9 | 9 | |
10 | 10 | #Postgres config : |
11 | -spring.datasource.url=jdbc:postgresql://localhost:5432/sql_only | |
11 | +spring.datasource.url=jdbc:postgresql://localhost:3306/sql_only | |
12 | 12 | spring.datasource.username=postgres |
13 | -spring.datasource.password=idalurf123 | |
13 | +spring.datasource.password=admin | |
14 | 14 | |
15 | 15 | |
16 | 16 | # montre les communications JPA avec la BDD | ... | ... |
PFE06/src/main/resources/static/js/home.js
... | ... | @@ -2,6 +2,7 @@ $(document).ready(function() { |
2 | 2 | |
3 | 3 | /********** Tableau **********/ |
4 | 4 | |
5 | +/* | |
5 | 6 | var tableNodes = $('#nodes-table').DataTable( { |
6 | 7 | responsive: true, |
7 | 8 | select: { |
... | ... | @@ -32,6 +33,9 @@ $(document).ready(function() { |
32 | 33 | } |
33 | 34 | req.send("salut"); |
34 | 35 | }); |
36 | + | |
37 | + */ | |
38 | + | |
35 | 39 | /********** Drop Zone **********/ |
36 | 40 | |
37 | 41 | var formData = new FormData(); |
... | ... | @@ -50,7 +54,6 @@ $(document).ready(function() { |
50 | 54 | file.addEventListener('change', function() { |
51 | 55 | dropZone.innerHTML = this.files[0].name; |
52 | 56 | formData.append("file", this.files[0]); |
53 | - formData.append("filename", this.files[0].name); | |
54 | 57 | readyToSend = true; |
55 | 58 | }, false) |
56 | 59 | |
... | ... | @@ -67,7 +70,6 @@ $(document).ready(function() { |
67 | 70 | } |
68 | 71 | dropZone.innerHTML = files[0].name; |
69 | 72 | formData.append("file", files[0]); |
70 | - formData.append("filename", files[0].name); | |
71 | 73 | readyToSend = true; |
72 | 74 | }, false) |
73 | 75 | |
... | ... | @@ -88,8 +90,7 @@ $(document).ready(function() { |
88 | 90 | document.getElementById("sendButton").addEventListener('click', function() { |
89 | 91 | var modalContent = document.getElementById("modal-content"); |
90 | 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 | 94 | var request = new XMLHttpRequest(); |
94 | 95 | request.open("POST", "/file"); |
95 | 96 | |
... | ... | @@ -129,14 +130,7 @@ $(document).ready(function() { |
129 | 130 | |
130 | 131 | } |
131 | 132 | else { |
132 | - if(readyToSend) { | |
133 | - modalContent.innerHTML = "Veuillez choisir un ou plusieurs noeuds !"; | |
134 | - } | |
135 | - else { | |
136 | 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 | 48 | <th scope="col">Id</th> |
49 | 49 | </tr> |
50 | 50 | <tr th:each="prod : ${list}"> |
51 | - <td th:text="${prod.pseudo}">pseudo</td> | |
51 | + <td th:text="${prod.getEmail()}">pseudo</td> | |
52 | 52 | <td th:text="${prod.getRole()}">role</td> |
53 | 53 | <td th:text="${prod.customer_id}">id</td> |
54 | 54 | </tr> | ... | ... |