@eclipse-slm/ui 0.0.0-stage → 1.5.0-snapshot.1
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 +270 -2
- package/index.html +19 -0
- package/package.json +103 -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/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 +424 -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 +383 -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 +170 -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 +26 -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 +73 -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,50 @@
|
|
|
1
|
+
import ApiState from '@/api/apiState.js'
|
|
2
|
+
import CatalogRestApi from "@/api/catalog/catalogRestApi";
|
|
3
|
+
import {defineStore} from 'pinia'
|
|
4
|
+
|
|
5
|
+
interface CatalogStoreState{
|
|
6
|
+
apiState: number,
|
|
7
|
+
aasSubmodelTemplates: [],
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export const useCatalogStore = defineStore('catalogStore', {
|
|
12
|
+
persist: true,
|
|
13
|
+
|
|
14
|
+
state: (): CatalogStoreState => ({
|
|
15
|
+
apiState: ApiState.INIT,
|
|
16
|
+
aasSubmodelTemplates: []
|
|
17
|
+
}),
|
|
18
|
+
|
|
19
|
+
getters:{
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
actions: {
|
|
23
|
+
async getSubmodelTemplates () {
|
|
24
|
+
await CatalogRestApi.getAASSubmodelTemplates()
|
|
25
|
+
.then(
|
|
26
|
+
receivedAasSubmodelTemplates => {
|
|
27
|
+
this.aasSubmodelTemplates = receivedAasSubmodelTemplates;
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
async updateStore () {
|
|
32
|
+
if (this.apiState === ApiState.INIT) {
|
|
33
|
+
this.apiState = ApiState.LOADING;
|
|
34
|
+
} else {
|
|
35
|
+
this.apiState = ApiState.UPDATING;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return Promise.all([
|
|
39
|
+
this.getSubmodelTemplates(),
|
|
40
|
+
]).then(() => {
|
|
41
|
+
this.apiState = ApiState.LOADED;
|
|
42
|
+
console.log("catalogStore updated")
|
|
43
|
+
}).catch((e) => {
|
|
44
|
+
this.apiState = ApiState.ERROR;
|
|
45
|
+
console.log("Failed to update catalogStore: ", e)
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
});
|
|
@@ -0,0 +1,88 @@
|
|
|
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 {DiscoveryJob} from "@/api/resource-management/client";
|
|
6
|
+
|
|
7
|
+
interface DiscoveryStoreState{
|
|
8
|
+
apiState: number,
|
|
9
|
+
drivers: any[],
|
|
10
|
+
discoveredResources: any[],
|
|
11
|
+
discoveryJobs: DiscoveryJob[],
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const useDiscoveryStore = defineStore('discoveryStore', {
|
|
15
|
+
persist: true,
|
|
16
|
+
|
|
17
|
+
state:():DiscoveryStoreState => ({
|
|
18
|
+
apiState: ApiState.INIT,
|
|
19
|
+
drivers: [],
|
|
20
|
+
discoveredResources: [],
|
|
21
|
+
discoveryJobs: [],
|
|
22
|
+
}),
|
|
23
|
+
|
|
24
|
+
getters: {
|
|
25
|
+
discoveredResourceByResultId: (state) => (resultId) => {
|
|
26
|
+
return state.discoveredResources.find(discoveredResource => discoveredResource.resultId === resultId)
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
discoveryJobById: (state) => (discoveryJobId): DiscoveryJob | undefined => {
|
|
30
|
+
return state.discoveryJobs.find(discoveryJob => discoveryJob.id === discoveryJobId)
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
actions: {
|
|
35
|
+
async updateDiscoveryStore () {
|
|
36
|
+
console.log("Update discovery store")
|
|
37
|
+
this.getDrivers().then();
|
|
38
|
+
this.getDiscoveredResources().then();
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
async getDrivers () {
|
|
42
|
+
|
|
43
|
+
return await ResourceManagementClient.discoveryApi.getRegisteredDrivers().then(
|
|
44
|
+
response => {
|
|
45
|
+
this.drivers = response.data;
|
|
46
|
+
}
|
|
47
|
+
).catch(logRequestError)
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
async getDiscoveredResources (removeDuplicate = false, onlyLatestJobs = false, includeIgnored = false) {
|
|
51
|
+
return await ResourceManagementClient.discoveryApi.getDiscoveredResources(removeDuplicate, onlyLatestJobs, includeIgnored).then(
|
|
52
|
+
response => {
|
|
53
|
+
this.discoveredResources = response.data;
|
|
54
|
+
}
|
|
55
|
+
).catch(logRequestError)
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
async getDiscoveryJobs () {
|
|
59
|
+
|
|
60
|
+
return await ResourceManagementClient.discoveryApi.getDiscoveryJobs().then(
|
|
61
|
+
response => {
|
|
62
|
+
this.discoveryJobs = response.data;
|
|
63
|
+
}
|
|
64
|
+
).catch(logRequestError)
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
async updateStore () {
|
|
68
|
+
if (this.apiState === ApiState.INIT) {
|
|
69
|
+
this.apiState = ApiState.LOADING;
|
|
70
|
+
} else {
|
|
71
|
+
this.apiState = ApiState.UPDATING;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return Promise.all([
|
|
75
|
+
this.getDrivers(),
|
|
76
|
+
this.getDiscoveredResources(),
|
|
77
|
+
this.getDiscoveryJobs(),
|
|
78
|
+
]).then(() => {
|
|
79
|
+
this.apiState = ApiState.LOADED;
|
|
80
|
+
console.log("discoveryStore updated")
|
|
81
|
+
}).catch((e) => {
|
|
82
|
+
this.apiState = ApiState.ERROR;
|
|
83
|
+
console.log("Failed to update discoveryStore: ", e)
|
|
84
|
+
});
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { defineStore } from 'pinia';
|
|
2
|
+
import { computed, ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
const isProduction = import.meta.env.MODE === 'production';
|
|
5
|
+
|
|
6
|
+
export const useEnvStore = defineStore('envStore', () => {
|
|
7
|
+
// States
|
|
8
|
+
const _appVersion = ref(import.meta.env.VITE_APP_VERSION || (isProduction ? '/__ENV_APP_VERSION__PLACEHOLDER__/' : ''));
|
|
9
|
+
|
|
10
|
+
const _i18nLocale = ref(import.meta.env.VITE_APP_I18N_LOCALE || (isProduction ? '/__ENV_I18N_LOCALE__PLACEHOLDER__/' : ''));
|
|
11
|
+
const _i18nLocaleFallback = ref(import.meta.env.VITE_APP_I18N_LOCALE_FALLBACK || (isProduction ? '/__ENV_I18N_LOCALE_FALLBACK__PLACEHOLDER__/' : ''));
|
|
12
|
+
|
|
13
|
+
const _notificationServiceUrl = ref(import.meta.env.VITE_APP_NOTIFICATION_SERVICE_URL || (isProduction ? '/__ENV_NOTIFICATION_SERVICE_URL__PLACEHOLDER__/' : ''));
|
|
14
|
+
const _platformManagementUrl = ref(import.meta.env.VITE_APP_PLATFORM_MANAGEMENT_URL || (isProduction ? '/__ENV_PLATFORM_MANAGEMENT_URL__PLACEHOLDER__/' : ''));
|
|
15
|
+
const _resourceManagementUrl = ref(import.meta.env.VITE_APP_RESOURCE_MANAGEMENT_URL || (isProduction ? '/__ENV_RESOURCE_MANAGEMENT_URL__PLACEHOLDER__/' : ''));
|
|
16
|
+
const _serviceManagementUrl = ref(import.meta.env.VITE_APP_SERVICE_MANAGEMENT_URL || (isProduction ? '/__ENV_SERVICE_MANAGEMENT_URL__PLACEHOLDER__/' : ''));
|
|
17
|
+
const _catalogServiceUrl = ref(import.meta.env.VITE_APP_CATALOG_SERVICE_URL || (isProduction ? '/__ENV_CATALOG_SERVICE_URL__PLACEHOLDER__/' : ''));
|
|
18
|
+
|
|
19
|
+
const _keycloakUrl = ref(import.meta.env.VITE_APP_KEYCLOAK_URL || (isProduction ? '/__ENV_KEYCLOAK_URL__PLACEHOLDER__/' : ''));
|
|
20
|
+
const _keycloakRealm = ref(import.meta.env.VITE_APP_KEYCLOAK_REALM || (isProduction ? '/__ENV_KEYCLOAK_REALM__PLACEHOLDER__/' : ''));
|
|
21
|
+
const _keycloakClientId = ref(import.meta.env.VITE_APP_KEYCLOAK_CLIENT_ID || (isProduction ? '/__ENV_KEYCLOAK_CLIENT_ID__PLACEHOLDER__/' : ''));
|
|
22
|
+
|
|
23
|
+
const _awxUrl = ref(import.meta.env.VITE_APP_AWX_URL || (isProduction ? '/__ENV_AWX_URL__PLACEHOLDER__/' : ''));
|
|
24
|
+
|
|
25
|
+
const _basyxAasGuiUrl = ref(import.meta.env.VITE_APP_BASYX_AAS_GUI_URL || (isProduction ? '/__ENV_BASYX_AAS_GUI_URL__PLACEHOLDER__/' : ''));
|
|
26
|
+
|
|
27
|
+
// Getters
|
|
28
|
+
const appVersion = computed(() => _appVersion.value);
|
|
29
|
+
|
|
30
|
+
const i18nLocale = computed(() => _i18nLocale.value);
|
|
31
|
+
const i18nLocaleFallback = computed(() => _i18nLocaleFallback.value);
|
|
32
|
+
|
|
33
|
+
const notificationServiceUrl = computed(() => _notificationServiceUrl.value);
|
|
34
|
+
const platformManagementUrl = computed(() => _platformManagementUrl.value);
|
|
35
|
+
const resourceManagementUrl = computed(() => _resourceManagementUrl.value);
|
|
36
|
+
const serviceManagementUrl = computed(() => _serviceManagementUrl.value);
|
|
37
|
+
const catalogServiceUrl = computed(() => _catalogServiceUrl.value);
|
|
38
|
+
|
|
39
|
+
const keycloakUrl = computed(() => _keycloakUrl.value);
|
|
40
|
+
const keycloakRealm = computed(() => _keycloakRealm.value);
|
|
41
|
+
const keycloakClientId = computed(() => _keycloakClientId.value);
|
|
42
|
+
|
|
43
|
+
const awxUrl = computed(() => _awxUrl.value);
|
|
44
|
+
|
|
45
|
+
const basyxAasGuiUrl = computed(() => _basyxAasGuiUrl.value);
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
appVersion,
|
|
49
|
+
i18nLocale,
|
|
50
|
+
i18nLocaleFallback,
|
|
51
|
+
notificationServiceUrl,
|
|
52
|
+
resourceManagementUrl,
|
|
53
|
+
serviceManagementUrl,
|
|
54
|
+
catalogServiceUrl,
|
|
55
|
+
keycloakUrl,
|
|
56
|
+
keycloakRealm,
|
|
57
|
+
keycloakClientId,
|
|
58
|
+
awxUrl,
|
|
59
|
+
basyxAasGuiUrl,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
export interface JobsStoreState{
|
|
7
|
+
apiState: number,
|
|
8
|
+
jobs: any[],
|
|
9
|
+
jobs_running: any[],
|
|
10
|
+
timeoutObject: NodeJS.Timeout | null,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const useJobsStore = defineStore('jobsStore', {
|
|
14
|
+
persist: true,
|
|
15
|
+
|
|
16
|
+
state: (): JobsStoreState => ({
|
|
17
|
+
apiState: ApiState.INIT,
|
|
18
|
+
jobs: [],
|
|
19
|
+
jobs_running: [],
|
|
20
|
+
timeoutObject: null,
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
getters: {},
|
|
24
|
+
|
|
25
|
+
actions: {
|
|
26
|
+
async getJobs() {
|
|
27
|
+
ResourceManagementClient.jobApi.getJobs().then(result => {
|
|
28
|
+
if (result.data) {
|
|
29
|
+
const jobs = <any[]>result.data;
|
|
30
|
+
this.jobs = jobs;
|
|
31
|
+
|
|
32
|
+
if (this.jobs && this.jobs.length > 0) {
|
|
33
|
+
if (jobs.filter(job => job.status === 'running').length > 0) {
|
|
34
|
+
this.timeoutObject = setInterval(() => {
|
|
35
|
+
this.calculateElapsed();
|
|
36
|
+
}, 1000)
|
|
37
|
+
} else {
|
|
38
|
+
if (this.timeoutObject) {
|
|
39
|
+
clearInterval(this.timeoutObject)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}).catch(logRequestError)
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
calculateElapsed() {
|
|
48
|
+
this.jobs_running.forEach(job => {
|
|
49
|
+
const elapsed = new Date().getTime() - new Date(job.started).getTime()
|
|
50
|
+
this.jobs_running.find(j => j.id === job.id).elapsed = elapsed;
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
async updateStore() {
|
|
55
|
+
if (this.apiState === ApiState.INIT) {
|
|
56
|
+
this.apiState = ApiState.LOADING;
|
|
57
|
+
} else {
|
|
58
|
+
this.apiState = ApiState.UPDATING;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return Promise.all([
|
|
62
|
+
this.getJobs(),
|
|
63
|
+
]).then(() => {
|
|
64
|
+
this.apiState = ApiState.LOADED;
|
|
65
|
+
console.log("jobsStore updated")
|
|
66
|
+
}).catch((e) => {
|
|
67
|
+
this.apiState = ApiState.ERROR;
|
|
68
|
+
console.log("Failed to update jobsStore: ", e)
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
} from "@/api/notification-service/client";
|
|
19
|
+
import NotificationTextGenerator from "@/utils/notificationTextGenerator";
|
|
20
|
+
import i18n from '@/utils/i18n';
|
|
21
|
+
import {Resource} from "@/api/resource-management/client";
|
|
22
|
+
import {useCapabilitiesStore} from "@/stores/capabilitiesStore";
|
|
23
|
+
|
|
24
|
+
export interface NotificationStoreState {
|
|
25
|
+
apiState: number,
|
|
26
|
+
notifications: any[],
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const useNotificationStore = defineStore('notificationStore', {
|
|
30
|
+
persist: true,
|
|
31
|
+
|
|
32
|
+
state: (): NotificationStoreState => ({
|
|
33
|
+
apiState: ApiState.INIT,
|
|
34
|
+
notifications: [],
|
|
35
|
+
}),
|
|
36
|
+
|
|
37
|
+
getters: {
|
|
38
|
+
notifications_unread: (state) => {
|
|
39
|
+
return state.notifications.filter((note) => note.read === false)
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
actions: {
|
|
44
|
+
getNotifications () {
|
|
45
|
+
NotificationServiceClient.api.getNotifications().then(response => {
|
|
46
|
+
this.notifications = response.data;
|
|
47
|
+
}).catch(logRequestError);
|
|
48
|
+
},
|
|
49
|
+
addNotification (notification: Notification) {
|
|
50
|
+
this.notifications.push(notification)
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
processIncomingNotification (eventNotification: EventNotification) {
|
|
54
|
+
console.log(eventNotification)
|
|
55
|
+
|
|
56
|
+
const $toast = useToast();
|
|
57
|
+
// this.addNotification(notification)
|
|
58
|
+
|
|
59
|
+
switch (eventNotification.type) {
|
|
60
|
+
case EVENTCLASS.ResourceEvent: {
|
|
61
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
62
|
+
const resourceEventNotification = eventNotification as unknown as ResourceEventNotification;
|
|
63
|
+
console.log(resourceEventNotification)
|
|
64
|
+
switch (resourceEventNotification.eventType) {
|
|
65
|
+
case ResourceEventType.Created: {
|
|
66
|
+
resourceDevicesStore.addOrUpdateResource(resourceEventNotification.resource);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
case ResourceEventType.Updated: {
|
|
70
|
+
resourceDevicesStore.addOrUpdateResource(resourceEventNotification.resource);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case ResourceEventType.Deleted: {
|
|
74
|
+
resourceDevicesStore.deleteResource(resourceEventNotification.resource.id)
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
default: {
|
|
78
|
+
resourceDevicesStore.updateStore();
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
case EVENTCLASS.CapabilityJobEvent: {
|
|
87
|
+
const capabilityJobEventNotification = eventNotification as unknown as CapabilityJobEventNotification;
|
|
88
|
+
|
|
89
|
+
const capabilitiesStore = useCapabilitiesStore();
|
|
90
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
91
|
+
capabilitiesStore.updateStore().then(() => {
|
|
92
|
+
resourceDevicesStore.getResourceById(capabilityJobEventNotification.capabilityJob.resourceId).then(() => {
|
|
93
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
case EVENTCLASS.DiscoveryEvent: {
|
|
100
|
+
const discoveryStore = useDiscoveryStore();
|
|
101
|
+
discoveryStore.updateDiscoveryStore();
|
|
102
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
case EVENTCLASS.FirmwareUpdateJobEvent: {
|
|
107
|
+
const resourceDevicesStore = useResourceDevicesStore();
|
|
108
|
+
const firmwareUpdateJobEventNotification = eventNotification as unknown as FirmwareUpdateJobEventNotification;
|
|
109
|
+
resourceDevicesStore.getFirmwareUpdateInformationOfResource(firmwareUpdateJobEventNotification.firmwareUpdateJob.resourceId);
|
|
110
|
+
resourceDevicesStore.getFirmwareUpdateJobsOfResource(firmwareUpdateJobEventNotification.firmwareUpdateJob.resourceId)
|
|
111
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
case EVENTCLASS.ServiceInstanceEvent: {
|
|
116
|
+
const serviceInstancesStore = useServiceInstancesStore();
|
|
117
|
+
serviceInstancesStore.updateStore();
|
|
118
|
+
$toast.info(NotificationTextGenerator.generateLocalizedText(eventNotification, i18n.global))
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
default: {
|
|
123
|
+
console.debug("Unknown event notification type: ", eventNotification.type);
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
|
|
129
|
+
markAllAsRead () {
|
|
130
|
+
const unreadNotificationIds = this.notifications_unread.map((note) => note.id);
|
|
131
|
+
NotificationServiceClient.api.setReadOfNotifications(true, unreadNotificationIds)
|
|
132
|
+
.then(response => {
|
|
133
|
+
this.updateStore();
|
|
134
|
+
}).catch(logRequestError)
|
|
135
|
+
},
|
|
136
|
+
|
|
137
|
+
async updateStore () {
|
|
138
|
+
if (this.apiState === ApiState.INIT) {
|
|
139
|
+
this.apiState = ApiState.LOADING;
|
|
140
|
+
} else {
|
|
141
|
+
this.apiState = ApiState.UPDATING;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return Promise.all([
|
|
145
|
+
this.getNotifications(),
|
|
146
|
+
]).then(() => {
|
|
147
|
+
this.apiState = ApiState.LOADED;
|
|
148
|
+
console.log("notificationStore updated")
|
|
149
|
+
}).catch((e) => {
|
|
150
|
+
this.apiState = ApiState.ERROR;
|
|
151
|
+
console.log("Failed to update notificationStore: ", e)
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
@@ -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
|
+
|