diff --git a/src/components/controlComponents/paneCapture.vue b/src/components/controlComponents/paneCapture.vue index cd42981c..1e3ddd3b 100644 --- a/src/components/controlComponents/paneCapture.vue +++ b/src/components/controlComponents/paneCapture.vue @@ -410,9 +410,7 @@ export default { // Get plugin action link var link = plugins.ScanPlugin.views.tile.links.self; // Store plugin action URI - this.scanUri = `http://${this.$store.state.host}:${ - this.$store.state.port - }${link}`; + this.scanUri = `${this.$store.getters.baseUri}${link}`; } }) .catch(error => { diff --git a/src/components/controlComponents/paneNavigate.vue b/src/components/controlComponents/paneNavigate.vue index 23830c26..a3ff6db5 100644 --- a/src/components/controlComponents/paneNavigate.vue +++ b/src/components/controlComponents/paneNavigate.vue @@ -180,19 +180,13 @@ export default { computed: { moveActionUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/actions/stage/move`; + return `${this.$store.getters.baseUri}/api/v2/actions/stage/move`; }, positionStatusUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/status/stage/position`; + return `${this.$store.getters.baseUri}/api/v2/status/stage/position`; }, pluginsUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/plugins`; + return `${this.$store.getters.baseUri}/api/v2/plugins`; } }, @@ -343,11 +337,9 @@ export default { plugins.AutofocusPlugin.views.fast_autofocus.links.self; var normalLink = plugins.AutofocusPlugin.views.autofocus.links.self; // Store plugin action URI - this.fastAutofocusUri = `http://${this.$store.state.host}:${ - this.$store.state.port - }${fastLink}`; - this.normalAutofocusUri = `http://${this.$store.state.host}:${ - this.$store.state.port + this.fastAutofocusUri = `${this.$store.getters.baseUri}${fastLink}`; + this.normalAutofocusUri = `${ + this.$store.getters.baseUri }${normalLink}`; } }) diff --git a/src/components/controlComponents/paneStatus.vue b/src/components/controlComponents/paneStatus.vue index 7659890b..552f01c9 100644 --- a/src/components/controlComponents/paneStatus.vue +++ b/src/components/controlComponents/paneStatus.vue @@ -69,14 +69,10 @@ export default { computed: { settingsUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/settings`; + return `${this.$store.getters.baseUri}/api/v2/settings`; }, statusUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/status`; + return `${this.$store.getters.baseUri}/api/v2/status`; } }, diff --git a/src/components/controlComponents/settingsComponents/cameraSettings.vue b/src/components/controlComponents/settingsComponents/cameraSettings.vue index 1dfd538f..1fb1759d 100644 --- a/src/components/controlComponents/settingsComponents/cameraSettings.vue +++ b/src/components/controlComponents/settingsComponents/cameraSettings.vue @@ -93,14 +93,10 @@ export default { computed: { settingsUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/settings`; + return `${this.$store.getters.baseUri}/api/v2/settings`; }, pluginsUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/plugins`; + return `${this.$store.getters.baseUri}/api/v2/plugins`; } }, @@ -132,9 +128,7 @@ export default { var link = plugins.AutocalibrationPlugin.views.recalibrate.links.self; // Store plugin action URI - this.recalibrationUri = `http://${this.$store.state.host}:${ - this.$store.state.port - }${link}`; + this.recalibrationUri = `${this.$store.getters.baseUri}${link}`; } }) .catch(error => { diff --git a/src/components/controlComponents/settingsComponents/microscopeSettings.vue b/src/components/controlComponents/settingsComponents/microscopeSettings.vue index 21d32201..9998f194 100644 --- a/src/components/controlComponents/settingsComponents/microscopeSettings.vue +++ b/src/components/controlComponents/settingsComponents/microscopeSettings.vue @@ -80,9 +80,7 @@ export default { computed: { settingsUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/settings`; + return `${this.$store.getters.baseUri}/api/v2/settings`; } }, diff --git a/src/components/panelLeft.vue b/src/components/panelLeft.vue index 8bb8b78b..8e294df9 100644 --- a/src/components/panelLeft.vue +++ b/src/components/panelLeft.vue @@ -182,15 +182,23 @@ export default { created: function() { // Watch for host 'ready', then update status - this.$store.watch( + this.unwatchStoreFunction = this.$store.watch( (state, getters) => { return getters.ready; }, - () => { + ready => { + // Update plugins this.updatePlugins(); + if (ready) { + console.log("Left panel now ready"); + } else { + console.log("Right panel now disabled"); + this.currentTab = "status"; + } } ); }, + methods: { updatePlugins: function() { axios diff --git a/src/components/viewComponents/streamDisplay.vue b/src/components/viewComponents/streamDisplay.vue index 8b39c0b7..5d5bd9e6 100644 --- a/src/components/viewComponents/streamDisplay.vue +++ b/src/components/viewComponents/streamDisplay.vue @@ -57,24 +57,20 @@ export default { ); }, streamImgUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/streams/mjpeg`; + return `${this.$store.getters.baseUri}/api/v2/streams/mjpeg`; }, startPreviewUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port + return `${ + this.$store.getters.baseUri }/api/v2/actions/camera/preview/start`; }, stopPreviewUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port + return `${ + this.$store.getters.baseUri }/api/v2/actions/camera/preview/stop`; }, settingsUri: function() { - return `http://${this.$store.state.host}:${ - this.$store.state.port - }/api/v2/settings`; + return `${this.$store.getters.baseUri}/api/v2/settings`; } },