@eclipse-slm/ui 0.0.0-stage → 1.5.0-snapshot.2
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 +277 -2
- package/index.html +19 -0
- package/package.json +104 -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/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 +39 -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 +203 -0
- package/src/app/routes.ts +192 -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/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 +87 -0
- package/src/components/base/CustomDialog.vue +88 -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/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 +207 -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/JobsOverview.vue +173 -0
- package/src/components/notifications/NotificationsOverview.vue +154 -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 +199 -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/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 +294 -0
- package/src/main.ts +167 -0
- package/src/pages/AccessDeniedPage.vue +10 -0
- package/src/pages/AdminComponentsPage.vue +34 -0
- package/src/pages/AdminPage.vue +68 -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 +379 -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/JobsPage.vue +18 -0
- package/src/pages/NotificationsPage.vue +13 -0
- package/src/pages/ProviderPage.vue +18 -0
- package/src/pages/ResourceInstancesPage.vue +106 -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/capabilitiesStore.ts +116 -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 +155 -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 +93 -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/notificationTextGenerator.ts +82 -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 +58 -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
package/README.md
CHANGED
|
@@ -1,3 +1,278 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Getting Started
|
|
4
|
+
- Install Nodejs from [Nodejs Official Page](https://nodejs.org/en/)
|
|
5
|
+
- Open the terminal and navigate to the project
|
|
6
|
+
- Run `npm install` or `yarn install` if you use [Yarn](https://yarnpkg.com/en/)
|
|
7
|
+
- Run `npm run dev` or `yarn serve` to start a local development server
|
|
8
|
+
|
|
9
|
+
## File Structure
|
|
10
|
+
|
|
11
|
+
Within the download you'll find the following directories and files:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
ui
|
|
15
|
+
├── README.md
|
|
16
|
+
├── CHANGELOG.md
|
|
17
|
+
├── jest.config.js
|
|
18
|
+
├── now.json
|
|
19
|
+
├── package.json
|
|
20
|
+
├── public
|
|
21
|
+
│ ├── favicon.ico
|
|
22
|
+
│ └── index.html
|
|
23
|
+
├── src
|
|
24
|
+
│ ├── App.vue
|
|
25
|
+
│ ├── assets
|
|
26
|
+
│ │ └── vuetify.svg
|
|
27
|
+
│ ├── components
|
|
28
|
+
│ │ └── base
|
|
29
|
+
│ │ ├── Card.vue
|
|
30
|
+
│ │ ├── Item.vue
|
|
31
|
+
│ │ ├── ItemGroup.vue
|
|
32
|
+
│ │ ├── ItemSubGroup.vue
|
|
33
|
+
│ │ ├── MaterialAlert.vue
|
|
34
|
+
│ │ ├── MaterialCard.vue
|
|
35
|
+
│ │ ├── MaterialChartCard.vue
|
|
36
|
+
│ │ ├── MaterialSnackbar.vue
|
|
37
|
+
│ │ ├── MaterialStatsCard.vue
|
|
38
|
+
│ │ ├── MaterialTabs.vue
|
|
39
|
+
│ │ ├── MaterialTestimony.vue
|
|
40
|
+
│ │ ├── Subheading.vue
|
|
41
|
+
│ │ └── VComponent.vue
|
|
42
|
+
│ ├── i18n.js
|
|
43
|
+
│ ├── locales
|
|
44
|
+
│ │ └── en.json
|
|
45
|
+
│ ├── main.ts
|
|
46
|
+
│ ├── plugins
|
|
47
|
+
│ │ ├── base.js
|
|
48
|
+
│ │ ├── chartist.js
|
|
49
|
+
│ │ ├── vee-validate.js
|
|
50
|
+
│ │ └── vuetify.js
|
|
51
|
+
│ ├── router.js
|
|
52
|
+
│ ├── sass
|
|
53
|
+
│ │ ├── main.scss
|
|
54
|
+
│ │ ├── overrides.sass
|
|
55
|
+
│ │ └── vuetify-material
|
|
56
|
+
│ │ └── _sidebar.sass
|
|
57
|
+
│ ├── stores
|
|
58
|
+
│ └── catalogStore.ts
|
|
59
|
+
│ └── jobsStore.ts
|
|
60
|
+
│ └── notificationStore.ts
|
|
61
|
+
│ └── providerStore.ts
|
|
62
|
+
│ └── resourceDevicesStore.ts
|
|
63
|
+
│ └── resourceClustersStore.ts
|
|
64
|
+
│ └── serviceOfferingsStore.ts
|
|
65
|
+
│ └── serviceInstancesStore.ts
|
|
66
|
+
│ └── store.ts
|
|
67
|
+
│ └── userStore.ts
|
|
68
|
+
│ └── views
|
|
69
|
+
│ └── dashboard
|
|
70
|
+
│ ├── Charts.vue
|
|
71
|
+
│ ├── Dashboard.vue
|
|
72
|
+
│ ├── Index.vue
|
|
73
|
+
│ ├── Widgets.vue
|
|
74
|
+
│ ├── component
|
|
75
|
+
│ │ ├── Buttons.vue
|
|
76
|
+
│ │ ├── Grid.vue
|
|
77
|
+
│ │ ├── Icons.vue
|
|
78
|
+
│ │ ├── Notifications.vue
|
|
79
|
+
│ │ ├── Tabs.vue
|
|
80
|
+
│ │ └── Typography.vue
|
|
81
|
+
│ ├── components
|
|
82
|
+
│ │ └── core
|
|
83
|
+
│ │ ├── AppBar.vue
|
|
84
|
+
│ │ ├── Drawer.vue
|
|
85
|
+
│ │ ├── Footer.vue
|
|
86
|
+
│ │ ├── Settings.vue
|
|
87
|
+
│ │ └── View.vue
|
|
88
|
+
│ ├── maps
|
|
89
|
+
│ │ └── GoogleMaps.vue
|
|
90
|
+
│ ├── pages
|
|
91
|
+
│ │ └── UserProfile.vue
|
|
92
|
+
│ └── tables
|
|
93
|
+
│ └── RegularTables.vue
|
|
94
|
+
├── tests
|
|
95
|
+
│ ├── e2e
|
|
96
|
+
│ │ ├── plugins
|
|
97
|
+
│ │ │ └── index.js
|
|
98
|
+
│ │ ├── specs
|
|
99
|
+
│ │ │ └── test.js
|
|
100
|
+
│ │ └── support
|
|
101
|
+
│ │ ├── commands.js
|
|
102
|
+
│ │ └── index.js
|
|
103
|
+
│ └── unit
|
|
104
|
+
│ └── example.spec.js
|
|
105
|
+
├── vue.config.js
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Building a custom SLM UI
|
|
109
|
+
|
|
110
|
+
`@eclipse-slm/ui` is published to npmjs.com as **unbuilt source** plus a Vite plugin (`@eclipse-slm/ui/vite`). A
|
|
111
|
+
consumer project builds the SLM UI itself and can shadow individual files, so a customized UI does not need a fork.
|
|
112
|
+
|
|
113
|
+
### 1. Consumer setup
|
|
114
|
+
|
|
115
|
+
`package.json`:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"name": "my-slm-ui",
|
|
120
|
+
"private": true,
|
|
121
|
+
"type": "module",
|
|
122
|
+
"scripts": { "dev": "vite", "build": "vite build" },
|
|
123
|
+
"dependencies": {
|
|
124
|
+
"@eclipse-slm/ui": "^1.5.0",
|
|
125
|
+
"pinia": "^2.1.4",
|
|
126
|
+
"vite": "^7.3.1",
|
|
127
|
+
"vue": "^3.4.27",
|
|
128
|
+
"vue-i18n": "^11.2.8",
|
|
129
|
+
"vue-router": "^4.3.2",
|
|
130
|
+
"vuetify": "^3.6.9"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`vite.config.mts`:
|
|
136
|
+
|
|
137
|
+
```ts
|
|
138
|
+
import { defineConfig } from 'vite'
|
|
139
|
+
import { slmUi } from '@eclipse-slm/ui/vite'
|
|
140
|
+
|
|
141
|
+
export default defineConfig({
|
|
142
|
+
plugins: [slmUi({ overridesDir: 'src/overrides' })],
|
|
143
|
+
})
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
`npm run dev` and `npm run build` work with this configuration alone; the plugin sets up dependency pre-bundling for
|
|
147
|
+
the package source in `node_modules`, so no extra `optimizeDeps` or CommonJS settings are needed.
|
|
148
|
+
|
|
149
|
+
Plugin options:
|
|
150
|
+
|
|
151
|
+
| Option | Default | Meaning |
|
|
152
|
+
|-----------------|-----------|------------------------------------------------------------------------------------------|
|
|
153
|
+
| `overridesDir` | - | Directory (relative to the consumer root) whose files shadow files of the package `src`. |
|
|
154
|
+
| `apiClientsDir` | `src/api` | Directory containing the generated API clients (see "API clients"). |
|
|
155
|
+
| `allowNewFiles` | `false` | Allow files in `overridesDir` that have no upstream counterpart (disables the drift check). |
|
|
156
|
+
|
|
157
|
+
### 2. Overrides and `@slm-original`
|
|
158
|
+
|
|
159
|
+
A file in `overridesDir` replaces the package file with the same path relative to the package `src`. For example
|
|
160
|
+
`src/overrides/components/core/Footer.vue` replaces `src/components/core/Footer.vue`. Inside an override, import the
|
|
161
|
+
upstream version with the `@slm-original/` prefix:
|
|
162
|
+
|
|
163
|
+
```vue
|
|
164
|
+
<script setup lang="ts">
|
|
165
|
+
import OriginalCard from '@slm-original/components/base/MaterialCard.vue'
|
|
166
|
+
</script>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Drift check:** if an override has no upstream file (for example because the file was renamed or removed in a newer
|
|
170
|
+
`@eclipse-slm/ui`), the build fails with
|
|
171
|
+
`Override "<path>" has no upstream file (renamed or removed in @eclipse-slm/ui@<version>?)`, naming an upstream file
|
|
172
|
+
with a different extension if there is one. Set `allowNewFiles: true` to add genuinely new files.
|
|
173
|
+
|
|
174
|
+
The dev server restarts automatically when override files are added or removed.
|
|
175
|
+
|
|
176
|
+
### 3. Customization hooks
|
|
177
|
+
|
|
178
|
+
The hooks are ordinary overridable files in `src/customization/` (and `src/app/` for the data they work on). Shadow
|
|
179
|
+
the file in your `overridesDir`, for example `src/overrides/customization/customizeRoutes.ts`.
|
|
180
|
+
|
|
181
|
+
**`customizeRoutes(routes)`** adds, removes or changes routes:
|
|
182
|
+
|
|
183
|
+
```ts
|
|
184
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
185
|
+
export default function customizeRoutes(routes: RouteRecordRaw[]): RouteRecordRaw[] {
|
|
186
|
+
return [...routes, { path: '/mine', component: () => import('@/pages/MyPage.vue') }]
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**`customizeNavigation(items)`** changes the drawer entries (`NavItem`). `titleKey` is an i18n key, `visible` is a
|
|
191
|
+
boolean or `(ctx: { roles: string[]; isDeveloper: boolean }) => boolean`; other fields are `id`, `icon`, `to`,
|
|
192
|
+
`group`, `children` and the rendering hints `divider`, `text`, `subGroup`, `goToChildOnClick`:
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
import type { NavItem } from '@/app/navigation'
|
|
196
|
+
export default function customizeNavigation(items: NavItem[]): NavItem[] {
|
|
197
|
+
return [...items, { id: 'nav-mine', icon: 'mdi-star', titleKey: 'mine.title', to: '/mine',
|
|
198
|
+
visible: ({ roles }) => roles.includes('slm-admin') }]
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**`customizeMessages(messages)`** adds or overrides i18n messages (keyed by locale). Use `deepMerge` to keep the rest:
|
|
203
|
+
|
|
204
|
+
```ts
|
|
205
|
+
import { deepMerge } from '@/customization/deepMerge'
|
|
206
|
+
import type { Messages } from '@/customization/customizeMessages'
|
|
207
|
+
export default function customizeMessages(messages: Messages): Messages {
|
|
208
|
+
return deepMerge(messages, { en: { mine: { title: 'My page' } } })
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**`customizeApp(app)`** runs before the Vue app is mounted, to register plugins or components:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import type { App } from 'vue'
|
|
216
|
+
export default function customizeApp(app: App): void {
|
|
217
|
+
app.component('MyWidget', MyWidget)
|
|
218
|
+
}
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
The app instance itself lives in `@/app/appInstance` (`app`, and `globals` = `app.config.globalProperties`, e.g.
|
|
222
|
+
`globals.$keycloak`). `@/main` still re-exports `globals` for backward compatibility, but new code and overrides should
|
|
223
|
+
import from `@/app/appInstance`: any module importing `@/main` makes the dev server evaluate the entry a second time.
|
|
224
|
+
|
|
225
|
+
**`theme.ts`** (`src/customization/theme.ts`) is a default export `{ colors, variables }` used for the Vuetify theme:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
export default { colors: { primary: '#123456', secondary: '#00A0E3' }, variables: {} }
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### 4. API clients
|
|
232
|
+
|
|
233
|
+
The package does **not** ship the generated API clients. The consumer must generate them with OpenAPI Generator
|
|
234
|
+
(generator `typescript-axios`) from the services' OpenAPI specs into:
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
<apiClientsDir>/resource-management/client/index.ts
|
|
238
|
+
<apiClientsDir>/platform-management/client/index.ts
|
|
239
|
+
<apiClientsDir>/service-management/client/index.ts
|
|
240
|
+
<apiClientsDir>/notification-service/client/index.ts
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
`ui/pom.xml` in this repository is the reference configuration (generator, input specs and output directories). If a
|
|
244
|
+
client is missing, the build fails with `Missing generated API client for "<service>": expected <path>`.
|
|
245
|
+
|
|
246
|
+
The generated clients import `axios` from the consumer's directory, so add `axios` as a **direct dependency** of your
|
|
247
|
+
project (required with strict layouts such as pnpm, where the package's own `axios` is not visible to your files).
|
|
248
|
+
|
|
249
|
+
### 5. Docker
|
|
250
|
+
|
|
251
|
+
Copy `node_modules/@eclipse-slm/ui/src/docker/*` (`entrypoint.sh`, `nginx.conf`, `slm.conf`) into your image build
|
|
252
|
+
context and use the upstream [`ui/Dockerfile`](Dockerfile) as a template, replacing its build stage with your
|
|
253
|
+
consumer's `npm ci && npm run build`.
|
|
254
|
+
|
|
255
|
+
### 6. Upgrading
|
|
256
|
+
|
|
257
|
+
- npm dist-tags: `latest` is the last release (`X.Y.Z`), `next` is the latest `develop` snapshot
|
|
258
|
+
(`X.Y.Z-snapshot.<run_number>`). Use a range such as `^1.5.0` for releases. Caret ranges do not match prereleases, so to try a snapshot install `@eclipse-slm/ui@next` or an exact `1.5.0-snapshot.N`.
|
|
259
|
+
- After an upgrade, run a build. The drift check reports overrides whose upstream file was renamed or removed.
|
|
260
|
+
- Compatibility promise: any shadowable file may change in a minor release, and the drift check surfaces that.
|
|
261
|
+
Changes to **plugin options, hook signatures or `NavItem`** are breaking and only happen in a major release.
|
|
262
|
+
|
|
263
|
+
### 7. For maintainers: publishing
|
|
264
|
+
|
|
265
|
+
The `ui-package` job in `.github/workflows/build-core.yml` tests, builds and verifies the package on every run and
|
|
266
|
+
publishes with npm trusted publishing (OIDC, with provenance, no `NPM_TOKEN`). The version comes from `<revision>` in
|
|
267
|
+
the root `pom.xml` (never edit `ui/package.json`'s version by hand): `develop` publishes `X.Y.Z-snapshot.<run>` as
|
|
268
|
+
`next`, a release tag on `main` publishes `X.Y.Z` as `latest`.
|
|
269
|
+
|
|
270
|
+
Bootstrap (once): trusted publishing can only be configured for an existing package, so
|
|
271
|
+
|
|
272
|
+
1. publish the first version manually with a personal npm account that can publish to the `@eclipse-slm` scope.
|
|
273
|
+
Do not publish the checked-in `ui/package.json` version. Set the version first, exactly as CI does, and use the
|
|
274
|
+
printed dist-tag:
|
|
275
|
+
`node ui/scripts/npm-version.mjs <revision> <n>` (prints `dist_tag=...`), then
|
|
276
|
+
`npm --prefix ui publish --access public --tag <dist_tag>` (a snapshot revision gives `--tag next`);
|
|
277
|
+
2. on npmjs.com, open the package settings, add a **trusted publisher** (GitHub Actions) with repository
|
|
278
|
+
`eclipse-slm/slm` and workflow `build-core.yml`.
|
package/index.html
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
6
|
+
<meta name="viewport" content="initial-scale=1.0">
|
|
7
|
+
<link rel="icon" href="/favicon_white.png">
|
|
8
|
+
<title>Eclipse Service Lifecycle Management</title>
|
|
9
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700,900">
|
|
10
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css">
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<noscript>
|
|
14
|
+
<strong>We're sorry but the Eclipse SLM doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
|
15
|
+
</noscript>
|
|
16
|
+
<div id="app"></div>
|
|
17
|
+
<script type="module" src="/src/main.ts"></script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,106 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eclipse-slm/ui",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
"version": "1.5.0-snapshot.2",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/eclipse-slm/slm.git",
|
|
10
|
+
"directory": "ui"
|
|
11
|
+
},
|
|
12
|
+
"exports": {
|
|
13
|
+
"./vite": {
|
|
14
|
+
"types": "./vite/dist/index.d.ts",
|
|
15
|
+
"import": "./vite/dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"src",
|
|
21
|
+
"!src/api/*/client",
|
|
22
|
+
"index.html",
|
|
23
|
+
"public",
|
|
24
|
+
"vite/dist",
|
|
25
|
+
"vite/package.json"
|
|
26
|
+
],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dev": "vite",
|
|
29
|
+
"build": "vite build",
|
|
30
|
+
"serve": "vite preview",
|
|
31
|
+
"lint": "eslint --fix src",
|
|
32
|
+
"test:plugin": "vitest run --config vite/vitest.config.ts",
|
|
33
|
+
"build:plugin": "tsc -p vite/tsconfig.json",
|
|
34
|
+
"prepack": "npm run build:plugin"
|
|
35
|
+
},
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"vue": "^3.4.27",
|
|
38
|
+
"vuetify": "^3.6.9",
|
|
39
|
+
"pinia": "^2.1.4",
|
|
40
|
+
"vue-router": "^4.3.2",
|
|
41
|
+
"vue-i18n": "^11.2.8",
|
|
42
|
+
"vite": "^7.3.1"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@dsb-norge/vue-keycloak-js": "3.0.3",
|
|
46
|
+
"@soerenmartius/vue3-clipboard": "^0.1.2",
|
|
47
|
+
"@stomp/stompjs": "^6.1.2",
|
|
48
|
+
"@vitejs/plugin-vue": "^6.0.4",
|
|
49
|
+
"@vueuse/core": "^12.7.0",
|
|
50
|
+
"@wdns/vue-code-block": "^2.3.5",
|
|
51
|
+
"api-poller-worker": "^1.3.4",
|
|
52
|
+
"axios": "^1.8.1",
|
|
53
|
+
"chart.js": "^4.0.0",
|
|
54
|
+
"chartist": "^0.11.4",
|
|
55
|
+
"core-js": "^3.48.0",
|
|
56
|
+
"cors": "^2.8.6",
|
|
57
|
+
"dot-properties": "^1.0.1",
|
|
58
|
+
"js-base64": "^3.7.7",
|
|
59
|
+
"jsonpath": "^1.1.1",
|
|
60
|
+
"localforage": "^1.10.0",
|
|
61
|
+
"lodash": "^4.17.23",
|
|
62
|
+
"material-design-icons-iconfont": "^6.7.0",
|
|
63
|
+
"moment": "^2.29.4",
|
|
64
|
+
"pinia-plugin-persistedstate": "^3.2.1",
|
|
65
|
+
"sass": "^1.85.1",
|
|
66
|
+
"sockjs-client": "^1.5.1",
|
|
67
|
+
"stomp-websocket": "^2.3.4-next",
|
|
68
|
+
"typescript": "^5.7.3",
|
|
69
|
+
"vee-validate": "^4.12.6",
|
|
70
|
+
"vite-plugin-commonjs": "^0.10.4",
|
|
71
|
+
"vite-plugin-vuetify": "^2.1.0",
|
|
72
|
+
"vue-axios": "^3.5.2",
|
|
73
|
+
"vue-chartist": "^3.0.0",
|
|
74
|
+
"vue-chartjs": "^5.3.1",
|
|
75
|
+
"vue-draggable-next": "^2.2.1",
|
|
76
|
+
"vue-enums": "^1.0.0",
|
|
77
|
+
"vue-json-pretty": "1.7.1",
|
|
78
|
+
"vue-toast-notification": "^3.1.2",
|
|
79
|
+
"vue-uuid": "^3.0.0",
|
|
80
|
+
"websocket": "^1.0.34",
|
|
81
|
+
"yaml": "^2.7.0",
|
|
82
|
+
"yup": "^1.4.0"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@types/node": "^22.13.5",
|
|
86
|
+
"@typescript-eslint/parser": "^8.16.0",
|
|
87
|
+
"@vue/compiler-sfc": "^3.4.23",
|
|
88
|
+
"@vue/eslint-config-typescript": "^14.6.0",
|
|
89
|
+
"eslint": "^9.33.0",
|
|
90
|
+
"eslint-config-vuetify": "^2.0.5",
|
|
91
|
+
"eslint-import-resolver-typescript": "^3.7.0",
|
|
92
|
+
"eslint-plugin-import": "^2.31.0",
|
|
93
|
+
"eslint-plugin-node": "^11.1.0",
|
|
94
|
+
"eslint-plugin-promise": "^4.3.1",
|
|
95
|
+
"eslint-plugin-vue": "^9.32.0",
|
|
96
|
+
"eslint-plugin-vuetify": "^2.4.0",
|
|
97
|
+
"pinia": "^2.1.4",
|
|
98
|
+
"playwright": "^1.64.1",
|
|
99
|
+
"vite": "^7.3.1",
|
|
100
|
+
"vitest": "^5.0.5",
|
|
101
|
+
"vue": "^3.4.27",
|
|
102
|
+
"vue-i18n": "^11.2.8",
|
|
103
|
+
"vue-router": "^4.3.2",
|
|
104
|
+
"vuetify": "^3.6.9"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<router-view />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import updateToken from '@/utils/updateToken'
|
|
7
|
+
import NotificationServiceWebsocketClient from '@/api/notification-service/notificationServiceWebsocketClient'
|
|
8
|
+
|
|
9
|
+
export default {
|
|
10
|
+
name: 'App',
|
|
11
|
+
data() {
|
|
12
|
+
return {
|
|
13
|
+
tokenRefreshTimer: null
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
watch: {
|
|
17
|
+
$route () {
|
|
18
|
+
updateToken()
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
created () {
|
|
22
|
+
this.timer = setInterval(() => {
|
|
23
|
+
updateToken()
|
|
24
|
+
}, 60000)
|
|
25
|
+
},
|
|
26
|
+
mounted () {
|
|
27
|
+
|
|
28
|
+
},
|
|
29
|
+
unmounted () {
|
|
30
|
+
NotificationServiceWebsocketClient.disconnect()
|
|
31
|
+
clearInterval(this.timer)
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss">
|
|
37
|
+
.v-toast__text {
|
|
38
|
+
font-family: "Roboto", sans-serif;
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
import logRequestError from '@/api/restApiHelper.js';
|
|
3
|
+
|
|
4
|
+
class CatalogRestApi {
|
|
5
|
+
API_URL = '/slm-catalog/catalog';
|
|
6
|
+
|
|
7
|
+
async getAASSubmodelTemplates () {
|
|
8
|
+
return axios
|
|
9
|
+
.get(this.API_URL + '/aas/submodels/templates')
|
|
10
|
+
.then(response => {
|
|
11
|
+
return response.data;
|
|
12
|
+
})
|
|
13
|
+
.catch(logRequestError);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default new CatalogRestApi();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import logRequestError from '@/api/restApiHelper.js'
|
|
3
|
+
|
|
4
|
+
class NotificationServiceActuatorRestApi {
|
|
5
|
+
API_URL = '/notification-service/actuator'
|
|
6
|
+
|
|
7
|
+
async getInfo () {
|
|
8
|
+
return axios
|
|
9
|
+
.get(this.API_URL + '/info')
|
|
10
|
+
.then(response => {
|
|
11
|
+
return response.data
|
|
12
|
+
})
|
|
13
|
+
.catch(logRequestError)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async getHealth () {
|
|
17
|
+
return axios
|
|
18
|
+
.get(this.API_URL + '/health')
|
|
19
|
+
.then(response => {
|
|
20
|
+
return response.data
|
|
21
|
+
})
|
|
22
|
+
.catch(logRequestError)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default new NotificationServiceActuatorRestApi()
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import SockJS from 'sockjs-client/dist/sockjs';
|
|
2
|
+
import Stomp from 'stomp-websocket';
|
|
3
|
+
import {useNotificationStore} from "@/stores/notificationStore";
|
|
4
|
+
import { globals } from '@/app/appInstance';
|
|
5
|
+
|
|
6
|
+
const API_URL = '/notification-service';
|
|
7
|
+
|
|
8
|
+
class NotificationServiceWebsocketClient {
|
|
9
|
+
socket = null
|
|
10
|
+
|
|
11
|
+
static processNotificationMessage(response) {
|
|
12
|
+
const content = JSON.parse(response.body);
|
|
13
|
+
const notificationStore = useNotificationStore();
|
|
14
|
+
notificationStore.processIncomingNotification(content);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
static resolveUserId() {
|
|
18
|
+
return globals.$keycloak?.tokenParsed?.sub
|
|
19
|
+
|| globals.$keycloak?.subject
|
|
20
|
+
|| globals.$keycloak?.keycloak?.subject
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
connect () {
|
|
24
|
+
this.socket = new SockJS(API_URL + `/ws/notifications`);
|
|
25
|
+
this.stompClient = Stomp.over(this.socket);
|
|
26
|
+
|
|
27
|
+
this.stompClient.reconnect_delay = 5000;
|
|
28
|
+
// remove for stump debug messages
|
|
29
|
+
this.stompClient.debug = (message) => {
|
|
30
|
+
// console.log(message)
|
|
31
|
+
};
|
|
32
|
+
const userId = NotificationServiceWebsocketClient.resolveUserId()
|
|
33
|
+
const subscriptionName = `/topic/notifications/${userId}`
|
|
34
|
+
|
|
35
|
+
this.stompClient.connect(
|
|
36
|
+
{
|
|
37
|
+
Authorization: 'Bearer ' + globals.$keycloak.token,
|
|
38
|
+
Issuer: `${globals.$keycloak.keycloak.authServerUrl}/realms/${globals.$keycloak.keycloak.realm}`
|
|
39
|
+
},
|
|
40
|
+
() => {
|
|
41
|
+
this.stompClient.subscribe('/user/topic/notifications', NotificationServiceWebsocketClient.processNotificationMessage);
|
|
42
|
+
|
|
43
|
+
// direct topic fallback for convertAndSend("/topic/notifications/{userId}", ...)
|
|
44
|
+
if (userId) {
|
|
45
|
+
this.stompClient.subscribe(subscriptionName, NotificationServiceWebsocketClient.processNotificationMessage);
|
|
46
|
+
} else {
|
|
47
|
+
console.warn('Unable to resolve websocket user id for /topic/notifications/{userId} subscription')
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
(error) => {
|
|
51
|
+
console.error('Notification websocket connection failed', error)
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
disconnect () {
|
|
56
|
+
this.socket.close();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export default new NotificationServiceWebsocketClient();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import {
|
|
3
|
+
CredentialsApi,
|
|
4
|
+
type UserCreateRequest,
|
|
5
|
+
} from "@/api/platform-management/client";
|
|
6
|
+
|
|
7
|
+
export interface UserOverviewResponse {
|
|
8
|
+
username: string;
|
|
9
|
+
firstName: string;
|
|
10
|
+
lastName: string;
|
|
11
|
+
email: string;
|
|
12
|
+
admin: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
class PlatformManagementClient{
|
|
16
|
+
|
|
17
|
+
apiUrl = "/platform-management";
|
|
18
|
+
|
|
19
|
+
credentialsApi = new CredentialsApi(undefined, this.apiUrl);
|
|
20
|
+
|
|
21
|
+
async getUsers(): Promise<UserOverviewResponse[]> {
|
|
22
|
+
return axios
|
|
23
|
+
.get<UserOverviewResponse[]>(`${this.apiUrl}/users`)
|
|
24
|
+
.then(response => response.data);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async createUser(userCreateRequest: UserCreateRequest): Promise<void> {
|
|
28
|
+
return axios
|
|
29
|
+
.post(`${this.apiUrl}/users`, userCreateRequest)
|
|
30
|
+
.then(() => undefined);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async makeUserAdmin(username: string): Promise<void> {
|
|
34
|
+
return axios
|
|
35
|
+
.post(`${this.apiUrl}/users/${encodeURIComponent(username)}/admin`)
|
|
36
|
+
.then(() => undefined);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async deleteUser(username: string): Promise<void> {
|
|
40
|
+
return axios
|
|
41
|
+
.delete(`${this.apiUrl}/users/${encodeURIComponent(username)}`)
|
|
42
|
+
.then(() => undefined);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default new PlatformManagementClient()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import logRequestError from '@/api/restApiHelper.js'
|
|
3
|
+
|
|
4
|
+
class PlatformManagementActuatorRestApi {
|
|
5
|
+
API_URL = '/platform-management/actuator'
|
|
6
|
+
|
|
7
|
+
async getInfo () {
|
|
8
|
+
return axios
|
|
9
|
+
.get(this.API_URL + '/info')
|
|
10
|
+
.then(response => {
|
|
11
|
+
return response.data
|
|
12
|
+
})
|
|
13
|
+
.catch(logRequestError)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async getHealth () {
|
|
17
|
+
return axios
|
|
18
|
+
.get(this.API_URL + '/health')
|
|
19
|
+
.then(response => {
|
|
20
|
+
return response.data
|
|
21
|
+
})
|
|
22
|
+
.catch(logRequestError)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default new PlatformManagementActuatorRestApi()
|