diff --git a/README.md b/README.md index cc20282..9c182e7 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,8 @@ docker run -p 3000:3000 eclipsebasyx/aas-ui `-e BASE_PATH=` +`-e ENDPOINT_CONFIG_AVAILABLE=` + 4. If you want to use a custom logo, you can mount a folder containing the logo and the favicon.ico to the container by adding the following argument to the run command: `-v :/usr/src/app/dist/Logo` @@ -210,6 +212,7 @@ aas-web-gui: LOGO_LIGHT_PATH: "" LOGO_DARK_PATH: "" BASE_PATH: "" + ENDPOINT_CONFIG_AVAILABLE: "" volumes: - :/usr/src/app/dist/Logo ``` diff --git a/aas-web-ui/entrypoint.sh b/aas-web-ui/entrypoint.sh index cd83a39..895862b 100644 --- a/aas-web-ui/entrypoint.sh +++ b/aas-web-ui/entrypoint.sh @@ -74,6 +74,10 @@ if [ -n "$KEYCLOAK_CLIENT_ID" ]; then jq '.keycloakClientId = env.KEYCLOAK_CLIENT_ID' /usr/src/app/dist/config.json > /tmp/config.json && mv /tmp/config.json /usr/src/app/dist/config.json fi +if [ -n "$ENDPOINT_CONFIG_AVAILABLE" ]; then + jq '.endpointConfigAvailable = env.ENDPOINT_CONFIG_AVAILABLE' /usr/src/app/dist/config.json > /tmp/config.json && mv /tmp/config.json /usr/src/app/dist/config.json +fi + if [ -n "$BASE_PATH" ]; then echo "=====================" echo "BASE_PATH: $BASE_PATH" diff --git a/aas-web-ui/package.json b/aas-web-ui/package.json index 38fea24..8d34b39 100644 --- a/aas-web-ui/package.json +++ b/aas-web-ui/package.json @@ -15,7 +15,7 @@ "@fontsource/roboto": "^5.0.14", "@mdi/font": "^7.4.47", "@vue-leaflet/vue-leaflet": "^0.10.1", - "apexcharts": "^3.54.1", + "apexcharts": "^4.0.0", "keycloak-js": "^25.0.4", "leaflet": "^1.9.4", "lodash": "^4.17.21", @@ -28,7 +28,7 @@ "vue": "^3.5.12", "vue-router": "^4.4.5", "vue3-apexcharts": "^1.7.0", - "vuetify": "^3.7.1", + "vuetify": "^3.7.4", "webfontloader": "^1.0.0" }, "devDependencies": { diff --git a/aas-web-ui/public/config.json b/aas-web-ui/public/config.json index 814607f..716c064 100644 --- a/aas-web-ui/public/config.json +++ b/aas-web-ui/public/config.json @@ -15,4 +15,5 @@ "keycloakUrl": "", "keycloakRealm": "", "keycloakClientId": "" + "endpointConfigAvailable": true } diff --git a/aas-web-ui/src/components/AppNavigation/AppNavigation.vue b/aas-web-ui/src/components/AppNavigation/AppNavigation.vue index 3a3f0bb..f0d50f8 100644 --- a/aas-web-ui/src/components/AppNavigation/AppNavigation.vue +++ b/aas-web-ui/src/components/AppNavigation/AppNavigation.vue @@ -251,6 +251,7 @@ mainMenu: false, // Variable to show the Main Menu mobileMenu: false, // Variable to show the Mobile Menu dashboardAvailable: false, // Dashboard Availability + endpointConfigAvailable: true, drawerVisibility: true, // Variable to show the AAS List Drawer }; }, @@ -321,6 +322,10 @@ } }, + getEndpointConfigAvailable() { + return this.envStore.getEndpointConfigAvailable; + }, + dashboardServicePath() { return this.envStore.getEnvDashboardServicePath; }, @@ -375,6 +380,7 @@ mounted() { this.isDashboardAvailable(); + this.endpointConfigAvailable = this.getEndpointConfigAvailable; // check the local storage for a saved theme preference let theme = localStorage.getItem('theme'); if (theme) { @@ -398,88 +404,97 @@ } // auto connect to aas discovery that was saved in local storage - let aasDiscoveryURL = window.localStorage.getItem('aasDiscoveryURL'); - if (aasDiscoveryURL) { - this.aasDiscoveryURL = aasDiscoveryURL; - this.connectToAASDiscovery(); - // console.log('DiscoveryURL was found in local storage', DiscoveryURL); - } else { - // if no discovery server was saved in local storage, check if an environment variable is set - if (this.EnvAASDiscoveryPath && this.EnvAASDiscoveryPath != '') { - this.aasDiscoveryURL = this.EnvAASDiscoveryPath; + if (this.endpointConfigAvailable) { + let aasDiscoveryURL = window.localStorage.getItem('aasDiscoveryURL'); + if (aasDiscoveryURL) { + this.aasDiscoveryURL = aasDiscoveryURL; this.connectToAASDiscovery(); + // console.log('DiscoveryURL was found in local storage', DiscoveryURL); } } + if (!this.aasDiscoveryURL && this.EnvAASDiscoveryPath && this.EnvAASDiscoveryPath != '') { + this.aasDiscoveryURL = this.EnvAASDiscoveryPath; + this.connectToAASDiscovery(); + } + // auto connect to aas registry that was saved in local storage - let aasRegistryURL = window.localStorage.getItem('aasRegistryURL'); - if (aasRegistryURL) { - this.aasRegistryURL = aasRegistryURL; - this.connectToAASRegistry(); - // console.log('RegistryURL was found in local storage', RegistryURL); - } else { - // if no registry server was saved in local storage, check if an environment variable is set - if (this.EnvAASRegistryPath && this.EnvAASRegistryPath != '') { - this.aasRegistryURL = this.EnvAASRegistryPath; + if (this.endpointConfigAvailable) { + let aasRegistryURL = window.localStorage.getItem('aasRegistryURL'); + if (aasRegistryURL) { + this.aasRegistryURL = aasRegistryURL; this.connectToAASRegistry(); + // console.log('RegistryURL was found in local storage', RegistryURL); } } + if (!this.aasRegistryURL && this.EnvAASRegistryPath && this.EnvAASRegistryPath != '') { + this.aasRegistryURL = this.EnvAASRegistryPath; + this.connectToAASRegistry(); + } + // auto connect to submodel registry that was saved in local storage - let submodelRegistryURL = window.localStorage.getItem('submodelRegistryURL'); - if (submodelRegistryURL) { - this.submodelRegistryURL = submodelRegistryURL; - this.connectToSubmodelRegistry(); - // console.log('SubmodelRegistryURL was found in local storage', SubmodelRegistryURL); - } else { - // if no submodel registry server was saved in local storage, check if an environment variable is set - if (this.EnvSubmodelRegistryPath && this.EnvSubmodelRegistryPath != '') { - this.submodelRegistryURL = this.EnvSubmodelRegistryPath; + if (this.endpointConfigAvailable) { + let submodelRegistryURL = window.localStorage.getItem('submodelRegistryURL'); + if (submodelRegistryURL) { + this.submodelRegistryURL = submodelRegistryURL; this.connectToSubmodelRegistry(); + // console.log('SubmodelRegistryURL was found in local storage', SubmodelRegistryURL); } } + if (!this.submodelRegistryURL && this.EnvSubmodelRegistryPath && this.EnvSubmodelRegistryPath != '') { + this.submodelRegistryURL = this.EnvSubmodelRegistryPath; + this.connectToSubmodelRegistry(); + } // auto connect to AAS Repository that was saved in local storage - let aasRepoURL = window.localStorage.getItem('AASRepoURL'); - if (aasRepoURL) { - this.AASRepoURL = aasRepoURL; - this.connectToEnvironment('AAS'); - // console.log('AASRepoURL was found in local storage', AASRepoURL); - } else { - // if no aas server was saved in local storage, check if an environment variable is set - if (this.EnvAASRepoPath && this.EnvAASRepoPath != '') { - this.AASRepoURL = this.EnvAASRepoPath; + if (this.endpointConfigAvailable) { + let aasRepoURL = window.localStorage.getItem('AASRepoURL'); + if (aasRepoURL) { + this.AASRepoURL = aasRepoURL; this.connectToEnvironment('AAS'); + // console.log('AASRepoURL was found in local storage', AASRepoURL); } } + if (!this.AASRepoURL && this.EnvAASRepoPath && this.EnvAASRepoPath != '') { + this.AASRepoURL = this.EnvAASRepoPath; + this.connectToEnvironment('AAS'); + } + // auto connect to Submodel Repository that was saved in local storage - let submodelRepoURL = window.localStorage.getItem('SubmodelRepoURL'); - if (submodelRepoURL) { - this.SubmodelRepoURL = submodelRepoURL; - this.connectToEnvironment('Submodel'); - // console.log('SubmodelRepoURL was found in local storage', SubmodelRepoURL); - } else { - // if no submodel server was saved in local storage, check if an environment variable is set - if (this.EnvSubmodelRepoPath && this.EnvSubmodelRepoPath != '') { - this.SubmodelRepoURL = this.EnvSubmodelRepoPath; + if (this.endpointConfigAvailable) { + let submodelRepoURL = window.localStorage.getItem('SubmodelRepoURL'); + if (submodelRepoURL) { + this.SubmodelRepoURL = submodelRepoURL; this.connectToEnvironment('Submodel'); + // // console.log('SubmodelRepoURL was found in local storage', SubmodelRepoURL); } } + if (!this.SubmodelRepoURL && this.EnvSubmodelRepoPath && this.EnvSubmodelRepoPath != '') { + this.SubmodelRepoURL = this.EnvSubmodelRepoPath; + this.connectToEnvironment('Submodel'); + } + // auto connect to Concept Description Repository that was saved in local storage - let conceptDescriptionRepoURL = window.localStorage.getItem('ConceptDescriptionRepoURL'); - if (conceptDescriptionRepoURL) { - this.ConceptDescriptionRepoURL = conceptDescriptionRepoURL; - this.connectToEnvironment('ConceptDescription'); - // console.log('ConceptDescriptionRepoURL was found in local storage', ConceptDescriptionRepoURL); - } else { - // if no concept description server was saved in local storage, check if an environment variable is set - if (this.EnvConceptDescriptionRepoPath && this.EnvConceptDescriptionRepoPath != '') { - this.ConceptDescriptionRepoURL = this.EnvConceptDescriptionRepoPath; + if (this.endpointConfigAvailable) { + let conceptDescriptionRepoURL = window.localStorage.getItem('ConceptDescriptionRepoURL'); + if (conceptDescriptionRepoURL) { + this.ConceptDescriptionRepoURL = conceptDescriptionRepoURL; this.connectToEnvironment('ConceptDescription'); + // console.log('ConceptDescriptionRepoURL was found in local storage', ConceptDescriptionRepoURL); } } + + if ( + !this.ConceptDescriptionRepoURL && + this.EnvConceptDescriptionRepoPath && + this.EnvConceptDescriptionRepoPath != '' + ) { + this.ConceptDescriptionRepoURL = this.EnvConceptDescriptionRepoPath; + this.connectToEnvironment('ConceptDescription'); + } }, methods: { diff --git a/aas-web-ui/src/components/AppNavigation/MainMenu.vue b/aas-web-ui/src/components/AppNavigation/MainMenu.vue index c1fbc1c..9412c52 100644 --- a/aas-web-ui/src/components/AppNavigation/MainMenu.vue +++ b/aas-web-ui/src/components/AppNavigation/MainMenu.vue @@ -1,18 +1,20 @@