diff --git a/src/components/EditLink.vue b/src/components/EditLink.vue index 8196283..5e0df59 100644 --- a/src/components/EditLink.vue +++ b/src/components/EditLink.vue @@ -11,6 +11,7 @@ + @@ -63,6 +64,19 @@ export default { console.log(error); }) .finally(); + }, + swapLink() { + axios + .post(`/api/v2/graph/${this.edge.id}/swap`) + .then(response => { + this.edge["source"] = response.data["source"]; + this.edge["target"] = response.data["target"]; + this.$eventBus.emit("displayMessage", { message: "Link direction swapped succesfully!", status: "success" }); + }) + .catch(error => { + this.error = error; + console.log(error); + }); } }, computed: { diff --git a/src/components/RelatedObjects.vue b/src/components/RelatedObjects.vue index 50ed961..78c1a8f 100644 --- a/src/components/RelatedObjects.vue +++ b/src/components/RelatedObjects.vue @@ -72,8 +72,8 @@ + + @@ -185,7 +194,22 @@ export default { }) .finally(() => (this.loading = false)); }, + swapLink(edgeId) { + axios + .post(`/api/v2/graph/${edgeId}/swap`) + .then(response => { + this.$eventBus.emit("displayMessage", { message: "Link direction swapped succesfully!", status: "success" }); + this.fetchNeighbors({ page: this.page, itemsPerPage: this.perPage }); + }) + .catch(error => { + this.error = error; + console.log(error); + }); + }, unlink(id) { + if (!confirm("Are you sure you want to delete this link?")) { + return; + } axios .delete(`/api/v2/graph/${id}`) .then(() => { @@ -258,7 +282,7 @@ export default { } td.controls { - width: 110px; + width: 140px; } td.link {