Add button to zero stage
This commit is contained in:
parent
55a68738a7
commit
e6057d330b
1 changed files with 22 additions and 0 deletions
|
|
@ -33,6 +33,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="uk-button uk-button-default uk-form-small uk-margin uk-width-1-1"
|
||||||
|
@click="zeroRequest()"
|
||||||
|
>
|
||||||
|
Zero coordinates
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
@ -182,6 +189,9 @@ export default {
|
||||||
moveActionUri: function() {
|
moveActionUri: function() {
|
||||||
return `${this.$store.getters.baseUri}/api/v2/actions/stage/move`;
|
return `${this.$store.getters.baseUri}/api/v2/actions/stage/move`;
|
||||||
},
|
},
|
||||||
|
zeroActionUri: function() {
|
||||||
|
return `${this.$store.getters.baseUri}/api/v2/actions/stage/zero`;
|
||||||
|
},
|
||||||
positionStatusUri: function() {
|
positionStatusUri: function() {
|
||||||
return `${this.$store.getters.baseUri}/api/v2/status/stage/position`;
|
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() {
|
updatePosition: function() {
|
||||||
axios
|
axios
|
||||||
.get(this.positionStatusUri)
|
.get(this.positionStatusUri)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue