{{
- capitalizeFirstLetter(referenceKey) + ': '
+ capitalizeFirstLetter(referenceKey) +
+ ' (' +
+ getReferences[referenceKey as 'first' | 'second'].type +
+ '): '
}}
-
+
- {{ '(' + value.type + ') ' }}{{ value.value }}
+ {{ '(' + keys.type + ') ' }}{{ keys.value }}
- Description:
+
+ {{ keys.type ? keys.type : 'Description:' }}
+
- {{ value.type }}
- {{ value.value }}
+ {{ keys.type }}
+ {{ keys.value }}
@@ -48,10 +53,10 @@
:loading="getLoadingState[referenceKey as 'first' | 'second']"
:disabled="getDisabledState[referenceKey as 'first' | 'second']"
@click="
- jumpToReferencedElement(
- getReferencedAAS[referenceKey as 'first' | 'second'],
- getReference[referenceKey as 'first' | 'second'],
- getReferencedSubmodel[referenceKey as 'first' | 'second']
+ jumpToReference(
+ getReferences[referenceKey as 'first' | 'second'],
+ getAasDescriptor[referenceKey as 'first' | 'second'],
+ getSmRef[referenceKey as 'first' | 'second']
)
"
>Jump, // Value of the first Reference (Array of Reference Keys)
- secondReference: [] as Array, // Value of the second Reference (Array of Reference Keys)
+ firstReference: {} as any,
+ secondReference: {} as any,
+ // firstReferenceKeys: [] as Array, // Value of the first Reference (Array of Reference Keys)
+ // secondReferenceKeys: [] as Array, // Value of the second Reference (Array of Reference Keys)
+ // firstReferenceType: '' as string,
+ // secondReferenceType: '' as string,
firstLoading: false, // Loading State of the first Jump-Button (loading when checking if referenced element exists in one of the registered AAS)
secondLoading: false, // Loading State of the second Jump-Button (loading when checking if referenced element exists in one of the registered AAS)
firstDisabled: true, // Disabled State of the first Jump-Button (disabled when referenced element does not exist in one of the registered AAS)
secondDisabled: true, // Disabled State of the second Jump-Button (disabled when referenced element does not exist in one of the registered AAS)
- firstReferencedAAS: Object as any, // first AAS in which the referenced Element is included (if it exists)
- secondReferencedAAS: Object as any, // second AAS in which the referenced Element is included (if it exists)
- firstReferencedSubmodel: Object as any, // first Submodel in which the referenced Element is included (if it exists)
- secondReferencedSubmodel: Object as any, // second Submodel in which the referenced Element is included (if it exists)
+ firstAasDescriptor: Object as any, // first AAS in which the referenced Element is included (if it exists)
+ secondAasDescriptor: Object as any, // second AAS in which the referenced Element is included (if it exists)
+ firstSmRef: Object as any, // first Submodel in which the referenced Element is included (if it exists)
+ secondSmRef: Object as any, // second Submodel in which the referenced Element is included (if it exists)
};
},
computed: {
- // Get the selected Treeview Node (SubmodelElement) from the store
- SelectedNode() {
- return this.aasStore.getSelectedNode;
- },
-
// Get the referenceObject based on the referenceKey
- getReference() {
+ getReferences() {
return {
first: this.firstReference,
second: this.secondReference,
@@ -121,18 +125,18 @@
},
// Get the referencedAAS based on the referenceKey
- getReferencedAAS() {
+ getAasDescriptor() {
return {
- first: this.firstReferencedAAS,
- second: this.secondReferencedAAS,
+ first: this.firstAasDescriptor,
+ second: this.secondAasDescriptor,
};
},
// Get the referencedSubmodel based on the referenceKey
- getReferencedSubmodel() {
+ getSmRef() {
return {
- first: this.firstReferencedSubmodel,
- second: this.secondReferencedSubmodel,
+ first: this.firstSmRef,
+ second: this.secondSmRef,
};
},
@@ -154,21 +158,12 @@
},
watch: {
- // Watch for changes in the selected Node and reset input
- SelectedNode: {
- deep: true,
- handler() {
- this.firstReference = [];
- this.secondReference = [];
- },
- },
-
- // Watch for changes in the referenceElementObject
- referenceElementObject: {
+ // Watch for changes in the relationshipElementObject
+ relationshipElementObject: {
deep: true,
handler() {
- this.firstReference = this.relationshipElementObject.first.keys;
- this.secondReference = this.relationshipElementObject.second.keys;
+ this.firstReference = this.relationshipElementObject.first;
+ this.secondReference = this.relationshipElementObject.second;
this.validateReference('first');
this.validateReference('second');
},
@@ -176,31 +171,36 @@
},
mounted() {
- // console.log('RelationshipElement Mounted:', this.relationshipElementObject);
- this.firstReference = this.relationshipElementObject.first.keys;
- this.secondReference = this.relationshipElementObject.second.keys;
+ this.firstReference = this.relationshipElementObject.first;
+ this.secondReference = this.relationshipElementObject.second;
this.validateReference('first');
this.validateReference('second');
},
methods: {
// Function to check if the referenced Element exists
- validateReference(reference: string) {
- (this as any)[reference + 'Loading'] = true;
- this.checkReference((this as any)[reference + 'Reference'])
- .then(({ success, aas, submodel }) => {
- // console.log('checkReference: ', success, aas, submodel);
+ validateReference(referenceKey: string) {
+ (this as any)[referenceKey + 'Loading'] = true;
+
+ this.checkReference((this as any)[referenceKey + 'Reference'], this.selectedAAS)
+ .then(({ success, aasDescriptor, submodelRef }) => {
+ // console.log(
+ // 'validateReference (' + referenceKey + ') --> checkReference: ',
+ // success,
+ // aasDescriptor,
+ // submodelRef
+ // );
if (success) {
- (this as any)[reference + 'ReferencedAAS'] = aas;
- (this as any)[reference + 'ReferencedSubmodel'] = submodel;
- (this as any)[reference + 'Disabled'] = false;
+ (this as any)[referenceKey + 'AasDescriptor'] = aasDescriptor;
+ (this as any)[referenceKey + 'SmRef'] = submodelRef;
+ (this as any)[referenceKey + 'Disabled'] = false;
}
- (this as any)[reference + 'Loading'] = false;
+ (this as any)[referenceKey + 'Loading'] = false;
})
.catch((error) => {
// Handle any errors
console.error('Error:', error);
- (this as any)[reference + 'Loading'] = false;
+ (this as any)[referenceKey + 'Loading'] = false;
});
},
},
diff --git a/aas-web-ui/src/components/SubmodelList.vue b/aas-web-ui/src/components/SubmodelList.vue
index 7ec9c0c..3d66639 100644
--- a/aas-web-ui/src/components/SubmodelList.vue
+++ b/aas-web-ui/src/components/SubmodelList.vue
@@ -9,9 +9,9 @@
Submodel List
-
+
{{
- 'AAS: ' + nameToDisplay(SelectedAAS)
+ 'AAS: ' + nameToDisplay(selectedAAS)
}}
@@ -21,36 +21,42 @@
-
-
-
- SM
-
- {{
- submodel.idShort
- }}
-
-
+
+
+
+
+
+ SM
+
+ {{
+ submodel.idShort
+ }}
+
+
+
@@ -103,7 +109,7 @@
},
// get selected AAS from Store
- SelectedAAS() {
+ selectedAAS() {
return this.aasStore.getSelectedAAS;
},
@@ -139,11 +145,8 @@
watch: {
// initialize Submodel List when AAS gets selected or changes
- SelectedAAS: {
- deep: true,
- handler() {
- this.initSubmodelList();
- },
+ selectedAAS() {
+ this.initSubmodelList();
},
// Resets the Submodel List when the AAS Registry changes
@@ -166,72 +169,37 @@
},
methods: {
- initSubmodelList() {
- // console.log("initialize Submodel List: ", this.SelectedAAS);
+ async initSubmodelList() {
+ // console.log('Initialize SubmodelList', this.SelectedAAS, this.initialUpdate, this.initialNode);
// return if no endpoints are available
- if (!this.SelectedAAS || !this.SelectedAAS.endpoints || this.SelectedAAS.endpoints.length === 0) {
+ if (!this.selectedAAS || !this.selectedAAS.endpoints || this.selectedAAS.endpoints.length === 0) {
// this.navigationStore.dispatchSnackbar({ status: true, timeout: 4000, color: 'error', btnColor: 'buttonText', text: 'AAS with no (valid) Endpoint selected!' });
this.submodelData = [];
return;
}
- if (this.loading) return; // return if loading state is true -> prevents multiple requests
+ if (this.loading && !this.initialUpdate) return; // return if loading state is true -> prevents multiple requests
this.aasStore.dispatchLoadingState(true); // set loading state to true
- this.submodelData = []; // reset Submdoel List Data
- // retrieve AAS from endpoint
- const shellHref = this.extractEndpointHref(this.SelectedAAS, 'AAS-3.0');
- let path = shellHref;
- let context = 'retrieving AAS Data';
- let disableMessage = false;
- this.getRequest(path, context, disableMessage)
- .then(async (response: any) => {
- if (response.success) {
- // execute if the Request was successful
- try {
- let AAS = response.data;
- AAS.endpoints = this.SelectedAAS.endpoints;
- this.aasStore.dispatchSelectedAAS(AAS); // dispatch the selected AAS to the Store
- // request submodels from the retrieved AAS
- let submodelData = await this.requestSubmodels(AAS.submodels);
- if (this.initialUpdate && this.initialNode) {
- // set the isActive Property of the initial Node to true and dispatch it to the store
- submodelData.forEach((submodel: any) => {
- if (submodel.path === this.initialNode.path) {
- submodel.isActive = true;
- this.aasStore.dispatchNode(submodel);
- this.aasStore.dispatchRealTimeObject(submodel);
- }
- });
- this.initialUpdate = false;
- this.initialNode = {};
- this.submodelData = submodelData; // set the Submodel Data
- } else {
- this.submodelData = submodelData; // set the Submodel Data
- }
- } catch (error: any) {
- // console.error('Error while parsing the Submodel References: ', error);
- const errorMessage = error.message;
- const errorStack = error.stack;
- const errorLocation = errorStack ? errorStack.split('\n')[1] : '';
- this.navigationStore.dispatchSnackbar({
- status: true,
- timeout: 60000,
- color: 'error',
- btnColor: 'buttonText',
- baseError: 'Error while parsing the Submodel References!',
- extendedError: `Error: ${errorMessage}\nLocation: ${errorLocation.trim()}`,
- });
- } finally {
- this.aasStore.dispatchLoadingState(false);
+ if (this.selectedAAS.submodels) {
+ let submodelData = await this.requestSubmodels(this.selectedAAS.submodels);
+ // set the isActive prop of the initialNode if it exists and the initialUpdate flag is set
+ if (this.initialUpdate && this.initialNode) {
+ submodelData.forEach((submodel: any) => {
+ if (submodel.path === this.initialNode.path) {
+ submodel.isActive = true;
+ this.aasStore.dispatchNode(submodel);
+ this.aasStore.dispatchRealTimeObject(submodel);
}
- } else {
- // execute if the Request failed
- this.submodelData = [];
- this.aasStore.dispatchLoadingState(false);
- }
- })
- .catch(() => {
- this.aasStore.dispatchLoadingState(false);
- });
+ });
+ this.initialUpdate = false;
+ this.initialNode = {};
+ this.submodelData = submodelData;
+ } else {
+ this.submodelData = submodelData;
+ }
+ } else {
+ this.submodelData = [];
+ }
+ this.aasStore.dispatchLoadingState(false);
},
// Function to request all Submodels for the selected AAS
@@ -312,13 +280,13 @@
});
// Add path of the selected Node to the URL as Router Query
if (localSubmodel.isActive) {
- const shellHref = this.extractEndpointHref(this.SelectedAAS, 'AAS-3.0');
+ const aasEndpopint = this.extractEndpointHref(this.selectedAAS, 'AAS-3.0');
if (this.isMobile) {
// Change to SubmodelElementView on Mobile and add the path to the URL
this.router.push({
path: '/componentvisualization',
query: {
- aas: shellHref,
+ aas: aasEndpopint,
path: localSubmodel.path,
},
});
@@ -326,7 +294,7 @@
// just add the path to the URL
this.router.push({
query: {
- aas: shellHref,
+ aas: aasEndpopint,
path: localSubmodel.path,
},
});
@@ -345,9 +313,9 @@
// Function to initialize the Submodel List with the Route Parameters
initSubmodelListWithRouteParameters() {
- // check if the SelectedAAS is already set in the Store and initialize the Submodel List if so
- if (this.SelectedAAS && this.SelectedAAS.endpoints && this.SelectedAAS.endpoints.length > 0) {
- // console.log('init Tree from Route Params: ', this.SelectedAAS);
+ // check if the selectedAAS is already set in the Store and initialize the Submodel List if so
+ if (this.selectedAAS && this.selectedAAS.endpoints && this.selectedAAS.endpoints.length > 0) {
+ // console.log('init Tree from Route Params: ', this.selectedAAS);
this.initSubmodelList();
}
diff --git a/aas-web-ui/src/components/UIComponents/VTreeview.vue b/aas-web-ui/src/components/UIComponents/VTreeview.vue
index 2449b00..b74dfd9 100644
--- a/aas-web-ui/src/components/UIComponents/VTreeview.vue
+++ b/aas-web-ui/src/components/UIComponents/VTreeview.vue
@@ -23,35 +23,35 @@
@click.stop="toggleChildren()">
-
mdi-folder-lock
-
+
mdi-folder-lock
-
mdi-folder-alert
-
+
+ mdi-folder-alert
+
-
{{ showChildren ? "mdi-folder-open" : "mdi-folder" }}
+
+ {{ showChildren ? 'mdi-folder-open' : 'mdi-folder' }}
+
-
mdi-file-alert
+
+ mdi-file-alert
+
-
mdi-file-multiple
+
+ mdi-file-multiple
+
-
mdi-file-alert
+
+ mdi-file-alert
+
mdi-list-box
-
mdi-file-alert
+
+ mdi-file-alert
+
mdi-format-list-group
@@ -160,13 +160,13 @@
localItem.isActive = !localItem.isActive;
// Add path of the selected Node to the URL as Router Query
if (localItem.isActive) {
- const shellHref = this.extractEndpointHref(this.SelectedAAS, 'AAS-3.0');
+ const aasEndpopint = this.extractEndpointHref(this.SelectedAAS, 'AAS-3.0');
if (this.isMobile) {
// Change to SubmodelElementView on Mobile and add the path to the URL
this.router.push({
path: '/submodelelementview',
query: {
- aas: shellHref,
+ aas: aasEndpopint,
path: localItem.path,
},
});
@@ -174,7 +174,7 @@
// just add the path to the URL
this.router.push({
query: {
- aas: shellHref,
+ aas: aasEndpopint,
path: localItem.path,
},
});
diff --git a/aas-web-ui/src/mixins/DashboardHandling.ts b/aas-web-ui/src/mixins/DashboardHandling.ts
index ade1365..7fdc87b 100644
--- a/aas-web-ui/src/mixins/DashboardHandling.ts
+++ b/aas-web-ui/src/mixins/DashboardHandling.ts
@@ -161,8 +161,8 @@ export default defineComponent({
// console.log(this.SelectedAAS)
return this.SelectedAAS;
} else {
- const shellHref = this.extractEndpointHref(this.SelectedAAS, 'AAS-3.0');
- const path = shellHref;
+ const aasEndpopint = this.extractEndpointHref(this.SelectedAAS, 'AAS-3.0');
+ const path = aasEndpopint;
const context = 'getting aas from endpoint';
const disableMessage = false;
const response = await this.getRequest(path, context, disableMessage);
diff --git a/aas-web-ui/src/mixins/SubmodelElementHandling.ts b/aas-web-ui/src/mixins/SubmodelElementHandling.ts
index 11dc416..103587d 100644
--- a/aas-web-ui/src/mixins/SubmodelElementHandling.ts
+++ b/aas-web-ui/src/mixins/SubmodelElementHandling.ts
@@ -24,22 +24,22 @@ export default defineComponent({
computed: {
// get AAS Discovery URL from Store
- aasDiscoveryURLMixin() {
+ aasDiscoveryUrl() {
return this.navigationStore.getAASDiscoveryURL;
},
// get AAS Registry URL from Store
- aasRegistryURLMixin() {
+ aasRegistryUrl() {
return this.navigationStore.getAASRegistryURL;
},
// Get the Submodel Repository URL from the Store
- submodelRepoURL() {
+ submodelRepoUrl() {
return this.navigationStore.getSubmodelRepoURL;
},
// Get the Concept Description Repository URL from the Store
- conceptDescriptionRepoURL() {
+ conceptDescriptionRepoUrl() {
return this.navigationStore.getConceptDescriptionRepoURL;
},
@@ -356,126 +356,321 @@ export default defineComponent({
// Function to check if the referenced Element exists
async checkReference(
- referenceValue: Array
- ): Promise<{ success: boolean; aas?: object; submodel?: object }> {
- // console.log('Reference Value: ', referenceValue);
- // check if aasRegistryURL includes "/shell-descriptors" and add id if not (backward compatibility)
- if (!this.aasRegistryURLMixin.includes('/shell-descriptors')) {
- this.aasRegistryURLMixin += '/shell-descriptors';
- }
- const path = this.aasRegistryURLMixin;
- const context = 'retrieving AAS Data';
- const disableMessage = false;
- try {
- const response = await this.getRequest(path, context, disableMessage);
- // console.log('Response: ', response);
- if (response.success && response.data.result && response.data.result.length > 0) {
- const aasList = response.data.result;
- if (referenceValue[0].type == 'AssetAdministrationShell') {
- return await this.checkReferenceAAS(aasList, referenceValue);
+ reference: any,
+ currentAasDescriptor?: any
+ ): Promise<{ success: boolean; aasDescriptor?: object; submodelRef?: object }> {
+ // console.log(
+ // 'checkReference (' + reference.type + '): ',
+ // 'reference',
+ // reference,
+ // 'currentAasDescriptor',
+ // currentAasDescriptor
+ // );
+ // TODO This check just works down to SM level. It is not working for checking the availability of a specific SME!
+ const failResponse = { success: false, aasDescriptor: {}, submodelRef: {} }; // Define once for reuse
+
+ if (reference.type === 'ExternalReference') {
+ // Check ExternalReference
+ let aasRegistryUrl = this.aasRegistryUrl;
+ if (!aasRegistryUrl.includes('/shell-descriptors')) {
+ aasRegistryUrl += '/shell-descriptors';
+ }
+ const aasRegistryPath = aasRegistryUrl;
+ const aasRegistryContext = 'retrieving AAS Descriptors';
+ const disableMessage = false;
+ try {
+ const aasRegistryResponse = await this.getRequest(
+ aasRegistryPath,
+ aasRegistryContext,
+ disableMessage
+ );
+ if (
+ aasRegistryResponse.success &&
+ aasRegistryResponse.data.result &&
+ aasRegistryResponse.data.result.length > 0
+ ) {
+ const aasDescriptorList = aasRegistryResponse.data.result;
+
+ if (reference?.keys[0]?.type === 'AssetAdministrationShell') {
+ if (reference?.keys[1]?.type === 'Submodel') {
+ return await this.checkSmReference(reference, aasDescriptorList);
+ }
+ return await this.checkAasReference(reference, aasDescriptorList);
+ } else if (reference?.keys[0]?.type === 'Submodel') {
+ return await this.checkSmReference(reference, aasDescriptorList, currentAasDescriptor);
+ } else {
+ return failResponse;
+ }
}
- if (referenceValue[0].type == 'Submodel') {
- return await this.checkReferenceSubmodel(aasList, referenceValue);
+ return failResponse;
+ } catch {
+ // handle error
+ return failResponse;
+ }
+ } else if (reference.type === 'ModelReference') {
+ // Check ModelReference
+ let aasDescriptor = {};
+ if (reference?.keys[0]?.type === 'AssetAdministrationShell') {
+ aasDescriptor = await this.checkAasReference(reference).then(({ aasDescriptor }) => {
+ return aasDescriptor;
+ });
+ } else if (Object.keys(currentAasDescriptor).length > 0) {
+ aasDescriptor = currentAasDescriptor;
+ }
+
+ if (Object.keys(aasDescriptor).length > 0) {
+ const aasDescriptorList = [aasDescriptor];
+
+ if (reference?.keys[0]?.type === 'AssetAdministrationShell') {
+ if (reference?.keys[1]?.type === 'Submodel') {
+ return await this.checkSmReference(reference, aasDescriptorList, aasDescriptor);
+ }
+ return await this.checkAasReference(reference, aasDescriptorList);
+ } else if (reference?.keys[0]?.type === 'Submodel') {
+ return await this.checkSmReference(reference, aasDescriptorList, aasDescriptor);
}
}
- return { success: false, aas: {}, submodel: {} };
- } catch {
- // handle error
- return { success: false, aas: {}, submodel: {} };
+ return failResponse;
+ } else {
+ return failResponse;
}
},
// Function to check if the referenced AAS exists
- async checkReferenceAAS(
- aasList: Array,
- referenceValue: Array
- ): Promise<{ success: boolean; aas?: object; submodel?: object }> {
- try {
- aasList.forEach((aas: any) => {
- if (aas.id == referenceValue[0].value) {
- // console.log('AAS found. AAS: ', { success: true, aas: aas, submodel: {} });
- throw { success: true, aas: aas, submodel: {} };
+ async checkAasReference(
+ aasReference: any,
+ aasDescriptorList?: Array
+ ): Promise<{ success: boolean; aasDescriptor: object; submodelDescriptor: object }> {
+ // console.log('checkAasReference', 'aasReference', aasReference, 'aasDescriptorList', aasDescriptorList);
+ const failResponse = { success: false, aasDescriptor: {}, submodelDescriptor: {} }; // Define once for reuse
+
+ if (aasReference?.keys[0]?.type !== 'AssetAdministrationShell') return failResponse;
+
+ if (!Array.isArray(aasDescriptorList) || aasDescriptorList.length === 0) {
+ let aasRegistryUrl = this.aasRegistryUrl;
+ if (!aasRegistryUrl.includes('/shell-descriptors')) {
+ aasRegistryUrl += '/shell-descriptors';
+ }
+ const aasRegistryPath = aasRegistryUrl;
+ const aasRegistryContext = 'retrieving AAS Descriptors';
+ const disableMessage = false;
+ try {
+ const aasRegistryResponse = await this.getRequest(
+ aasRegistryPath,
+ aasRegistryContext,
+ disableMessage
+ );
+ if (
+ aasRegistryResponse.success &&
+ aasRegistryResponse.data.result &&
+ aasRegistryResponse.data.result.length > 0
+ ) {
+ aasDescriptorList = aasRegistryResponse.data.result;
}
- });
- } catch (result: any) {
- if (result.success) {
- return result;
- } else {
- throw result; // re-throw if it's an actual error
+ } catch {
+ // handle error
+ return failResponse;
}
}
- return { success: false, aas: {}, submodel: {} };
- },
-
- // Function to check if the referenced Submodel (+ SubmodelElement) exists
- async checkReferenceSubmodel(
- aasList: Array,
- referenceValue: Array
- ): Promise<{ success: boolean; aas?: object; submodel?: object }> {
- const promises = aasList.map(async (aas: any) => {
- const shellHref = this.extractEndpointHref(aas, 'AAS-3.0');
- const path = shellHref + '/submodel-refs';
- const context = 'retrieving Submodel References';
- const disableMessage = false;
- const response = await this.getRequest(path, context, disableMessage);
- if (response.success) {
- const submodelList = response.data.result;
- const foundSubmodel = submodelList.find(
- (submodel: any) => submodel.keys[0].value == referenceValue[0].value
- );
- if (foundSubmodel) {
- return { success: true, aas: aas, submodel: foundSubmodel };
+ if (Array.isArray(aasDescriptorList) && aasDescriptorList.length > 0) {
+ const aasDescriptor = aasDescriptorList.find((aasDescriptor: any) => {
+ return aasDescriptor.id == aasReference?.keys[0]?.value;
+ });
+
+ return {
+ success: aasDescriptor ? true : false,
+ aasDescriptor: aasDescriptor ? aasDescriptor : {},
+ submodelDescriptor: {},
+ };
+ }
+
+ return failResponse;
+ },
+
+ // Function to check if the referenced Submodel (+ SubmodelElement) exists (in aasDescriptor)
+ async checkSmReference(
+ smReference: any,
+ aasDescriptorList: Array,
+ currentAasDescriptor?: any
+ ): Promise<{ success: boolean; aasDescriptor?: object; submodelRef?: object }> {
+ console.log(
+ 'checkSmReference (' + smReference.type + '): ',
+ 'smReference',
+ smReference,
+ 'aasDescriptorList (#' + (Array.isArray(aasDescriptorList) ? aasDescriptorList.length : 0) + ')',
+ aasDescriptorList,
+ 'currentAasDescriptor',
+ currentAasDescriptor
+ );
+ const failResponse = { success: false, aasDescriptor: {}, submodelRef: {} }; // Define once for reuse
+ if (smReference.type === 'ExternalReference') {
+ // Check ExternalReference
+ const promises = aasDescriptorList.map(async (aasDescriptor: any) => {
+ const aasEndpoint = this.extractEndpointHref(aasDescriptor, 'AAS-3.0');
+ const aasRepoPath = aasEndpoint + '/submodel-refs';
+ const aasRepoContext = 'retrieving Submodel References';
+ const disableMessage = false;
+
+ const aasRepoResponse = await this.getRequest(aasRepoPath, aasRepoContext, disableMessage);
+ if (aasRepoResponse.success) {
+ const submodelRefList = aasRepoResponse.data.result;
+ let foundSubmodelRef = {};
+ if (smReference?.keys[0]?.type === 'Submodel') {
+ foundSubmodelRef = submodelRefList.find(
+ (submodelRef: any) => submodelRef.keys[0].value == smReference.keys[0].value
+ );
+ } else if (
+ smReference?.keys[0]?.type === 'AssetAdministrationShell' &&
+ smReference?.keys[0].value === aasDescriptor?.id &&
+ smReference?.keys[1]?.type === 'Submodel'
+ ) {
+ foundSubmodelRef = submodelRefList.find(
+ (submodelRef: any) => submodelRef.keys[0].value == smReference.keys[1].value
+ );
+ }
+ if (Object.keys(foundSubmodelRef).length > 0) {
+ return { success: true, aasDescriptor: aasDescriptor, submodelRef: foundSubmodelRef };
+ }
}
+ return null; // null signifies that this particular iteration didn't find what it was looking for
+ });
+
+ const results = await Promise.all(promises);
+ const result = results.find((result) => result !== null);
+
+ if (result) return result; // One of the ieterations was successful
+ return { success: false, aasDescriptor: {}, submodelRef: {} }; // None of the iterations were successful
+ } else if (smReference.type === 'ModelReference') {
+ // Check ModelReference
+ let aasDescriptor = {};
+
+ if (smReference?.keys[0]?.type === 'AssetAdministrationShell') {
+ aasDescriptor = await this.checkAasReference(smReference).then(({ aasDescriptor }) => {
+ return aasDescriptor;
+ });
+ } else if (Object.keys(currentAasDescriptor).length > 0) {
+ aasDescriptor = currentAasDescriptor;
}
- return null; // null signifies that this particular iteration didn't find what it was looking for
- });
- const results = await Promise.all(promises);
- const foundResult = results.find((result) => result !== null);
+ if (
+ smReference?.keys[0]?.type === 'AssetAdministrationShell' &&
+ smReference?.keys[1]?.type === 'Submodel'
+ ) {
+ const promises = aasDescriptorList.map(async (aasDescriptor: any) => {
+ const aasEndpoint = this.extractEndpointHref(aasDescriptor, 'AAS-3.0');
+ const aasRepoPath = aasEndpoint + '/submodel-refs';
+ const aasRepoContext = 'retrieving Submodel References';
+ const disableMessage = false;
- if (foundResult) {
- return foundResult; // One of the iterations was successful
+ const aasRepoResponse = await this.getRequest(aasRepoPath, aasRepoContext, disableMessage);
+ if (aasRepoResponse.success) {
+ const submodelRefList = aasRepoResponse.data.result;
+ let foundSubmodelRef = {};
+ // if (
+ // smReference?.keys[0]?.type === 'AssetAdministrationShell' &&
+ // smReference?.keys[0].value === aasDescriptor?.id &&
+ // smReference?.keys[1]?.type === 'Submodel'
+ // ) {
+ foundSubmodelRef = submodelRefList.find(
+ (submodelRef: any) => submodelRef.keys[0].value == smReference.keys[1].value
+ );
+ // }
+ if (foundSubmodelRef && Object.keys(foundSubmodelRef).length > 0) {
+ console.log('foobar', true);
+ return {
+ success: true,
+ aasDescriptor: aasDescriptor,
+ submodelRef: foundSubmodelRef,
+ };
+ }
+ }
+ return null; // null signifies that this particular iteration didn't find what it was looking for
+ });
+
+ const results = await Promise.all(promises);
+ const result = results.find((result) => result !== null);
+
+ if (result) return result; // One of the ieterations was successful
+ return { success: false, aasDescriptor: {}, submodelRef: {} }; // None of the iterations were successful
+ } else if (Object.keys(aasDescriptor).length > 0 && smReference?.keys[0]?.type === 'Submodel') {
+ const aasEndpoint = this.extractEndpointHref(aasDescriptor, 'AAS-3.0');
+ const aasRepoPath = aasEndpoint + '/submodel-refs';
+ const aasRepoContext = 'retrieving Submodel References';
+ const disableMessage = false;
+
+ const aasRepoResponse = await this.getRequest(aasRepoPath, aasRepoContext, disableMessage);
+ if (aasRepoResponse.success) {
+ const submodelRefList = aasRepoResponse.data.result;
+ const foundSubmodelRef = submodelRefList.find(
+ (submodelRef: any) => submodelRef.keys[0].value == smReference.keys[0].value
+ );
+ if (foundSubmodelRef && Object.keys(foundSubmodelRef).length > 0) {
+ return {
+ success: true,
+ aasDescriptor: aasDescriptor,
+ submodelRef: foundSubmodelRef,
+ };
+ }
+ }
+ }
+
+ return { success: false, aasDescriptor: aasDescriptor, submodelRef: {} };
} else {
- return { success: false, aas: {}, submodel: {} }; // None of the iterations were successful
+ return failResponse;
}
},
// Function to jump to a referenced Element
- jumpToReferencedElement(referencedAAS: any, referenceValue: Array, referencedSubmodel?: any) {
- // console.log('jumpToReferencedElement. AAS: ', referencedAAS, 'Submodel: ', referencedSubmodel);
- const shellHref = this.extractEndpointHref(referencedAAS, 'AAS-3.0');
- const endpoint = shellHref;
- if (referencedSubmodel && Object.keys(referencedSubmodel).length > 0) {
+ jumpToReference(reference: any, aasDescriptor?: any, smRef?: any) {
+ console.log('jumpToReference', 'reference', reference, 'aasDescriptor', aasDescriptor, 'smRef', smRef);
+ if (smRef && Object.keys(smRef).length > 0) {
// if the referenced Element is a Submodel or SubmodelElement
- this.jumpToSubmodelElement(referencedSubmodel, referenceValue, referencedAAS, endpoint);
+ console.log(
+ 'jumpToReference --> jumpToSubmodelElement',
+ 'reference',
+ reference,
+ 'aasDescriptor',
+ aasDescriptor,
+ 'smRef',
+ smRef
+ );
+ this.jumpToSubmodelElement(reference, aasDescriptor, smRef);
} else {
// if the referenced Element is an AAS
- this.jumpToAAS(referencedAAS, endpoint);
+ console.log('jumpToReference --> jumpToAas', 'aasDescriptor', aasDescriptor);
+ this.jumpToAas(aasDescriptor);
}
},
- jumpToSubmodelElement(
- referencedSubmodel: any,
- referenceValue: Array,
- referencedAAS: any,
- endpoint: string
- ) {
- let path =
- this.submodelRepoURL + '/' + this.URLEncode(referencedSubmodel.keys[0].value).replace(/%3D/g, '');
- if (referenceValue.length > 1) {
+ jumpToSubmodelElement(reference: any, aasDescriptor: any, smRef: any) {
+ console.log(
+ 'jumpToSubmodelElement: ',
+ 'reference',
+ reference,
+ 'aasDescriptor',
+ aasDescriptor,
+ 'smRef',
+ smRef
+ );
+ return;
+
+ const aasEndpoint = this.extractEndpointHref(aasDescriptor, 'AAS-3.0');
+
+ let path = this.submodelRepoUrl + '/' + this.URLEncode(smRef.keys[0].value).replace(/%3D/g, '');
+
+ if (reference.value.keys.length > 1) {
// this is the layer directly under the Submodel
- path += '/submodel-elements/' + referenceValue[1].value;
+ path += '/submodel-elements/' + reference.value.keys[1].value;
}
let promise; // Promise to wait for the SubmodelElementList to be requested (if it exists)
- if (referenceValue.length > 2) {
+ if (reference.value.keys.length > 2) {
// this is the layer under either a SubmodelElementCollection or SubmodelElementList
promise = new Promise((resolve, reject) => {
- referenceValue.forEach((SubmodelElement: any, index: number) => {
+ reference.value.keys.forEach((SubmodelElement: any, index: number) => {
if (index > 1) {
// check if the type of the SubmodelElement with index - 1 is a SubmodelElementList
- if (referenceValue[index - 1].type == 'SubmodelElementList') {
- // console.log('SubmodelElementList: ', this.referenceValue[index - 1])
+ if (reference.value.keys[index - 1].type == 'SubmodelElementList') {
// check in which position of the list the element is (list needs to be requested to get the position)
const listPath = path;
const context = 'retrieving SubmodelElementList';
@@ -503,9 +698,9 @@ export default defineComponent({
}
});
if (
- referenceValue.every(
+ reference.value.keys.every(
(SubmodelElement: any, index: number) =>
- index <= 1 || referenceValue[index - 1].type != 'SubmodelElementList'
+ index <= 1 || reference.value.keys[index - 1].type != 'SubmodelElementList'
)
) {
resolve(); // Resolve immediately if none of the elements are SubmodelElementList
@@ -515,113 +710,131 @@ export default defineComponent({
promise = Promise.resolve();
}
- promise
- .then(() => {
- // check if mobile device
- if (this.navigationStore.getIsMobile) {
- this.router.push({ name: 'SubmodelList', query: { aas: endpoint, path: path } });
+ promise.then(() => {
+ // check if mobile device
+ if (this.navigationStore.getIsMobile) {
+ this.router.push({ name: 'SubmodelList', query: { aas: aasEndpoint, path: path } });
+ } else {
+ // set the AAS Endpoint and SubmodelElement path in the aas and path query parameters using the router
+ this.router.push({ query: { aas: aasEndpoint, path: path } });
+ }
+ // dispatch the AAS set by the ReferenceElement to the store
+ this.loadAndDispatchAas(aasEndpoint);
+ this.navigationStore.dispatchTriggerAASListScroll();
+ // Request the referenced SubmodelElement
+ const elementPath = path;
+ const context = 'retrieving SubmodelElement';
+ const disableMessage = true;
+ this.getRequest(elementPath, context, disableMessage).then((response: any) => {
+ if (response.success) {
+ // execute if the Request was successful
+ response.data.timestamp = this.formatDate(new Date()); // add timestamp to the SubmodelElement Data
+ response.data.path = path; // add the path to the SubmodelElement Data
+ response.data.isActive = true; // add the isActive Property to the SubmodelElement Data
+ // console.log('SubmodelElement Data: ', response.data)
+ // dispatch the SubmodelElementPath set by the URL to the store
+ this.aasStore.dispatchNode(response.data); // set the updatedNode in the AASStore
+ this.aasStore.dispatchInitTreeByReferenceElement(true); // set the initTreeByReferenceElement in the AASStore to true to init + expand the Treeview on the referenced Element
} else {
- // set the AAS Endpoint and SubmodelElement path in the aas and path query parameters using the router
- this.router.push({ query: { aas: endpoint, path: path } });
- }
- // dispatch the AAS set by the ReferenceElement to the store
- this.aasStore.dispatchSelectedAAS(referencedAAS);
- this.navigationStore.dispatchTriggerAASSelected();
- this.navigationStore.dispatchTriggerAASListScroll();
- // Request the referenced SubmodelElement
- const elementPath = path;
- const context = 'retrieving SubmodelElement';
- const disableMessage = true;
- this.getRequest(elementPath, context, disableMessage).then((response: any) => {
- if (response.success) {
- // execute if the Request was successful
- response.data.timestamp = this.formatDate(new Date()); // add timestamp to the SubmodelElement Data
- response.data.path = path; // add the path to the SubmodelElement Data
- response.data.isActive = true; // add the isActive Property to the SubmodelElement Data
- // console.log('SubmodelElement Data: ', response.data)
- // dispatch the SubmodelElementPath set by the URL to the store
- this.aasStore.dispatchNode(response.data); // set the updatedNode in the AASStore
- this.aasStore.dispatchInitTreeByReferenceElement(true); // set the initTreeByReferenceElement in the AASStore to true to init + expand the Treeview on the referenced Element
- } else {
- // execute if the Request failed
- if (Object.keys(response.data).length == 0) {
- // don't copy the static SubmodelElement Data if no Node is selected or Node is invalid
- this.navigationStore.dispatchSnackbar({
- status: true,
- timeout: 60000,
- color: 'error',
- btnColor: 'buttonText',
- text: 'No valid SubmodelElement under the given Path',
- }); // Show Error Snackbar
- return;
- }
- this.aasStore.dispatchNode({});
+ // execute if the Request failed
+ if (Object.keys(response.data).length == 0) {
+ // don't copy the static SubmodelElement Data if no Node is selected or Node is invalid
+ this.navigationStore.dispatchSnackbar({
+ status: true,
+ timeout: 60000,
+ color: 'error',
+ btnColor: 'buttonText',
+ text: 'No valid SubmodelElement under the given Path',
+ }); // Show Error Snackbar
+ return;
}
- });
- })
- .catch((error) => {
- console.error('Error:', error);
+ this.aasStore.dispatchNode({});
+ }
});
+ });
+ // .catch((error) => {
+ // console.error('Error:', error);
+ // });
},
- jumpToAAS(aas: any, endpoint: string) {
+ async loadAndDispatchAas(aasEndpoint: string) {
+ const path = aasEndpoint;
+ const context = 'retrieving AAS Data';
+ const disableMessage = true;
+ this.getRequest(path, context, disableMessage).then((response: any) => {
+ if (response.success) {
+ const aas = response.data as any;
+ const endpoints = [];
+ endpoints.push({ protocolInformation: { href: aasEndpoint }, interface: 'AAS-3.0' });
+ aas.endpoints = endpoints;
+ this.aasStore.dispatchSelectedAAS(aas);
+ } else {
+ this.aasStore.dispatchSelectedAAS({});
+ }
+ });
+ },
+
+ async jumpToAas(aasDescriptor: any) {
+ console.log('jumpToAas', aasDescriptor);
+ const aasEndpoint = this.extractEndpointHref(aasDescriptor, 'AAS-3.0');
// check if mobile device
if (this.navigationStore.getIsMobile) {
- this.router.push({ name: 'SubmodelList', query: { aas: endpoint } });
+ this.router.push({ name: 'SubmodelList', query: { aas: aasEndpoint } });
} else {
// set the AAS Endpoint in the aas query parameter using the router
- this.router.push({ query: { aas: endpoint } });
+ this.router.push({ query: { aas: aasEndpoint } });
}
// dispatch the AAS set by the ReferenceElement to the store
// console.log('AAS:', aas, 'Endpoint:', endpoint);
- this.aasStore.dispatchSelectedAAS(aas);
- this.navigationStore.dispatchTriggerAASSelected();
+ await this.loadAndDispatchAas(aasEndpoint);
this.navigationStore.dispatchTriggerAASListScroll();
- this.aasStore.dispatchNode({});
},
// Function to check if the assetId can be found in the AAS Discovery Service (and if it exists in the AAS Registry)
- async checkAssetId(assetId: string): Promise<{ success: boolean; aas?: object; submodel?: object }> {
- const failResponse = { success: false, aas: {}, submodel: {} }; // Define once for reuse
- // check if aasDiscoveryURL includes "/lookup/shells" and add id if not (backward compatibility)
- if (!this.aasDiscoveryURLMixin.includes('/lookup/shells')) {
- this.aasDiscoveryURLMixin += '/lookup/shells';
+ async checkAssetId(globalAssetId: string): Promise<{ success: boolean; aasDescriptor?: object }> {
+ // console.log('checkAssetId', 'globalAssetId', globalAssetId);
+ const failResponse = { success: false, aasDescriptor: {} }; // Define once for reuse
+ // check if aasDiscoveryUrl includes "/lookup/shells" and add id if not (backward compatibility)
+ let aasDiscoveryUrl = this.aasDiscoveryUrl;
+ if (!aasDiscoveryUrl.includes('/lookup/shells')) {
+ aasDiscoveryUrl += '/lookup/shells';
}
// construct the assetId Object
- const assetIdObject = JSON.stringify({ name: 'globalAssetId', value: assetId });
- const path = `${this.aasDiscoveryURLMixin}?assetIds=${this.URLEncode(assetIdObject)}`; // Use template literal and encodeURIComponent
- const context = 'retrieving AASID by AssetID';
+ const assetIdObject = JSON.stringify({ name: 'globalAssetId', value: globalAssetId });
+ const aasDiscoveryPath = `${aasDiscoveryUrl}?assetIds=${this.URLEncode(assetIdObject)}`; // Use template literal and encodeURIComponent
+ const aasDiscoveryContext = 'retrieving AAS ID by AssetID';
const disableMessage = true;
try {
- const discoveryResponse = await this.getRequest(path, context, disableMessage);
- // console.log('Discovery Response:', discoveryResponse);
- if (discoveryResponse.success && discoveryResponse.data.result?.length > 0) {
- const aasIds = discoveryResponse.data.result;
- // take the first aasId from the list and check if it exists in the AAS Registry
+ const aasDiscoveryResponse = await this.getRequest(
+ aasDiscoveryPath,
+ aasDiscoveryContext,
+ disableMessage
+ );
+ // console.log('discoveryContext', discoveryPath, 'discoveryResponse', discoveryResponse);
+ if (aasDiscoveryResponse?.success && aasDiscoveryResponse?.data?.result?.length > 0) {
+ const aasIds = aasDiscoveryResponse.data.result;
+
+ // Take the first aasId from the list and check if it exists in the AAS Registry
const aasId = aasIds[0];
- // console.log('AAS ID:', aasId);
- // check if aasRegistryURL includes "/shell-descriptors" and add id if not (backward compatibility)
- if (!this.aasRegistryURLMixin.includes('/shell-descriptors')) {
- this.aasRegistryURLMixin += '/shell-descriptors';
+ let aasRegistryUrl = this.aasRegistryUrl;
+ if (!aasRegistryUrl.includes('/shell-descriptors')) {
+ aasRegistryUrl += '/shell-descriptors';
}
- const registryPath = `${this.aasRegistryURLMixin}/${this.URLEncode(aasId)}`;
- const registryContext = 'retrieving AAS Data';
- try {
- const aasRegistryResponse = await this.getRequest(
- registryPath,
- registryContext,
- disableMessage
- );
- if (aasRegistryResponse.success) {
- const aas = aasRegistryResponse.data;
- // console.log('AAS:', aas);
- return { success: true, aas: aas, submodel: {} };
- }
- return failResponse;
- } catch {
- return failResponse;
+ const aasRegistryPath = `${aasRegistryUrl}/${this.URLEncode(aasId).replace(/%3D/g, '')}`;
+ const aasRegistryContext = 'retrieving AAS Descriptor';
+
+ const aasRegistryResponse = await this.getRequest(
+ aasRegistryPath,
+ aasRegistryContext,
+ disableMessage
+ );
+ if (aasRegistryResponse?.success && Object.keys(aasRegistryResponse?.data).length > 0) {
+ // console.log('registryContext', registryPath, 'registryResponse', registryResponse);
+ const aasDescriptor = aasRegistryResponse.data;
+ return { success: true, aasDescriptor: aasDescriptor };
}
}
+
return failResponse;
} catch {
return failResponse;
@@ -630,9 +843,9 @@ export default defineComponent({
// Get all ConceptDescriptions for the SubmodelElement from the ConceptDescription Repository
async getConceptDescriptions(SelectedNode: any) {
- let conceptDescriptionRepoURL = '';
- if (this.conceptDescriptionRepoURL && this.conceptDescriptionRepoURL != '') {
- conceptDescriptionRepoURL = this.conceptDescriptionRepoURL;
+ let conceptDescriptionRepoUrl = '';
+ if (this.conceptDescriptionRepoUrl && this.conceptDescriptionRepoUrl != '') {
+ conceptDescriptionRepoUrl = this.conceptDescriptionRepoUrl;
} else {
return Promise.resolve([]); // Return an empty object wrapped in a resolved promise
}
@@ -676,7 +889,7 @@ export default defineComponent({
});
const cdPromises = semanticIdsToFetch.map((semanticId: string) => {
- const path = conceptDescriptionRepoURL + '/' + this.URLEncode(semanticId);
+ const path = conceptDescriptionRepoUrl + '/' + this.URLEncode(semanticId).replace(/%3D/g, '');
const context = 'retrieving ConceptDescriptions';
const disableMessage = true;
@@ -923,13 +1136,13 @@ export default defineComponent({
},
smNotFound(response: any, submodelId: string, path: string, text: string): any {
-
// Check if response contains a "messages" array with a "403" or "401" code
const messages = response.data?.messages || [];
- const authorizationError = messages.some((message: any) => message.code === "403" || message.code === "401");
+ const authorizationError = messages.some(
+ (message: any) => message.code === '403' || message.code === '401'
+ );
if (authorizationError) {
-
const submodel = {
id: submodelId,
idShort: 'Submodel Not Authorized!',
@@ -946,7 +1159,6 @@ export default defineComponent({
return submodel;
}
-
if (text.trim().length > 0) {
this.navigationStore.dispatchSnackbar({
status: true,
diff --git a/aas-web-ui/src/router.ts b/aas-web-ui/src/router.ts
index 19aeff4..bb65ed2 100644
--- a/aas-web-ui/src/router.ts
+++ b/aas-web-ui/src/router.ts
@@ -6,6 +6,7 @@ import ComponentVisualization from '@/components/ComponentVisualization.vue';
import Dashboard from '@/components/Dashboard/Dashboard.vue';
import DashboardGroup from '@/components/Dashboard/DashboardGroup.vue';
import MainWindow from '@/components/MainWindow.vue';
+import Page404 from '@/components/Page404.vue';
import SubmodelList from '@/components/SubmodelList.vue';
const routes = [
@@ -15,6 +16,7 @@ const routes = [
{ path: '/componentvisualization', name: 'ComponentVisualization', component: ComponentVisualization },
{ path: '/aasviewer', name: 'AASViewer', component: AASViewer },
{ path: '/about', name: 'About', component: About },
+ { path: '/404', name: 'NotFound404', component: Page404 },
{ path: '/dashboard', name: 'Dashboard', component: Dashboard },
{ path: '/dashboard-group', name: 'DashboardGroup', component: DashboardGroup },
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: MainWindow },
diff --git a/aas-web-ui/src/store/AASDataStore.ts b/aas-web-ui/src/store/AASDataStore.ts
index 8fa13e4..c341ded 100644
--- a/aas-web-ui/src/store/AASDataStore.ts
+++ b/aas-web-ui/src/store/AASDataStore.ts
@@ -21,7 +21,7 @@ export const useAASStore = defineStore({
actions: {
dispatchSelectedAAS(aasData: object) {
this.aasObject = aasData;
- this.selectedNode = {};
+ this.selectedNode = {}; // Clear node
},
dispatchLoadingState(loadingState: boolean) {
this.loadingState = loadingState;
diff --git a/aas-web-ui/src/store/EnvironmentStore.ts b/aas-web-ui/src/store/EnvironmentStore.ts
index 4f5200b..c2c9dde 100644
--- a/aas-web-ui/src/store/EnvironmentStore.ts
+++ b/aas-web-ui/src/store/EnvironmentStore.ts
@@ -20,6 +20,8 @@ export const useEnvStore = defineStore({
keycloakRealm: '',
keycloakClientId: '',
endpointConfigAvailable: true,
+ singleAas: false,
+ singleAasRedirect: '',
}),
getters: {
getEnvLogoLightPath: (state) => state.logoLightPath,
@@ -39,6 +41,8 @@ export const useEnvStore = defineStore({
getKeycloakRealm: (state) => state.keycloakRealm,
getKeycloakClientId: (state) => state.keycloakClientId,
getEndpointConfigAvailable: (state) => state.endpointConfigAvailable,
+ getSingleAas: (state) => state.singleAas,
+ getSingleAasRedirect: (state) => state.singleAasRedirect,
},
actions: {
async fetchConfig() {
@@ -63,6 +67,17 @@ export const useEnvStore = defineStore({
this.keycloakClientId = config.keycloakClientId;
this.endpointConfigAvailable =
config.endpointConfigAvailable === true || config.endpointConfigAvailable === 'true' ? true : false;
+ this.singleAas = config.singleAas === true || config.singleAas === 'true' ? true : false;
+ if (this.singleAas && config.singleAasRedirect) {
+ // https://gist.github.com/dperini/729294
+ const expression =
+ /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;
+ const regex = new RegExp(expression);
+ if (config.singleAasRedirect.match(regex)) {
+ // If valid URL
+ this.singleAasRedirect = config.singleAasRedirect;
+ }
+ }
} catch (error) {
console.error('Error fetching config.json: ', error);
}
diff --git a/aas-web-ui/src/store/NavigationStore.ts b/aas-web-ui/src/store/NavigationStore.ts
index a9ce91d..824057b 100644
--- a/aas-web-ui/src/store/NavigationStore.ts
+++ b/aas-web-ui/src/store/NavigationStore.ts
@@ -56,7 +56,6 @@ export const useNavigationStore = defineStore({
plugins: [] as PluginType[],
triggerAASListReload: false as boolean,
triggerAASListScroll: false as boolean,
- triggerAASSelected: false as boolean,
}),
getters: {
@@ -75,7 +74,6 @@ export const useNavigationStore = defineStore({
getPlugins: (state) => state.plugins,
getTriggerAASListReload: (state) => state.triggerAASListReload,
getTriggerAASListScroll: (state) => state.triggerAASListScroll,
- getTriggerAASSelected: (state) => state.triggerAASSelected,
},
actions: {
@@ -130,8 +128,5 @@ export const useNavigationStore = defineStore({
dispatchTriggerAASListScroll() {
this.triggerAASListScroll = !this.triggerAASListScroll;
},
- dispatchTriggerAASSelected() {
- this.triggerAASSelected = !this.triggerAASSelected;
- },
},
});