Improve importing of tabs

This commit is contained in:
Julian Stirling 2025-11-07 12:54:00 +00:00
parent 2ca69f9420
commit bb5bc503ef
3 changed files with 10 additions and 23 deletions

View file

@ -81,19 +81,18 @@ import tabIcon from "./genericComponents/tabIcon";
import tabContent from "./genericComponents/tabContent"; import tabContent from "./genericComponents/tabContent";
// Import new content components // Import new content components
import controlContent from "./tabContentComponents/controlContent.vue";
import slideScanContent from "./tabContentComponents/slideScanContent.vue";
import backgroundDetectContent from "./tabContentComponents/backgroundDetectContent.vue";
import viewContent from "./tabContentComponents/viewContent.vue";
import settingsContent from "./tabContentComponents/settingsContent.vue";
import aboutContent from "./tabContentComponents/aboutContent.vue"; import aboutContent from "./tabContentComponents/aboutContent.vue";
import backgroundDetectContent from "./tabContentComponents/backgroundDetectContent.vue";
import controlContent from "./tabContentComponents/controlContent.vue";
import loggingContent from "./tabContentComponents/loggingContent.vue"; import loggingContent from "./tabContentComponents/loggingContent.vue";
import powerContent from "./tabContentComponents/powerContent.vue"; import powerContent from "./tabContentComponents/powerContent.vue";
import scanListContent from "./tabContentComponents/scanListContent.vue";
import settingsContent from "./tabContentComponents/settingsContent.vue";
import slideScanContent from "./tabContentComponents/slideScanContent.vue";
import viewContent from "./tabContentComponents/viewContent.vue";
// Import modal components for device initialisation // Import modal components for device initialisation
import calibrationWizard from "./modalComponents/calibrationWizard.vue"; import calibrationWizard from "./modalComponents/calibrationWizard.vue";
import TabIcon from "./genericComponents/tabIcon.vue";
import ScanListContent from "./tabContentComponents/scanListContent.vue";
// Export main app // Export main app
export default { export default {
@ -102,15 +101,7 @@ export default {
components: { components: {
tabIcon, tabIcon,
tabContent, tabContent,
controlContent,
slideScanContent,
viewContent,
settingsContent,
calibrationWizard, calibrationWizard,
aboutContent,
loggingContent,
TabIcon,
powerContent,
}, },
data: function () { data: function () {
return { return {
@ -178,12 +169,9 @@ export default {
{ {
id: "scan list", id: "scan list",
icon: "photo_library", icon: "photo_library",
component: ScanListContent, component: scanListContent,
}, },
]; ];
if (!this.$store.state.galleryEnabled) {
tabs = tabs.filter((tab) => tab.id != "gallery");
}
return tabs; return tabs;
}, },
allTabs() { allTabs() {

View file

@ -66,7 +66,6 @@ export default new Vuex.Store({
error: "", error: "",
autoGpuPreview: false, autoGpuPreview: false,
trackWindow: true, trackWindow: true,
galleryEnabled: true,
activeStreams: {}, activeStreams: {},
microscopeHostname: "", microscopeHostname: "",
// Persistent items: // Persistent items:
@ -108,9 +107,6 @@ export default new Vuex.Store({
changeAppTheme(state, theme) { changeAppTheme(state, theme) {
state.appTheme = theme; state.appTheme = theme;
}, },
changeGalleryEnabled(state, enabled) {
state.galleryEnabled = enabled;
},
resetState(state) { resetState(state) {
state.waiting = false; state.waiting = false;
state.available = false; state.available = false;

View file

@ -51,6 +51,9 @@ export const wotStoreModule = {
thingDescriptions: (state) => { thingDescriptions: (state) => {
return state.thingDescriptions; return state.thingDescriptions;
}, },
thingList: (state) => {
return Object.keys(state.thingDescriptions);
},
thingDescription: (state) => (thingName) => { thingDescription: (state) => (thingName) => {
return state.thingDescriptions[thingName]; return state.thingDescriptions[thingName];
}, },