@eclipse-slm/ui 0.0.0-stage → 1.5.0-snapshot.1017
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -2
- package/index.html +19 -0
- package/package.json +105 -4
- package/public/favicon.ico +0 -0
- package/public/favicon.png +0 -0
- package/public/favicon_white.png +0 -0
- package/public/sidebar-image.jpg +0 -0
- package/src/App.vue +40 -0
- package/src/api/ansible-service/ansible-service-client.ts +15 -0
- package/src/api/ansible-service/ansible-service-sse.ts +124 -0
- package/src/api/apiState.js +7 -0
- package/src/api/catalog/catalogRestApi.js +17 -0
- package/src/api/notification-service/notification-service-client.ts +7 -0
- package/src/api/notification-service/notificationServiceActuatorRestApi.js +26 -0
- package/src/api/notification-service/notificationServiceWebsocketClient.js +60 -0
- package/src/api/platform-management/platform-management-client.ts +46 -0
- package/src/api/platform-management/platformManagementActuatorRestApi.js +26 -0
- package/src/api/resource-management/resource-management-client.ts +37 -0
- package/src/api/resource-management/resourceManagementActuatorRestApi.js +26 -0
- package/src/api/restApiHelper.js +11 -0
- package/src/api/service-management/service-management-client.ts +31 -0
- package/src/api/service-management/serviceManagementActuatorRestApi.ts +26 -0
- package/src/app/appInstance.ts +8 -0
- package/src/app/navigation.ts +224 -0
- package/src/app/routes.ts +215 -0
- package/src/assets/clint-mckoy.jpg +0 -0
- package/src/assets/img/avatarImg.jpg +0 -0
- package/src/assets/img/fabos_logo.png +0 -0
- package/src/assets/img/fabos_logo_fabweiss.png +0 -0
- package/src/assets/img/fraunhofer-logo.png +0 -0
- package/src/assets/img/sidebar-1.jpg +0 -0
- package/src/assets/img/sidebar-2.jpg +0 -0
- package/src/assets/img/sidebar-3.jpg +0 -0
- package/src/assets/img/sidebar-4.jpg +0 -0
- package/src/assets/img/sidebar-5.jpg +0 -0
- package/src/assets/img/sidebar-image.jpg +0 -0
- package/src/assets/img/vue-logo.png +0 -0
- package/src/assets/lock.jpg +0 -0
- package/src/assets/login.jpg +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/pricing.jpg +0 -0
- package/src/assets/register.jpg +0 -0
- package/src/assets/vuetify.svg +1 -0
- package/src/components/admin/VersionsOverview.vue +149 -0
- package/src/components/admin/ansible/AnsibleAdminImages.vue +113 -0
- package/src/components/admin/ansible/AnsibleAdminJobs.vue +179 -0
- package/src/components/admin/ansible/AnsibleAdminOperations.vue +124 -0
- package/src/components/base/ActionButton.vue +63 -0
- package/src/components/base/ActionButtonType.ts +5 -0
- package/src/components/base/Card.vue +17 -0
- package/src/components/base/ConfirmDialog.vue +101 -0
- package/src/components/base/CustomDialog.vue +116 -0
- package/src/components/base/IconPickerDialog.vue +155 -0
- package/src/components/base/Item.vue +79 -0
- package/src/components/base/ItemGroup.vue +131 -0
- package/src/components/base/ItemSubGroup.vue +25 -0
- package/src/components/base/MaterialAlert.vue +56 -0
- package/src/components/base/MaterialCard.vue +166 -0
- package/src/components/base/MaterialChartCard.vue +95 -0
- package/src/components/base/MaterialSnackbar.vue +71 -0
- package/src/components/base/MaterialStatsCard.vue +115 -0
- package/src/components/base/MaterialTabs.vue +43 -0
- package/src/components/base/MaterialTestimony.vue +79 -0
- package/src/components/base/NoItemAvailableNote.vue +22 -0
- package/src/components/base/OverviewHeading.vue +25 -0
- package/src/components/base/ProgressCircular.vue +68 -0
- package/src/components/base/RowWithLabel.vue +228 -0
- package/src/components/base/Subheading.vue +35 -0
- package/src/components/base/TextWithLabel.vue +41 -0
- package/src/components/base/VComponent.vue +40 -0
- package/src/components/capabilities/CapabilitiesTable.vue +209 -0
- package/src/components/capabilities/CapabilityActionCard.vue +77 -0
- package/src/components/capabilities/CapabilityCreateDialog.vue +86 -0
- package/src/components/capabilities/CapabilityCreateForm.vue +306 -0
- package/src/components/capabilities/CapabilityImportDialog.vue +108 -0
- package/src/components/capabilities/capabilityForm.ts +244 -0
- package/src/components/charts/AasCircularChart.vue +170 -0
- package/src/components/charts/AasCircularChartFilterBar.vue +72 -0
- package/src/components/charts/LineChart.js +14 -0
- package/src/components/clusters/ClustersOverview.vue +76 -0
- package/src/components/clusters/dialogs/ClusterDeleteDialog.vue +125 -0
- package/src/components/clusters/dialogs/ClusterScaleDialog.vue +272 -0
- package/src/components/clusters/dialogs/ClustersCreateDialog.vue +112 -0
- package/src/components/clusters/dialogs/ClustersCreateDialogPage.ts +7 -0
- package/src/components/clusters/dialogs/ClustersCreateDialogPageAddExistingCluster.vue +261 -0
- package/src/components/clusters/dialogs/ClustersCreateDialogPageCreateNewCluster.vue +244 -0
- package/src/components/clusters/dialogs/ClustersCreateDialogPageStart.vue +75 -0
- package/src/components/core/AppBar.vue +301 -0
- package/src/components/core/Drawer.vue +217 -0
- package/src/components/core/Footer.vue +43 -0
- package/src/components/core/View.vue +32 -0
- package/src/components/credentials/CredentialCreateDialog.vue +121 -0
- package/src/components/credentials/CredentialDisplay.vue +105 -0
- package/src/components/credentials/CredentialForm.vue +394 -0
- package/src/components/credentials/CredentialTypes.ts +26 -0
- package/src/components/dashboard/Buttons.vue +431 -0
- package/src/components/dashboard/DashboardResourceStatistics.vue +53 -0
- package/src/components/dashboard/Grid.vue +300 -0
- package/src/components/dashboard/Icons.vue +300 -0
- package/src/components/dashboard/Notifications.vue +402 -0
- package/src/components/dashboard/Tabs.vue +418 -0
- package/src/components/dashboard/Typography.vue +120 -0
- package/src/components/discovery/DiscoverDialog.vue +186 -0
- package/src/components/discovery/DiscoveredResourcesTable.vue +176 -0
- package/src/components/discovery/DiscoveryJobDetailsDialog.vue +65 -0
- package/src/components/discovery/DiscoveryJobsDeleteDialog.vue +88 -0
- package/src/components/discovery/DiscoveryJobsTable.vue +131 -0
- package/src/components/discovery/DiscoveryOverview.vue +99 -0
- package/src/components/discovery/DriversTable.vue +70 -0
- package/src/components/discovery/OnboardingDialog.vue +82 -0
- package/src/components/jobs/JobDetail.vue +413 -0
- package/src/components/jobs/JobStatusChip.vue +16 -0
- package/src/components/jobs/JobsOverview.vue +160 -0
- package/src/components/notifications/NotificationsOverview.vue +154 -0
- package/src/components/profilers/ProfilerDialog.vue +95 -0
- package/src/components/profilers/ProfilerForm.vue +102 -0
- package/src/components/profilers/ProfilersTable.vue +98 -0
- package/src/components/profilers/profilerForm.ts +61 -0
- package/src/components/provider/ProviderOverview.vue +64 -0
- package/src/components/provider/ServiceHosterTable.vue +47 -0
- package/src/components/provider/VirtualResourceProviderTable.vue +73 -0
- package/src/components/provider/dialogs/VmCreateDialog.vue +99 -0
- package/src/components/provider/dialogs/VmCreateDialogForm.vue +59 -0
- package/src/components/resources/ResourceConnectionIcon.vue +40 -0
- package/src/components/resources/ResourcesDeleteDialog.vue +102 -0
- package/src/components/resources/ResourcesTableClusters.vue +192 -0
- package/src/components/resources/ResourcesTableDevices.vue +338 -0
- package/src/components/resources/ResourcesTableTypes.vue +106 -0
- package/src/components/resources/capabilities/CapabilitiesButton.vue +164 -0
- package/src/components/resources/capabilities/CapabilityIcon.vue +44 -0
- package/src/components/resources/capabilities/CapabilityParamsDialog.vue +119 -0
- package/src/components/resources/capabilities/CapabilityParamsDialogInputField.vue +51 -0
- package/src/components/resources/deviceinfo/DeviceInfoCapabilitiesView.vue +239 -0
- package/src/components/resources/deviceinfo/DeviceInfoCredentialsView.vue +205 -0
- package/src/components/resources/deviceinfo/DeviceInfoHardwareView.vue +162 -0
- package/src/components/resources/deviceinfo/DeviceInfoNameplateView.vue +201 -0
- package/src/components/resources/deviceinfo/DeviceInfoSubmodelsView.vue +173 -0
- package/src/components/resources/deviceinfo/DeviceInfoView.vue +207 -0
- package/src/components/resources/deviceinfo/common/DeviceInfoCommonBasicsSection.vue +101 -0
- package/src/components/resources/deviceinfo/common/DeviceInfoCommonRemoteAccessSection.vue +224 -0
- package/src/components/resources/deviceinfo/common/DeviceInfoCommonView.vue +43 -0
- package/src/components/resources/deviceinfo/firmware/DeviceInfoFirmwareView.vue +113 -0
- package/src/components/resources/deviceinfo/firmware/FirmwareAvailableVersionsSection.vue +193 -0
- package/src/components/resources/deviceinfo/firmware/FirmwareCredentialsSection.vue +250 -0
- package/src/components/resources/deviceinfo/firmware/FirmwareUpdateJobsSection.vue +149 -0
- package/src/components/resources/deviceinfo/firmware/FirmwareUpdateStatusSection.vue +117 -0
- package/src/components/resources/deviceinfo/firmware/sectionState.ts +12 -0
- package/src/components/resources/devicetypeinfo/DeviceTypeInfoCommonView.vue +58 -0
- package/src/components/resources/devicetypeinfo/DeviceTypeInfoFirmwareView.vue +270 -0
- package/src/components/resources/devicetypeinfo/DeviceTypeInfoView.vue +110 -0
- package/src/components/resources/dialogs/AddItemChooserDialog.vue +68 -0
- package/src/components/resources/dialogs/DeviceCreateDeviceDetailsForm.vue +109 -0
- package/src/components/resources/dialogs/DeviceCreateDialog.vue +224 -0
- package/src/components/resources/dialogs/DeviceDialogCreateTypes.ts +11 -0
- package/src/components/resources/remoteaccess/RemoteAccessDialog.vue +82 -0
- package/src/components/resources/remoteaccess/RemoteAccessForm.vue +149 -0
- package/src/components/resources/remoteaccess/RemoteAccessHandler.ts +73 -0
- package/src/components/resources/remoteaccess/RemoteAccessTypes.ts +11 -0
- package/src/components/service_offerings/ServiceCategoriesTable.vue +154 -0
- package/src/components/service_offerings/ServiceCategoryCreateOrEditDialog.vue +117 -0
- package/src/components/service_offerings/ServiceOfferingCardGrid.vue +173 -0
- package/src/components/service_offerings/ServiceOfferingCardList.vue +117 -0
- package/src/components/service_offerings/ServiceOfferingDetailsOverview.vue +89 -0
- package/src/components/service_offerings/ServiceOfferingDetailsRequirements.vue +89 -0
- package/src/components/service_offerings/ServiceOfferingTable.vue +291 -0
- package/src/components/service_offerings/ServiceOfferingToolbar.vue +133 -0
- package/src/components/service_offerings/ServiceOptionValue.vue +213 -0
- package/src/components/service_offerings/dialogs/ServiceOfferingCreateDialog.vue +70 -0
- package/src/components/service_offerings/wizard_service_offering/ServiceOfferingWizardGitStep1Common.vue +214 -0
- package/src/components/service_offerings/wizard_service_offering/ServiceOfferingWizardManualStep1Common.vue +196 -0
- package/src/components/service_offerings/wizard_service_offering_version/Docker/DockerContainerImageName.vue +112 -0
- package/src/components/service_offerings/wizard_service_offering_version/Docker/DockerContainerLabels.vue +158 -0
- package/src/components/service_offerings/wizard_service_offering_version/Docker/DockerContainerPortMappings.vue +177 -0
- package/src/components/service_offerings/wizard_service_offering_version/Docker/DockerContainerRestartPolicy.vue +63 -0
- package/src/components/service_offerings/wizard_service_offering_version/Docker/DockerContainerVolumes.vue +157 -0
- package/src/components/service_offerings/wizard_service_offering_version/Docker/DockerEnvironmentVariables.vue +163 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep1Common.vue +154 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep2DeploymentDefinitionCodesys.vue +139 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep2DeploymentDefinitionDockerCompose.vue +423 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep2DeploymentDefinitionDockerContainer.vue +293 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep2DeploymentDefinitionKubernetes.vue +382 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep3ServiceOptions.vue +193 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceOfferingVersionWizardStep4Requirements.vue +238 -0
- package/src/components/service_offerings/wizard_service_offering_version/ServiceRepositorySelect.vue +90 -0
- package/src/components/service_offerings/wizard_service_offering_version/serviceOptions/serviceOptionsDefinitionTable.vue +210 -0
- package/src/components/service_vendors/ServiceRepositoryCreateDialog.vue +165 -0
- package/src/components/service_vendors/ServiceVendorCreateOrEditDialog.vue +171 -0
- package/src/components/service_vendors/ServiceVendorDevelopersTable.vue +201 -0
- package/src/components/service_vendors/ServiceVendorTable.vue +158 -0
- package/src/components/services/ServiceInstanceDeleteDialog.vue +29 -0
- package/src/components/services/ServiceInstancesOverview.vue +63 -0
- package/src/components/services/ServiceInstancesTable.vue +379 -0
- package/src/components/services/dialog/ServiceInstanceDetailsDialog.vue +369 -0
- package/src/components/services/serviceInstanceMixin.js +29 -0
- package/src/components/tables/RegularTables.vue +186 -0
- package/src/components/updates/FirmwareUpdateStatusIcon.vue +54 -0
- package/src/components/updates/FirmwareUpdateVersion.vue +65 -0
- package/src/components/user/UserCredentials.vue +278 -0
- package/src/components/user/UserProfileDetails.vue +89 -0
- package/src/customization/customizeApp.ts +6 -0
- package/src/customization/customizeMessages.ts +6 -0
- package/src/customization/customizeNavigation.ts +6 -0
- package/src/customization/customizeRoutes.ts +6 -0
- package/src/customization/deepMerge.ts +28 -0
- package/src/customization/theme.ts +15 -0
- package/src/design/overrides.sass +62 -0
- package/src/design/serviceOfferingCard.scss +38 -0
- package/src/design/variables.scss +34 -0
- package/src/design/vuetify-material/_appbar.sass +54 -0
- package/src/design/vuetify-material/_buttons.sass +67 -0
- package/src/design/vuetify-material/_card.sass +107 -0
- package/src/design/vuetify-material/_chip.sass +9 -0
- package/src/design/vuetify-material/_footer.sass +29 -0
- package/src/design/vuetify-material/_map.sass +3 -0
- package/src/design/vuetify-material/_modal.sass +25 -0
- package/src/design/vuetify-material/_notification.sass +12 -0
- package/src/design/vuetify-material/_pagination.sass +5 -0
- package/src/design/vuetify-material/_settings.sass +36 -0
- package/src/design/vuetify-material/_sidebar.sass +69 -0
- package/src/design/vuetify-material/_tab.sass +12 -0
- package/src/design/vuetify-material/_table.sass +22 -0
- package/src/design/vuetify-material/_view.sass +23 -0
- package/src/docker/entrypoint.sh +85 -0
- package/src/docker/nginx.conf +35 -0
- package/src/docker/slm.conf +15 -0
- package/src/localisation/de.json +91 -0
- package/src/localisation/en.json +387 -0
- package/src/main.ts +167 -0
- package/src/pages/AccessDeniedPage.vue +10 -0
- package/src/pages/AdminAnsibleServicePage.vue +111 -0
- package/src/pages/AdminCapabilitiesPage.vue +60 -0
- package/src/pages/AdminComponentsPage.vue +34 -0
- package/src/pages/AdminPage.vue +68 -0
- package/src/pages/AdminProfilersPage.vue +73 -0
- package/src/pages/AdminServiceCategoriesPage.vue +34 -0
- package/src/pages/AdminServiceVendorsPage.vue +53 -0
- package/src/pages/AdminUsersPage.vue +367 -0
- package/src/pages/ClustersPage.vue +64 -0
- package/src/pages/DashboardPage.vue +351 -0
- package/src/pages/DiscoveryDriversPage.vue +35 -0
- package/src/pages/DiscoveryInboxPage.vue +31 -0
- package/src/pages/DiscoveryJobsPage.vue +34 -0
- package/src/pages/IndexPage.vue +29 -0
- package/src/pages/JobDetailPage.vue +7 -0
- package/src/pages/JobsPage.vue +18 -0
- package/src/pages/NotificationsPage.vue +13 -0
- package/src/pages/ProviderPage.vue +18 -0
- package/src/pages/ResourceInstancesPage.vue +177 -0
- package/src/pages/ResourceTypesPage.vue +102 -0
- package/src/pages/ServiceInstancesPage.vue +33 -0
- package/src/pages/ServiceOfferingCreateOrEditPage.vue +197 -0
- package/src/pages/ServiceOfferingDetailsPage.vue +180 -0
- package/src/pages/ServiceOfferingOrderPage.vue +300 -0
- package/src/pages/ServiceOfferingVersionCreateOrEditPage.vue +431 -0
- package/src/pages/ServiceOfferingsPage.vue +149 -0
- package/src/pages/ServiceVendorPage.vue +431 -0
- package/src/pages/UserProfilePage.vue +64 -0
- package/src/pages/router.js +34 -0
- package/src/shims-vue.d.ts +5 -0
- package/src/stores/ansibleAdminStore.ts +206 -0
- package/src/stores/capabilitiesStore.ts +159 -0
- package/src/stores/catalogStore.ts +50 -0
- package/src/stores/discoveryStore.ts +88 -0
- package/src/stores/environmentStore.ts +61 -0
- package/src/stores/jobsStore.ts +73 -0
- package/src/stores/notificationStore.ts +169 -0
- package/src/stores/profilersStore.ts +80 -0
- package/src/stores/providerStore.ts +52 -0
- package/src/stores/resourceClustersStore.ts +98 -0
- package/src/stores/resourceDevicesStore.ts +294 -0
- package/src/stores/serviceInstancesStore.ts +92 -0
- package/src/stores/serviceOfferingsStore.ts +208 -0
- package/src/stores/store.ts +66 -0
- package/src/stores/userStore.ts +126 -0
- package/src/utils/capabilityUtils.js +114 -0
- package/src/utils/dateUtils.js +21 -0
- package/src/utils/deviceUtils.js +74 -0
- package/src/utils/firmwareUtils.ts +35 -0
- package/src/utils/i18n.ts +28 -0
- package/src/utils/imageUtil.js +37 -0
- package/src/utils/jobStatus.ts +76 -0
- package/src/utils/mdiIcons.ts +49 -0
- package/src/utils/notificationTextGenerator.ts +108 -0
- package/src/utils/serviceOptionUtil.js +106 -0
- package/src/utils/tokenInterceptor.js +59 -0
- package/src/utils/updateToken.js +18 -0
- package/src/utils/yup.custom.js +11 -0
- package/vite/dist/apiClients.d.ts +5 -0
- package/vite/dist/apiClients.js +59 -0
- package/vite/dist/drift.d.ts +9 -0
- package/vite/dist/drift.js +57 -0
- package/vite/dist/index.d.ts +4 -0
- package/vite/dist/index.js +94 -0
- package/vite/dist/overrides.d.ts +3 -0
- package/vite/dist/overrides.js +71 -0
- package/vite/dist/paths.d.ts +18 -0
- package/vite/dist/paths.js +22 -0
- package/vite/package.json +1 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import {defineStore} from "pinia";
|
|
2
|
+
import {useJobsStore} from "@/stores/jobsStore";
|
|
3
|
+
import {useResourceDevicesStore} from "@/stores/resourceDevicesStore";
|
|
4
|
+
import {useResourceClustersStore} from "@/stores/resourceClustersStore";
|
|
5
|
+
import {useServiceInstancesStore} from "@/stores/serviceInstancesStore";
|
|
6
|
+
import NotificationServiceClient from "@/api/notification-service/notification-service-client";
|
|
7
|
+
import logRequestError from "@/api/restApiHelper";
|
|
8
|
+
import {useDiscoveryStore} from "@/stores/discoveryStore";
|
|
9
|
+
import ApiState from "@/api/apiState";
|
|
10
|
+
import {useToast} from "vue-toast-notification";
|
|
11
|
+
import {
|
|
12
|
+
CapabilityJobEventNotification,
|
|
13
|
+
EventNotification,
|
|
14
|
+
EventType, FirmwareUpdateJobEventNotification,
|
|
15
|
+
Notification,
|
|
16
|
+
NotificationCategory,
|
|
17
|
+
NotificationSubCategory, EVENTCLASS, ResourceEventNotification, ResourceEventType,
|
|
18
|
+
AasEventNotification, AasEventType, AasElementKind
|
|
19
|
+
} from "@/api/notification-service/client";
|
|
20
|
+
import NotificationTextGenerator from "@/utils/notificationTextGenerator";
|
|
21
|
+
import i18n from '@/utils/i18n';
|
|
22
|
+
import {Resource} from "@/api/resource-management/client";
|
|
23
|
+
import {useCapabilitiesStore} from "@/stores/capabilitiesStore";
|
|
24
|
+
|
|
25
|
+
export interface NotificationStoreState {
|
|
26
|
+
apiState: number,
|
|
27
|
+
notifications: any[],
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const useNotificationStore = defineStore('notificationStore', {
|
|
31
|
+
persist: true,
|
|
32
|
+
|
|
33
|
+
state: (): NotificationStoreState => ({
|
|
34
|
+
apiState: ApiState.INIT,
|
|
35
|
+
notifications: [],
|
|
36
|
+
}),
|
|
37
|
+
|
|
38
|
+
getters: {
|
|
39
|
+
notifications_unread: (state) => {
|
|
40
|
+
return state.notifications.filter((note) => note.read === false)
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
actions: {
|
|
45
|
+
getNotifications () {
|
|
46
|
+
NotificationServiceClient.api.getNotifications().then(response => {
|
|
47
|
+
this.notifications = response.data;
|
|
48
|
+
}).catch(logRequestError);
|
|
49
|
+
},
|
|
50
|
+
addNotification (notification: Notification) {
|
|
51
|
+
this.notifications.push(notification)
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
processIncomingNotification (eventNotification: EventNotification) {
|
|
55
|
+
console.log(eventNotification)
|
|
56
|
+
|
|
57
|
+
const $toast = useToast();
|
|
58
|
+
// this.addNotification(notification)
|
|
59
|
+
|
|
60
|
+
switch (eventNotification.type) {
|
|
61
|
+
case EVENTCLASS.ResourceEvent: {
|
|
62
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
63
|
+
const resourceEventNotification = eventNotification as unknown as ResourceEventNotification;
|
|
64
|
+
console.log(resourceEventNotification)
|
|
65
|
+
switch (resourceEventNotification.eventType) {
|
|
66
|
+
case ResourceEventType.Created: {
|
|
67
|
+
resourceDevicesStore.addOrUpdateResource(resourceEventNotification.resource);
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
case ResourceEventType.Updated: {
|
|
71
|
+
resourceDevicesStore.addOrUpdateResource(resourceEventNotification.resource);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
case ResourceEventType.Deleted: {
|
|
75
|
+
resourceDevicesStore.deleteResource(resourceEventNotification.resource.id)
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
default: {
|
|
79
|
+
resourceDevicesStore.updateStore();
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
case EVENTCLASS.CapabilityJobEvent: {
|
|
88
|
+
const capabilityJobEventNotification = eventNotification as unknown as CapabilityJobEventNotification;
|
|
89
|
+
|
|
90
|
+
const capabilitiesStore = useCapabilitiesStore();
|
|
91
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
92
|
+
capabilitiesStore.updateStore().then(() => {
|
|
93
|
+
resourceDevicesStore.getResourceById(capabilityJobEventNotification.capabilityJob.resourceId).then(() => {
|
|
94
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
case EVENTCLASS.DiscoveryEvent: {
|
|
101
|
+
const discoveryStore = useDiscoveryStore();
|
|
102
|
+
discoveryStore.updateDiscoveryStore();
|
|
103
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
case EVENTCLASS.FirmwareUpdateJobEvent: {
|
|
108
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
109
|
+
const firmwareUpdateJobEventNotification = eventNotification as unknown as FirmwareUpdateJobEventNotification;
|
|
110
|
+
resourceDevicesStore.getFirmwareUpdateInformationOfResource(firmwareUpdateJobEventNotification.firmwareUpdateJob.resourceId);
|
|
111
|
+
resourceDevicesStore.getFirmwareUpdateJobsOfResource(firmwareUpdateJobEventNotification.firmwareUpdateJob.resourceId)
|
|
112
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
case EVENTCLASS.ServiceInstanceEvent: {
|
|
117
|
+
const serviceInstancesStore = useServiceInstancesStore();
|
|
118
|
+
serviceInstancesStore.updateStore();
|
|
119
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
case EVENTCLASS.AasEvent: {
|
|
124
|
+
const aasEventNotification = eventNotification as unknown as AasEventNotification;
|
|
125
|
+
// A deleted resource shell usually means the resource is gone, refreshing it would fail
|
|
126
|
+
const shellDeleted = aasEventNotification.elementKind === AasElementKind.Shell
|
|
127
|
+
&& aasEventNotification.eventType === AasEventType.Deleted;
|
|
128
|
+
if (!shellDeleted) {
|
|
129
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
130
|
+
resourceDevicesStore.getResourceById(aasEventNotification.resourceId);
|
|
131
|
+
}
|
|
132
|
+
// $toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
default: {
|
|
137
|
+
console.debug("Unknown event notification type: ", eventNotification.type);
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
|
|
143
|
+
markAllAsRead () {
|
|
144
|
+
const unreadNotificationIds = this.notifications_unread.map((note) => note.id);
|
|
145
|
+
NotificationServiceClient.api.setReadOfNotifications(true, unreadNotificationIds)
|
|
146
|
+
.then(response => {
|
|
147
|
+
this.updateStore();
|
|
148
|
+
}).catch(logRequestError)
|
|
149
|
+
},
|
|
150
|
+
|
|
151
|
+
async updateStore () {
|
|
152
|
+
if (this.apiState === ApiState.INIT) {
|
|
153
|
+
this.apiState = ApiState.LOADING;
|
|
154
|
+
} else {
|
|
155
|
+
this.apiState = ApiState.UPDATING;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return Promise.all([
|
|
159
|
+
this.getNotifications(),
|
|
160
|
+
]).then(() => {
|
|
161
|
+
this.apiState = ApiState.LOADED;
|
|
162
|
+
console.log("notificationStore updated")
|
|
163
|
+
}).catch((e) => {
|
|
164
|
+
this.apiState = ApiState.ERROR;
|
|
165
|
+
console.log("Failed to update notificationStore: ", e)
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
});
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import ApiState from '@/api/apiState'
|
|
2
|
+
import {defineStore} from "pinia";
|
|
3
|
+
import ResourceManagementClient from "@/api/resource-management/resource-management-client";
|
|
4
|
+
import {Profiler, ProfilerDTOApi} from "@/api/resource-management/client";
|
|
5
|
+
|
|
6
|
+
interface ProfilersStoreState {
|
|
7
|
+
apiState: number,
|
|
8
|
+
|
|
9
|
+
profilers: Profiler[],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const useProfilersStore = defineStore('profilersStore', {
|
|
13
|
+
persist: true,
|
|
14
|
+
state: (): ProfilersStoreState => ({
|
|
15
|
+
apiState: ApiState.INIT,
|
|
16
|
+
|
|
17
|
+
profilers: [],
|
|
18
|
+
}),
|
|
19
|
+
|
|
20
|
+
actions: {
|
|
21
|
+
async getProfilers() {
|
|
22
|
+
return await ResourceManagementClient.profilerApi.getProfiler()
|
|
23
|
+
.then(response => {
|
|
24
|
+
if (response) {
|
|
25
|
+
const receivedProfilers = response.data;
|
|
26
|
+
if (receivedProfilers === undefined) {
|
|
27
|
+
this.profilers = []
|
|
28
|
+
} else {
|
|
29
|
+
// Sort alphabetically
|
|
30
|
+
this.profilers = receivedProfilers.sort((a, b) => {
|
|
31
|
+
return a.name.localeCompare(b.name)
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
async createProfiler(body: ProfilerDTOApi) {
|
|
39
|
+
await ResourceManagementClient.profilerApi.createProfiler(body)
|
|
40
|
+
await this.reloadAfterChange()
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
async updateProfiler(profilerId: string, body: ProfilerDTOApi) {
|
|
44
|
+
await ResourceManagementClient.profilerApi.updateProfiler(profilerId, body)
|
|
45
|
+
await this.reloadAfterChange()
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
async deleteProfiler(profilerId: string) {
|
|
49
|
+
await ResourceManagementClient.profilerApi.deleteProfiler(profilerId)
|
|
50
|
+
await this.reloadAfterChange()
|
|
51
|
+
// A successful delete is authoritative even if the list reload failed or returned stale data.
|
|
52
|
+
this.profilers = this.profilers.filter(profiler => profiler.id !== profilerId)
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// The change already succeeded; a failed reload must not make it look failed (a retry would duplicate it)
|
|
56
|
+
async reloadAfterChange() {
|
|
57
|
+
try {
|
|
58
|
+
await this.getProfilers()
|
|
59
|
+
} catch (e) {
|
|
60
|
+
console.error('Failed to reload profilers after a successful change', e)
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
|
|
64
|
+
async updateStore() {
|
|
65
|
+
if (this.apiState === ApiState.INIT) {
|
|
66
|
+
this.apiState = ApiState.LOADING;
|
|
67
|
+
} else {
|
|
68
|
+
this.apiState = ApiState.UPDATING;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return this.getProfilers().then(() => {
|
|
72
|
+
this.apiState = ApiState.LOADED;
|
|
73
|
+
console.log("profilersStore updated")
|
|
74
|
+
}).catch((e) => {
|
|
75
|
+
this.apiState = ApiState.ERROR;
|
|
76
|
+
console.log("Failed to update profilersStore: ", e)
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {defineStore} from "pinia";
|
|
2
|
+
import ResourceManagementClient from "@/api/resource-management/resource-management-client";
|
|
3
|
+
import logRequestError from "@/api/restApiHelper";
|
|
4
|
+
import ApiState from "@/api/apiState";
|
|
5
|
+
|
|
6
|
+
interface ProviderStoreState{
|
|
7
|
+
apiState: number,
|
|
8
|
+
virtualResourceProviders: any[],
|
|
9
|
+
serviceHosters: any[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const useProviderStore = defineStore('providerStore', {
|
|
13
|
+
persist: true,
|
|
14
|
+
|
|
15
|
+
state:():ProviderStoreState => ({
|
|
16
|
+
apiState: ApiState.INIT,
|
|
17
|
+
virtualResourceProviders: [],
|
|
18
|
+
serviceHosters: []
|
|
19
|
+
}),
|
|
20
|
+
|
|
21
|
+
getters: {
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
actions: {
|
|
25
|
+
async getServiceHosters () {
|
|
26
|
+
return await ResourceManagementClient.capabilityProvidersApi.getServiceHosters({})
|
|
27
|
+
.then(response => {
|
|
28
|
+
if(response.data){
|
|
29
|
+
this.serviceHosters = response.data;
|
|
30
|
+
}
|
|
31
|
+
}).catch(logRequestError)
|
|
32
|
+
},
|
|
33
|
+
async updateStore () {
|
|
34
|
+
if (this.apiState === ApiState.INIT) {
|
|
35
|
+
this.apiState = ApiState.LOADING;
|
|
36
|
+
} else {
|
|
37
|
+
this.apiState = ApiState.UPDATING;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return Promise.all([
|
|
41
|
+
this.getServiceHosters()
|
|
42
|
+
]).then(() => {
|
|
43
|
+
this.apiState = ApiState.LOADED;
|
|
44
|
+
console.log("providerStore updated")
|
|
45
|
+
}).catch((e) => {
|
|
46
|
+
this.apiState = ApiState.ERROR;
|
|
47
|
+
console.log("Failed to update providerStore: ", e)
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import ApiState from '@/api/apiState'
|
|
2
|
+
import {defineStore} from "pinia";
|
|
3
|
+
import {useProviderStore} from "@/stores/providerStore";
|
|
4
|
+
import ResourceManagementClient from "@/api/resource-management/resource-management-client";
|
|
5
|
+
import logRequestError from "@/api/restApiHelper";
|
|
6
|
+
|
|
7
|
+
interface ResourcesClustersStoreState{
|
|
8
|
+
apiState: number,
|
|
9
|
+
|
|
10
|
+
clusters: any[],
|
|
11
|
+
selectedClusterForDelete: any,
|
|
12
|
+
selectedClusterForScale: any,
|
|
13
|
+
availableClusterTypes: any[],
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const useResourceClustersStore = defineStore('resourcesClustersStore', {
|
|
17
|
+
persist: true,
|
|
18
|
+
|
|
19
|
+
state:():ResourcesClustersStoreState => ({
|
|
20
|
+
apiState: ApiState.INIT,
|
|
21
|
+
|
|
22
|
+
clusters: [],
|
|
23
|
+
|
|
24
|
+
selectedClusterForDelete: null,
|
|
25
|
+
selectedClusterForScale: null,
|
|
26
|
+
availableClusterTypes: [],
|
|
27
|
+
}),
|
|
28
|
+
|
|
29
|
+
getters: {
|
|
30
|
+
clusterById: (state) => (id) => {
|
|
31
|
+
return state.clusters.find(cluster => cluster.id === id)
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
actions: {
|
|
36
|
+
async getCluster () {
|
|
37
|
+
try{
|
|
38
|
+
const response = await ResourceManagementClient.clusterApi.getClusterResources();
|
|
39
|
+
const receivedClusters: any[] = []
|
|
40
|
+
if (response.data && response.data.length > 0) {
|
|
41
|
+
for (const i in response.data) {
|
|
42
|
+
receivedClusters.push({
|
|
43
|
+
id: response[i].id,
|
|
44
|
+
name: response[i].metaData['cluster_name'] ? response[i].metaData['cluster_name'] : response[i].name,
|
|
45
|
+
project: 'fabos',
|
|
46
|
+
clusterType: response[i].clusterType,
|
|
47
|
+
clusterMemberTypes: response[i].clusterMemberTypes,
|
|
48
|
+
nodeCount: response[i].nodes.length > 0? response[i].nodes.length: 'externally managed',
|
|
49
|
+
nodes: response[i].nodes,
|
|
50
|
+
memberMapping: response[i].memberMapping,
|
|
51
|
+
isManaged: response[i].managed,
|
|
52
|
+
metaData: response[i].metaData,
|
|
53
|
+
namespace: response[i].metaData['namespace'] ? response[i].metaData['namespace'] : '-',
|
|
54
|
+
username: response[i].metaData['cluster_user'] ? response[i].metaData['cluster_user'] : '-',
|
|
55
|
+
status: response[i].capabilityService.status
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
this.clusters = receivedClusters
|
|
60
|
+
}
|
|
61
|
+
} catch (e) {
|
|
62
|
+
logRequestError(e)
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
async getClusterTypes () {
|
|
69
|
+
return await ResourceManagementClient.clusterApi.getClusterTypes()
|
|
70
|
+
.then(response => {
|
|
71
|
+
if(response.data && response.data.length > 0) {
|
|
72
|
+
const receivedClusterTypes = response.data;
|
|
73
|
+
if (receivedClusterTypes === undefined) {
|
|
74
|
+
this.availableClusterTypes = []
|
|
75
|
+
} else {
|
|
76
|
+
this.availableClusterTypes = receivedClusterTypes
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}).catch(logRequestError)
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
async updateStore () {
|
|
83
|
+
const providerStore = useProviderStore();
|
|
84
|
+
|
|
85
|
+
return Promise.all([
|
|
86
|
+
this.getCluster(),
|
|
87
|
+
this.getClusterTypes()
|
|
88
|
+
]).then(() => {
|
|
89
|
+
this.apiState = ApiState.LOADED;
|
|
90
|
+
console.log("resourceClustersStore updated")
|
|
91
|
+
}).catch((e) => {
|
|
92
|
+
this.apiState = ApiState.ERROR;
|
|
93
|
+
console.log("Failed to update resourceClustersStore: ", e)
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import ApiState from '@/api/apiState'
|
|
2
|
+
import {defineStore} from "pinia";
|
|
3
|
+
import ResourceManagementClient from "@/api/resource-management/resource-management-client";
|
|
4
|
+
import logRequestError from "@/api/restApiHelper";
|
|
5
|
+
import {JSONPath} from "jsonpath-plus";
|
|
6
|
+
import { Base64 } from "js-base64";
|
|
7
|
+
|
|
8
|
+
interface ResourceDevicesStoreState{
|
|
9
|
+
apiState: number,
|
|
10
|
+
|
|
11
|
+
resources: any[],
|
|
12
|
+
resourceTypes: any[],
|
|
13
|
+
resourceAasDescriptors: any[],
|
|
14
|
+
resourceAASValues: {}
|
|
15
|
+
resourceConnectionTypes: any[],
|
|
16
|
+
locations: any[],
|
|
17
|
+
profiler: any[],
|
|
18
|
+
|
|
19
|
+
firmwareUpdateInformationOfResources: {}
|
|
20
|
+
firmwareUpdateJobsOfResources: {}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const useResourceDevicesStore = defineStore('resourceDevicesStore', {
|
|
24
|
+
persist: true,
|
|
25
|
+
state:():ResourceDevicesStoreState => ({
|
|
26
|
+
apiState: ApiState.INIT,
|
|
27
|
+
|
|
28
|
+
resources: [],
|
|
29
|
+
resourceTypes: [],
|
|
30
|
+
resourceAasDescriptors: [],
|
|
31
|
+
resourceAASValues: [],
|
|
32
|
+
resourceConnectionTypes: [],
|
|
33
|
+
locations: [],
|
|
34
|
+
profiler: [],
|
|
35
|
+
|
|
36
|
+
firmwareUpdateInformationOfResources: {},
|
|
37
|
+
firmwareUpdateJobsOfResources: {}
|
|
38
|
+
}),
|
|
39
|
+
getters: {
|
|
40
|
+
resourceById: (state) => (resourceId) => {
|
|
41
|
+
return state.resources.find(resource => resource.id === resourceId)
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
nonClusterResources: (state) => {
|
|
45
|
+
if (state.resources === undefined) {
|
|
46
|
+
return []
|
|
47
|
+
} else {
|
|
48
|
+
return state.resources.filter(prop => {
|
|
49
|
+
return !prop.clusterMember
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
firmwareUpdateInformationOfResource: (state) => (resourceId) => {
|
|
55
|
+
if (state.firmwareUpdateInformationOfResources[resourceId]) {
|
|
56
|
+
return state.firmwareUpdateInformationOfResources[resourceId]
|
|
57
|
+
} else {
|
|
58
|
+
return {}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
firmwareUpdateJobsOfResource: (state) => (resourceId) => {
|
|
63
|
+
if (state.firmwareUpdateJobsOfResources[resourceId]) {
|
|
64
|
+
return state.firmwareUpdateJobsOfResources[resourceId]
|
|
65
|
+
} else {
|
|
66
|
+
return []
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
actions: {
|
|
72
|
+
addOrUpdateResource(resource) {
|
|
73
|
+
if (this.resources === undefined) {
|
|
74
|
+
this.resources = [];
|
|
75
|
+
}
|
|
76
|
+
const index = this.resources.findIndex(r => r.id === resource.id);
|
|
77
|
+
if (index !== -1) {
|
|
78
|
+
this.resources = this.resources.filter(r => r.id !== resource.id);
|
|
79
|
+
}
|
|
80
|
+
this.resources.push(resource);
|
|
81
|
+
},
|
|
82
|
+
deleteResource(resourceId: string) {
|
|
83
|
+
this.resources = this.resources.filter(resource => resource.id !== resourceId)
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
setResources(newResources){
|
|
87
|
+
try {
|
|
88
|
+
if (this.resources !== undefined) {
|
|
89
|
+
const markedForDeleteResources = this.resources.filter((res) => res.markedForDelete === true)
|
|
90
|
+
|
|
91
|
+
// Assure markedForDelete Property is not overwritten by polling
|
|
92
|
+
for (const markedForDeleteResource of markedForDeleteResources) {
|
|
93
|
+
const resourceToUpdate = newResources.find((res) => res.id === markedForDeleteResource.id)
|
|
94
|
+
if (resourceToUpdate !== undefined) {
|
|
95
|
+
resourceToUpdate.markedForDelete = true
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
} catch (e) {
|
|
100
|
+
console.log(e)
|
|
101
|
+
}
|
|
102
|
+
this.resources = newResources
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
setResourceMarkedForDelete(resource){
|
|
106
|
+
const filteredRes = this.resources.find(obj => obj.id === resource.id)
|
|
107
|
+
filteredRes.markedForDelete = true
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
async getResourceById (resourceId: string) {
|
|
111
|
+
return await ResourceManagementClient.resourcesApi.getResource(resourceId)
|
|
112
|
+
.then(
|
|
113
|
+
response => {
|
|
114
|
+
if (response.data){
|
|
115
|
+
const resource = response.data
|
|
116
|
+
this.addOrUpdateResource(resource)
|
|
117
|
+
return this.getFirmwareUpdateInformationOfResource(resource.id);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
})
|
|
121
|
+
.catch(e => {
|
|
122
|
+
console.log(e)
|
|
123
|
+
this.setResources([]);
|
|
124
|
+
})
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
async getResourcesFromBackend () {
|
|
128
|
+
return await ResourceManagementClient.resourcesApi.getResources()
|
|
129
|
+
.then(
|
|
130
|
+
response => {
|
|
131
|
+
if (response.data){
|
|
132
|
+
const resources = response.data
|
|
133
|
+
this.setResources(resources)
|
|
134
|
+
return this.getFirmwareUpdateInformationOfAllResources();
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
})
|
|
138
|
+
.catch(e => {
|
|
139
|
+
console.log(e)
|
|
140
|
+
this.setResources([]);
|
|
141
|
+
})
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
async getResourceAasValues () {
|
|
145
|
+
return await Promise.all(this.resources.map(async (resource) => {
|
|
146
|
+
await ResourceManagementClient.resourcesSubmodelRepositoryApi.getAllSubmodelsValueOnly(Base64.encode("Resource_" + resource.id))
|
|
147
|
+
.then(
|
|
148
|
+
response => {
|
|
149
|
+
this.resourceAASValues[resource.id] = response.data;
|
|
150
|
+
}
|
|
151
|
+
).catch(logRequestError)
|
|
152
|
+
}));
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
getResourceSubmodelByIdShort (resourceId, submodelIdShort) {
|
|
156
|
+
try {
|
|
157
|
+
var submodel =this.resourceAASValues[resourceId][submodelIdShort]
|
|
158
|
+
return submodel
|
|
159
|
+
} catch (e) {
|
|
160
|
+
return "N/A"
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
getSubmodelElementValueOfResourceSubmodel (resourceId, submodelIdShort, submodelElementJsonPath) {
|
|
165
|
+
try {
|
|
166
|
+
var value = JSONPath({path: submodelElementJsonPath, json: this.resourceAASValues[resourceId][submodelIdShort]["valuesOnlyMap"], wrap: true})[0];
|
|
167
|
+
if (value == undefined) {
|
|
168
|
+
value = "N/A";
|
|
169
|
+
}
|
|
170
|
+
return value
|
|
171
|
+
} catch (e) {
|
|
172
|
+
return "N/A"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
async getFirmwareUpdateInformationOfAllResources() {
|
|
177
|
+
return await Promise.all(this.resources.map(async (resource) => {
|
|
178
|
+
await ResourceManagementClient.resourcesUpdatesApi.getUpdateInformationOfResource(resource.id).then(
|
|
179
|
+
response => {
|
|
180
|
+
this.firmwareUpdateInformationOfResources[resource.id] = response.data;
|
|
181
|
+
}
|
|
182
|
+
).catch(logRequestError)
|
|
183
|
+
}));
|
|
184
|
+
},
|
|
185
|
+
|
|
186
|
+
async getFirmwareUpdateInformationOfResource(resourceId: string) {
|
|
187
|
+
return await ResourceManagementClient.resourcesUpdatesApi.getUpdateInformationOfResource(resourceId).then(
|
|
188
|
+
response => {
|
|
189
|
+
this.firmwareUpdateInformationOfResources[resourceId] = response.data;
|
|
190
|
+
}
|
|
191
|
+
).catch(logRequestError)
|
|
192
|
+
},
|
|
193
|
+
|
|
194
|
+
async getFirmwareUpdateJobsOfResource(resourceId: string) {
|
|
195
|
+
return await ResourceManagementClient.resourcesUpdatesApi.getFirmwareUpdateJobsOfResource(resourceId).then(
|
|
196
|
+
response => {
|
|
197
|
+
this.firmwareUpdateJobsOfResources[resourceId] = response.data;
|
|
198
|
+
return response.data;
|
|
199
|
+
}
|
|
200
|
+
).catch(logRequestError)
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
async getResourceAasDescriptors () {
|
|
204
|
+
return await ResourceManagementClient.aasApi.getResourceAASDescriptors().then(
|
|
205
|
+
response => {
|
|
206
|
+
this.resourceAasDescriptors = response.data;
|
|
207
|
+
}
|
|
208
|
+
).catch(logRequestError)
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
async getLocations() {
|
|
212
|
+
return await ResourceManagementClient.locationApi.getLocations()
|
|
213
|
+
.then(
|
|
214
|
+
result => {
|
|
215
|
+
if (result.data)
|
|
216
|
+
this.locations = result.data;
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
.catch(e => {
|
|
220
|
+
console.debug(e)
|
|
221
|
+
this.locations = [];
|
|
222
|
+
})
|
|
223
|
+
},
|
|
224
|
+
|
|
225
|
+
async getProfiler() {
|
|
226
|
+
return await ResourceManagementClient.profilerApi.getProfiler()
|
|
227
|
+
.then(
|
|
228
|
+
response => {
|
|
229
|
+
if (response.data){
|
|
230
|
+
this.profiler = response.data;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
.catch(e => {
|
|
235
|
+
console.debug(e)
|
|
236
|
+
this.profiler = [];
|
|
237
|
+
})
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
async getRemoteConnectionTypes() {
|
|
241
|
+
return await ResourceManagementClient.resourcesApi.getRemoteConnectionTypes()
|
|
242
|
+
.then(
|
|
243
|
+
response => {
|
|
244
|
+
if(response.data){
|
|
245
|
+
this.resourceConnectionTypes = response.data;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
.catch(e => {
|
|
250
|
+
console.error(e)
|
|
251
|
+
this.resourceConnectionTypes = [];
|
|
252
|
+
})
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
async getResourceTypes() {
|
|
256
|
+
return await ResourceManagementClient.resourceTypesApi.getResourceTypes()
|
|
257
|
+
.then(
|
|
258
|
+
response => {
|
|
259
|
+
if (response.data){
|
|
260
|
+
this.resourceTypes = response.data;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
)
|
|
264
|
+
.catch(e => {
|
|
265
|
+
console.debug(e)
|
|
266
|
+
this.profiler = [];
|
|
267
|
+
})
|
|
268
|
+
},
|
|
269
|
+
|
|
270
|
+
async updateStore () {
|
|
271
|
+
if (this.apiState === ApiState.INIT) {
|
|
272
|
+
this.apiState = ApiState.LOADING;
|
|
273
|
+
} else {
|
|
274
|
+
this.apiState = ApiState.UPDATING;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return Promise.all([
|
|
278
|
+
this.getResourcesFromBackend(),
|
|
279
|
+
this.getResourceAasDescriptors(),
|
|
280
|
+
this.getResourceAasValues(),
|
|
281
|
+
this.getLocations(),
|
|
282
|
+
this.getProfiler(),
|
|
283
|
+
this.getRemoteConnectionTypes(),
|
|
284
|
+
]).then(() => {
|
|
285
|
+
this.apiState = ApiState.LOADED;
|
|
286
|
+
console.log("resourceDevicesStore updated")
|
|
287
|
+
}).catch((e) => {
|
|
288
|
+
this.apiState = ApiState.ERROR;
|
|
289
|
+
console.log("Failed to update resourceDevicesStore: ", e)
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
});
|
|
294
|
+
|