Loading vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/client/VOSpaceClient.java +11 −2 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.concurrent.CompletionException; Loading @@ -27,7 +26,6 @@ import javax.servlet.http.HttpSession; import javax.xml.bind.JAXB; import net.ivoa.xml.uws.v1.JobSummary; import net.ivoa.xml.uws.v1.Jobs; import net.ivoa.xml.uws.v1.ShortJobDescription; import net.ivoa.xml.vospace.v2.Node; import net.ivoa.xml.vospace.v2.Protocol; import net.ivoa.xml.vospace.v2.Transfer; Loading Loading @@ -116,6 +114,17 @@ public class VOSpaceClient { return call(request, BodyHandlers.ofInputStream(), 200, res -> unmarshal(res, Node.class)); } public void deleteNode(String path) { HttpRequest request = getRequest("/nodes" + path) .header("Accept", useJson ? "application/json" : "text/xml") .header("Content-Type", useJson ? "application/json" : "text/xml") .DELETE() .build(); call(request, BodyHandlers.ofInputStream(), 200, res -> null); } public List<Job> getJobs() { HttpRequest request = getRequest("/transfers?direction=pullToVoSpace") Loading vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/controller/NodesController.java +7 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; Loading Loading @@ -50,6 +51,12 @@ public class NodesController extends BaseController { return nodesService.generateNodesHtml(path); } @DeleteMapping(value = {"/nodes", "/nodes/**"}) public void deleteNode() { String path = getPath("/nodes/"); client.deleteNode(path); } @GetMapping(value = "/download/**") public ResponseEntity<?> directDownload() { Loading vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/service/NodesService.java +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public class NodesService { html += "<td>" + nodeInfo.getSize() + "</td>"; html += "<td>" + nodeInfo.getGroupRead() + "</td>"; html += "<td>" + nodeInfo.getGroupWrite() + "</td>"; html += "<td><span class=\"icon trash-icon pointer\" onclick=\"deleteNode('" + nodeInfo.getPath() + "')\"></span></td>"; html += "</tr>"; return html; } Loading vospace-ui-frontend/src/api/mock/data/nodes/folder1.html +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ <td>0 B</td> <td>group1</td> <td>group2</td> <td></td> </tr> <tr> <td><input type="checkbox" data-node="/folder1/file2" /></td> Loading @@ -18,6 +19,7 @@ <td>30 KB</td> <td>group1</td> <td>group2</td> <td></td> </tr> <tr> <td><input type="checkbox" class="async" data-node="/folder1/file3" /></td> Loading @@ -28,5 +30,6 @@ <td>12 MB</td> <td>group3</td> <td>group4</td> <td></td> </tr> </tbody> vospace-ui-frontend/src/api/mock/data/nodes/folder2.html +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ <td>10 KB</td> <td>group1</td> <td>group2</td> <td></td> </tr> <tr> <td><input type="checkbox" class="async" data-node="/folder1/folder2/file5" /></td> Loading @@ -18,5 +19,6 @@ <td>15 MB</td> <td>group3</td> <td>group4</td> <td></td> </tr> </tbody> Loading
vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/client/VOSpaceClient.java +11 −2 Original line number Diff line number Diff line Loading @@ -15,7 +15,6 @@ import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.net.http.HttpResponse.BodyHandlers; import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.concurrent.CompletionException; Loading @@ -27,7 +26,6 @@ import javax.servlet.http.HttpSession; import javax.xml.bind.JAXB; import net.ivoa.xml.uws.v1.JobSummary; import net.ivoa.xml.uws.v1.Jobs; import net.ivoa.xml.uws.v1.ShortJobDescription; import net.ivoa.xml.vospace.v2.Node; import net.ivoa.xml.vospace.v2.Protocol; import net.ivoa.xml.vospace.v2.Transfer; Loading Loading @@ -116,6 +114,17 @@ public class VOSpaceClient { return call(request, BodyHandlers.ofInputStream(), 200, res -> unmarshal(res, Node.class)); } public void deleteNode(String path) { HttpRequest request = getRequest("/nodes" + path) .header("Accept", useJson ? "application/json" : "text/xml") .header("Content-Type", useJson ? "application/json" : "text/xml") .DELETE() .build(); call(request, BodyHandlers.ofInputStream(), 200, res -> null); } public List<Job> getJobs() { HttpRequest request = getRequest("/transfers?direction=pullToVoSpace") Loading
vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/controller/NodesController.java +7 −0 Original line number Diff line number Diff line Loading @@ -14,6 +14,7 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; Loading Loading @@ -50,6 +51,12 @@ public class NodesController extends BaseController { return nodesService.generateNodesHtml(path); } @DeleteMapping(value = {"/nodes", "/nodes/**"}) public void deleteNode() { String path = getPath("/nodes/"); client.deleteNode(path); } @GetMapping(value = "/download/**") public ResponseEntity<?> directDownload() { Loading
vospace-ui-backend/src/main/java/it/inaf/ia2/vospace/ui/service/NodesService.java +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public class NodesService { html += "<td>" + nodeInfo.getSize() + "</td>"; html += "<td>" + nodeInfo.getGroupRead() + "</td>"; html += "<td>" + nodeInfo.getGroupWrite() + "</td>"; html += "<td><span class=\"icon trash-icon pointer\" onclick=\"deleteNode('" + nodeInfo.getPath() + "')\"></span></td>"; html += "</tr>"; return html; } Loading
vospace-ui-frontend/src/api/mock/data/nodes/folder1.html +3 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ <td>0 B</td> <td>group1</td> <td>group2</td> <td></td> </tr> <tr> <td><input type="checkbox" data-node="/folder1/file2" /></td> Loading @@ -18,6 +19,7 @@ <td>30 KB</td> <td>group1</td> <td>group2</td> <td></td> </tr> <tr> <td><input type="checkbox" class="async" data-node="/folder1/file3" /></td> Loading @@ -28,5 +30,6 @@ <td>12 MB</td> <td>group3</td> <td>group4</td> <td></td> </tr> </tbody>
vospace-ui-frontend/src/api/mock/data/nodes/folder2.html +2 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,7 @@ <td>10 KB</td> <td>group1</td> <td>group2</td> <td></td> </tr> <tr> <td><input type="checkbox" class="async" data-node="/folder1/folder2/file5" /></td> Loading @@ -18,5 +19,6 @@ <td>15 MB</td> <td>group3</td> <td>group4</td> <td></td> </tr> </tbody>