From 3e6ff7725a34eb92494717ad58c6202322c532b6 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 2 Dec 2018 18:29:59 +0100 Subject: [PATCH] Page home restructurée et fonctionnel --- PFE06/src/main/java/com/PFE/ServerManager/MainController.java | 5 +---- PFE06/src/main/resources/application.properties | 4 ++-- PFE06/src/main/resources/static/js/home.js | 16 +++++----------- PFE06/src/main/resources/templates/all.html | 2 +- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/PFE06/src/main/java/com/PFE/ServerManager/MainController.java b/PFE06/src/main/java/com/PFE/ServerManager/MainController.java index 59981db..59ded96 100644 --- a/PFE06/src/main/java/com/PFE/ServerManager/MainController.java +++ b/PFE06/src/main/java/com/PFE/ServerManager/MainController.java @@ -107,10 +107,7 @@ public class MainController { @RequestMapping(value = "/file", method = RequestMethod.POST) @ResponseStatus(value = HttpStatus.OK) - public void submit( - @RequestParam MultipartFile file, @RequestParam String nodes, - @RequestParam String filename) { - + public void submit(@RequestParam MultipartFile file) { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); Customer customer = customerRepository.findByEmail(auth.getName()); diff --git a/PFE06/src/main/resources/application.properties b/PFE06/src/main/resources/application.properties index 08b2821..8940957 100644 --- a/PFE06/src/main/resources/application.properties +++ b/PFE06/src/main/resources/application.properties @@ -8,9 +8,9 @@ spring.jpa.hibernate.ddl-auto=create #"update" met à jour la base données #Postgres config : -spring.datasource.url=jdbc:postgresql://localhost:5432/sql_only +spring.datasource.url=jdbc:postgresql://localhost:3306/sql_only spring.datasource.username=postgres -spring.datasource.password=idalurf123 +spring.datasource.password=admin # montre les communications JPA avec la BDD diff --git a/PFE06/src/main/resources/static/js/home.js b/PFE06/src/main/resources/static/js/home.js index 5bc0200..a100041 100644 --- a/PFE06/src/main/resources/static/js/home.js +++ b/PFE06/src/main/resources/static/js/home.js @@ -2,6 +2,7 @@ $(document).ready(function() { /********** Tableau **********/ +/* var tableNodes = $('#nodes-table').DataTable( { responsive: true, select: { @@ -32,6 +33,9 @@ $(document).ready(function() { } req.send("salut"); }); + + */ + /********** Drop Zone **********/ var formData = new FormData(); @@ -50,7 +54,6 @@ $(document).ready(function() { file.addEventListener('change', function() { dropZone.innerHTML = this.files[0].name; formData.append("file", this.files[0]); - formData.append("filename", this.files[0].name); readyToSend = true; }, false) @@ -67,7 +70,6 @@ $(document).ready(function() { } dropZone.innerHTML = files[0].name; formData.append("file", files[0]); - formData.append("filename", files[0].name); readyToSend = true; }, false) @@ -88,8 +90,7 @@ $(document).ready(function() { document.getElementById("sendButton").addEventListener('click', function() { var modalContent = document.getElementById("modal-content"); var modalTitle = document.getElementById("modal-title"); - if(readyToSend && nodeSet.size > 0) { - formData.append("nodes", Array.from(nodeSet).join(';')); + if(readyToSend) { var request = new XMLHttpRequest(); request.open("POST", "/file"); @@ -129,14 +130,7 @@ $(document).ready(function() { } else { - if(readyToSend) { - modalContent.innerHTML = "Veuillez choisir un ou plusieurs noeuds !"; - } - else { modalContent.innerHTML = "Veuillez choisir un fichier !"; - } - modalTitle.innerHTML = "Attention"; - $("#warningFilesNumber").modal() } }) diff --git a/PFE06/src/main/resources/templates/all.html b/PFE06/src/main/resources/templates/all.html index 1ae6d19..e46548a 100644 --- a/PFE06/src/main/resources/templates/all.html +++ b/PFE06/src/main/resources/templates/all.html @@ -48,7 +48,7 @@ Id - pseudo + pseudo role id -- libgit2 0.21.2