From e6057d330b1a1c9170e5ce6720ca19a63353c7e3 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Fri, 29 Nov 2019 14:10:55 +0000 Subject: [PATCH] Add button to zero stage --- .../controlComponents/paneNavigate.vue | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/components/controlComponents/paneNavigate.vue b/src/components/controlComponents/paneNavigate.vue index 30b3b0b7..4df04e46 100644 --- a/src/components/controlComponents/paneNavigate.vue +++ b/src/components/controlComponents/paneNavigate.vue @@ -33,6 +33,13 @@ + + @@ -182,6 +189,9 @@ export default { moveActionUri: function() { return `${this.$store.getters.baseUri}/api/v2/actions/stage/move`; }, + zeroActionUri: function() { + return `${this.$store.getters.baseUri}/api/v2/actions/stage/zero`; + }, positionStatusUri: function() { return `${this.$store.getters.baseUri}/api/v2/status/stage/position`; }, @@ -314,6 +324,18 @@ export default { } }, + zeroRequest: function() { + // Send move request + axios + .post(this.zeroActionUri) + .then(() => { + this.updatePosition(); // Update the position in text boxes + }) + .catch(error => { + this.modalError(error); // Let mixin handle error + }); + }, + updatePosition: function() { axios .get(this.positionStatusUri)