Display the microscope's hostname in the interface

This commit is contained in:
Richard Bowman 2024-01-17 11:55:03 +00:00
parent 36a7ec3d2e
commit 674704b0d6
3 changed files with 17 additions and 1 deletions

View file

@ -321,6 +321,13 @@ export default {
); );
} }
} }
try {
let hostname = await this.readThingProperty("settings", "hostname");
this.$store.commit("changeMicroscopeHostname", hostname);
document.title = `OpenFlexure Microscope: ${hostname}`;
} catch {
this.$store.commit("changeMicroscopeHostname", null);
}
this.$store.commit("setConnected"); this.$store.commit("setConnected");
this.$store.commit("setErrorMessage", null); this.$store.commit("setErrorMessage", null);
} catch (error) { } catch (error) {

View file

@ -2,6 +2,11 @@
<div class="host-input"> <div class="host-input">
<div v-if="$store.state.available"> <div v-if="$store.state.available">
<div> <div>
<div class="uk-margin-small-bottom">
<b>Microscope hostname:</b>
<br />
{{ $store.state.microscopeHostname }}
</div>
<div class="uk-margin-small-bottom"> <div class="uk-margin-small-bottom">
<b>API origin:</b> <b>API origin:</b>
<br /> <br />

View file

@ -91,7 +91,8 @@ export default new Vuex.Store({
imjoyEnabled: false, imjoyEnabled: false,
galleryEnabled: true, galleryEnabled: true,
appTheme: "system", appTheme: "system",
activeStreams: {} activeStreams: {},
microscopeHostname: ""
}, },
mutations: { mutations: {
@ -144,6 +145,9 @@ export default new Vuex.Store({
}, },
removeStream(state, id) { removeStream(state, id) {
state.activeStreams[id] = false; state.activeStreams[id] = false;
},
changeMicroscopeHostname(state, value) {
state.microscopeHostname = value;
} }
}, },