Switch to using TDs in the store

This commit is contained in:
Richard Bowman 2023-11-30 23:22:10 +00:00
parent 8865d88e20
commit c2ec060df9
4 changed files with 21 additions and 37 deletions

View file

@ -51,6 +51,11 @@ export default {
},
computed: {
thingDescriptionUri: function() {
return this.$store.getters["wot/thingDescription"](
"camera_stage_mapping"
);
}
},
mounted() {
@ -94,30 +99,6 @@ export default {
});
},
updateThingDescription: function() {
this.thingDescription =
axios
.get(this.pluginsUri) // Get a list of plugins
.then(response => {
var plugins = response.data;
var foundExtension = plugins.find(
e => e.title === "org.openflexure.camera_stage_mapping"
);
// if camera-stage mapping extension is enabled
if (foundExtension) {
// Get plugin action link
this.recalibrationLinks = foundExtension.links;
// Update whether calibration data is available
this.updateCalibrationDataAvailability();
} else {
this.recalibrationLinks = {};
}
})
.catch(error => {
this.modalError(error); // Let mixin handle error
});
},
onRecalibrateResponse: function() {
this.modalNotify("Finished stage-to-camera calibration.");
// Update local settings

View file

@ -14,19 +14,16 @@ export default {
components: {},
data: function() {
return {
thingDescription: {}
};
return {};
},
computed: {
stageType: function() {
return this.thingDescription.title;
},
thingDescription: function() {
return this.$store.getters["wot/thingDescription"]("stage");
}
},
mounted: async function() {
this.thingDescription = await this.getThingDescription("stage");
}
};
</script>

View file

@ -58,7 +58,7 @@ export default {
},
streamImgUri: function() {
return `${this.$store.getters.baseUri}/camera/mjpeg_stream`;
},
}
},
mounted() {