Fix stage geometry URL

This commit is contained in:
Joel Collins 2020-10-16 14:41:34 +01:00
parent b2c6c93284
commit 157eb28053

View file

@ -10,11 +10,14 @@
<div>
<select v-model="stageType" class="uk-select">
<option value="SangaStage">SangaStage (Standard)</option>
<option value= "SangaDeltaStage"> SangaStage (Delta)</option>
<option value="SangaDeltaStage"> SangaStage (Delta)</option>
</select>
</div>
<div>
<button type="submit" class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1">
<button
type="submit"
class="uk-button uk-button-primary uk-form-small uk-float-right uk-margin-small uk-width-1-1"
>
Change stage type
</button>
</div>
@ -28,50 +31,49 @@
</template>
<script>
import axios from "axios";
import taskSubmitter from "../../genericComponents/taskSubmitter";
export default {
name: "StageSettings",
components:{
components: {
taskSubmitter
},
data: function(){
data: function() {
return {
stageType: "MissingStage",
}
stageType: "MissingStage"
};
},
computed: {
stageTypeUri: function() {
return `${this.$store.getters.baseUri}/api/v2/properties/stage/type`;
},
return `${this.$store.getters.baseUri}/api/v2/instrument/stage/type`;
}
},
mounted(){
mounted() {
this.getStageType();
},
methods: {
getStageType: function(){
console.log("Getting stage type")
getStageType: function() {
console.log("Getting stage type");
axios
.get(this.stageTypeUri)
.then(response => {
console.log("Stage type is "+ response.data);
console.log("Stage type is " + response.data);
this.stageType = response.data;
})
.catch(error => {
this.modalError(error);
});
},
setStageType: function(){
console.log("Setting stage type")
setStageType: function() {
console.log("Setting stage type");
axios
.put(this.stageTypeUri,this.stageType)
.put(this.stageTypeUri, this.stageType)
.then(response => {
this.stageType = response.data;
console.log("Stage type set to " + this.stageType);
@ -82,7 +84,7 @@ export default {
});
}
}
}
};
</script>
<style lang="less"></style>