@flightctl/ui-components 1.1.0-rc1 → 1.1.0-rc3
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/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.css +5 -1
- package/dist/types/imagebuilder/index.d.ts +2 -0
- package/dist/types/imagebuilder/index.d.ts.map +1 -1
- package/dist/types/imagebuilder/index.js +3 -1
- package/dist/types/imagebuilder/index.js.map +1 -1
- package/dist/types/imagebuilder/models/ApiVersion.d.ts +8 -0
- package/dist/types/imagebuilder/models/ApiVersion.d.ts.map +1 -0
- package/dist/types/imagebuilder/models/ApiVersion.js +16 -0
- package/dist/types/imagebuilder/models/ApiVersion.js.map +1 -0
- package/dist/types/imagebuilder/models/ImageBuild.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageBuild.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/ImageBuildList.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageBuildList.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/ImageExport.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageExport.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/ImageExportList.d.ts +2 -4
- package/dist/types/imagebuilder/models/ImageExportList.d.ts.map +1 -1
- package/dist/types/imagebuilder/models/Status.d.ts +28 -0
- package/dist/types/imagebuilder/models/Status.d.ts.map +1 -0
- package/dist/types/imagebuilder/models/Status.js +3 -0
- package/dist/types/imagebuilder/models/Status.js.map +1 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/models/ApiVersion.d.ts +9 -0
- package/dist/types/models/ApiVersion.d.ts.map +1 -0
- package/dist/types/models/ApiVersion.js +17 -0
- package/dist/types/models/ApiVersion.js.map +1 -0
- package/dist/types/models/ApplicationProviderBase.d.ts +12 -0
- package/dist/types/models/ApplicationProviderBase.d.ts.map +1 -0
- package/dist/types/models/ApplicationProviderBase.js +3 -0
- package/dist/types/models/ApplicationProviderBase.js.map +1 -0
- package/dist/types/models/ApplicationProviderSpec.d.ts +5 -15
- package/dist/types/models/ApplicationProviderSpec.d.ts.map +1 -1
- package/dist/types/models/ApplicationUser.d.ts +7 -0
- package/dist/types/models/ApplicationUser.d.ts.map +1 -0
- package/dist/types/models/ApplicationUser.js +3 -0
- package/dist/types/models/ApplicationUser.js.map +1 -0
- package/dist/types/models/AuthConfig.d.ts +2 -4
- package/dist/types/models/AuthConfig.d.ts.map +1 -1
- package/dist/types/models/AuthProvider.d.ts +2 -4
- package/dist/types/models/AuthProvider.d.ts.map +1 -1
- package/dist/types/models/AuthProviderList.d.ts +2 -4
- package/dist/types/models/AuthProviderList.d.ts.map +1 -1
- package/dist/types/models/CertificateSigningRequest.d.ts +2 -4
- package/dist/types/models/CertificateSigningRequest.d.ts.map +1 -1
- package/dist/types/models/CertificateSigningRequestList.d.ts +2 -4
- package/dist/types/models/CertificateSigningRequestList.d.ts.map +1 -1
- package/dist/types/models/ComposeApplication.d.ts +7 -0
- package/dist/types/models/ComposeApplication.d.ts.map +1 -0
- package/dist/types/models/ComposeApplication.js +3 -0
- package/dist/types/models/ComposeApplication.js.map +1 -0
- package/dist/types/models/ContainerApplication.d.ts +18 -0
- package/dist/types/models/ContainerApplication.d.ts.map +1 -0
- package/dist/types/models/ContainerApplication.js +3 -0
- package/dist/types/models/ContainerApplication.js.map +1 -0
- package/dist/types/models/ContainerApplicationProperties.d.ts +13 -0
- package/dist/types/models/ContainerApplicationProperties.d.ts.map +1 -0
- package/dist/types/models/ContainerApplicationProperties.js +3 -0
- package/dist/types/models/ContainerApplicationProperties.js.map +1 -0
- package/dist/types/models/Device.d.ts +2 -4
- package/dist/types/models/Device.d.ts.map +1 -1
- package/dist/types/models/DeviceList.d.ts +2 -4
- package/dist/types/models/DeviceList.d.ts.map +1 -1
- package/dist/types/models/EnrollmentRequest.d.ts +2 -4
- package/dist/types/models/EnrollmentRequest.d.ts.map +1 -1
- package/dist/types/models/EnrollmentRequestList.d.ts +2 -4
- package/dist/types/models/EnrollmentRequestList.d.ts.map +1 -1
- package/dist/types/models/Event.d.ts +2 -4
- package/dist/types/models/Event.d.ts.map +1 -1
- package/dist/types/models/Event.js.map +1 -1
- package/dist/types/models/EventList.d.ts +2 -4
- package/dist/types/models/EventList.d.ts.map +1 -1
- package/dist/types/models/Fleet.d.ts +2 -4
- package/dist/types/models/Fleet.d.ts.map +1 -1
- package/dist/types/models/FleetList.d.ts +2 -4
- package/dist/types/models/FleetList.d.ts.map +1 -1
- package/dist/types/models/HelmApplication.d.ts +20 -0
- package/dist/types/models/HelmApplication.d.ts.map +1 -0
- package/dist/types/models/HelmApplication.js +3 -0
- package/dist/types/models/HelmApplication.js.map +1 -0
- package/dist/types/models/ImageApplicationProviderSpec.d.ts +2 -22
- package/dist/types/models/ImageApplicationProviderSpec.d.ts.map +1 -1
- package/dist/types/models/InlineApplicationProviderSpec.d.ts +2 -3
- package/dist/types/models/InlineApplicationProviderSpec.d.ts.map +1 -1
- package/dist/types/models/Organization.d.ts +2 -4
- package/dist/types/models/Organization.d.ts.map +1 -1
- package/dist/types/models/OrganizationList.d.ts +2 -4
- package/dist/types/models/OrganizationList.d.ts.map +1 -1
- package/dist/types/models/QuadletApplication.d.ts +8 -0
- package/dist/types/models/QuadletApplication.d.ts.map +1 -0
- package/dist/types/models/QuadletApplication.js +3 -0
- package/dist/types/models/QuadletApplication.js.map +1 -0
- package/dist/types/models/Repository.d.ts +2 -4
- package/dist/types/models/Repository.d.ts.map +1 -1
- package/dist/types/models/RepositoryList.d.ts +2 -4
- package/dist/types/models/RepositoryList.d.ts.map +1 -1
- package/dist/types/models/ResourceSync.d.ts +2 -4
- package/dist/types/models/ResourceSync.d.ts.map +1 -1
- package/dist/types/models/ResourceSyncList.d.ts +2 -4
- package/dist/types/models/ResourceSyncList.d.ts.map +1 -1
- package/dist/types/models/Status.d.ts +2 -4
- package/dist/types/models/Status.d.ts.map +1 -1
- package/dist/types/models/TemplateVersion.d.ts +2 -4
- package/dist/types/models/TemplateVersion.d.ts.map +1 -1
- package/dist/types/models/TemplateVersionList.d.ts +2 -4
- package/dist/types/models/TemplateVersionList.d.ts.map +1 -1
- package/dist/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.js +51 -51
- package/dist/ui-components/src/components/AuthProvider/CreateAuthProvider/utils.js.map +1 -1
- package/dist/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.js +1 -1
- package/dist/ui-components/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.js +5 -4
- package/dist/ui-components/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/TerminalTab.js +5 -1
- package/dist/ui-components/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +3 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +310 -363
- package/dist/ui-components/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js +18 -19
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.js +5 -4
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js +2 -2
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +3 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js +20 -23
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationIntegritySettings.js +3 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationIntegritySettings.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +25 -45
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.d.ts +8 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.d.ts.map +1 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.js +37 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.js.map +1 -0
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts +1 -3
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js +5 -8
- package/dist/ui-components/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.js.map +1 -1
- package/dist/ui-components/src/components/Device/EditDeviceWizard/utils.d.ts +18 -18
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.d.ts +4 -2
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.d.ts.map +1 -1
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.js +2 -2
- package/dist/ui-components/src/components/ErrorAlert/ErrorAlert.js.map +1 -1
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.d.ts +1 -1
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.js +3 -3
- package/dist/ui-components/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/ui-components/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +3 -1
- package/dist/ui-components/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.d.ts +7 -0
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.d.ts.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.js +40 -0
- package/dist/ui-components/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.js.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.d.ts +8 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.d.ts.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.js +37 -0
- package/dist/ui-components/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.js.map +1 -0
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.js +4 -3
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.js +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.js +13 -10
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.js +4 -2
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.js +7 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/types.d.ts +3 -5
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/types.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.d.ts +3 -2
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.js +139 -34
- package/dist/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/utils.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.js +23 -12
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.js +115 -39
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.d.ts +1 -0
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.js +17 -18
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.d.ts +5 -2
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.js +22 -12
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildRow.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildsPage.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildsPage.js +17 -8
- package/dist/ui-components/src/components/ImageBuilds/ImageBuildsPage.js.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.d.ts +10 -9
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.d.ts.map +1 -1
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.js +122 -26
- package/dist/ui-components/src/components/ImageBuilds/ImageExportCards.js.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts +2 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.js +10 -4
- package/dist/ui-components/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/ui-components/src/components/Repository/CreateRepository/utils.js +3 -4
- package/dist/ui-components/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/ui-components/src/components/form/RepositorySelect.d.ts.map +1 -1
- package/dist/ui-components/src/components/form/RepositorySelect.js +1 -1
- package/dist/ui-components/src/components/form/RepositorySelect.js.map +1 -1
- package/dist/ui-components/src/components/form/UploadField.d.ts.map +1 -1
- package/dist/ui-components/src/components/form/UploadField.js +25 -16
- package/dist/ui-components/src/components/form/UploadField.js.map +1 -1
- package/dist/ui-components/src/components/form/validations.d.ts +25 -18
- package/dist/ui-components/src/components/form/validations.d.ts.map +1 -1
- package/dist/ui-components/src/components/form/validations.js +79 -33
- package/dist/ui-components/src/components/form/validations.js.map +1 -1
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.d.ts +2 -1
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.d.ts.map +1 -1
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js +2 -2
- package/dist/ui-components/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.js.map +1 -1
- package/dist/ui-components/src/constants.d.ts +5 -6
- package/dist/ui-components/src/constants.d.ts.map +1 -1
- package/dist/ui-components/src/constants.js +19 -11
- package/dist/ui-components/src/constants.js.map +1 -1
- package/dist/ui-components/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/ui-components/src/hooks/useWebSocket.js +25 -4
- package/dist/ui-components/src/hooks/useWebSocket.js.map +1 -1
- package/dist/ui-components/src/types/deviceSpec.d.ts +44 -76
- package/dist/ui-components/src/types/deviceSpec.d.ts.map +1 -1
- package/dist/ui-components/src/types/deviceSpec.js +13 -26
- package/dist/ui-components/src/types/deviceSpec.js.map +1 -1
- package/dist/ui-components/src/types/extraTypes.d.ts +1 -7
- package/dist/ui-components/src/types/extraTypes.d.ts.map +1 -1
- package/dist/ui-components/src/types/extraTypes.js.map +1 -1
- package/dist/ui-components/src/types/rbac.d.ts +7 -1
- package/dist/ui-components/src/types/rbac.d.ts.map +1 -1
- package/dist/ui-components/src/types/rbac.js +6 -0
- package/dist/ui-components/src/types/rbac.js.map +1 -1
- package/dist/ui-components/src/utils/imageBuilds.d.ts +1 -0
- package/dist/ui-components/src/utils/imageBuilds.d.ts.map +1 -1
- package/dist/ui-components/src/utils/imageBuilds.js +20 -29
- package/dist/ui-components/src/utils/imageBuilds.js.map +1 -1
- package/dist/ui-components/src/utils/search.d.ts +2 -1
- package/dist/ui-components/src/utils/search.d.ts.map +1 -1
- package/dist/ui-components/src/utils/search.js +2 -2
- package/dist/ui-components/src/utils/search.js.map +1 -1
- package/package.json +2 -2
- package/src/components/AuthProvider/CreateAuthProvider/utils.ts +2 -2
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +2 -2
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +10 -4
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +9 -1
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +361 -425
- package/src/components/Device/EditDeviceWizard/steps/ApplicationContainerForm.tsx +19 -29
- package/src/components/Device/EditDeviceWizard/steps/ApplicationHelmForm.tsx +5 -13
- package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +2 -16
- package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +8 -7
- package/src/components/Device/EditDeviceWizard/steps/ApplicationIntegritySettings.tsx +5 -5
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +29 -101
- package/src/components/Device/EditDeviceWizard/steps/ApplicationVariablesForm.tsx +87 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationVolumeForm.tsx +5 -10
- package/src/components/ErrorAlert/ErrorAlert.tsx +13 -3
- package/src/components/Fleet/CreateFleet/utils.ts +4 -5
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +11 -8
- package/src/components/ImageBuilds/CancelImageBuildModal/CancelImageBuildModal.tsx +81 -0
- package/src/components/ImageBuilds/ConfirmImageExportModal/ConfirmImageExportModal.tsx +61 -0
- package/src/components/ImageBuilds/CreateImageBuildWizard/CreateImageBuildWizard.tsx +8 -3
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.tsx +1 -1
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/RegistrationStep.tsx +18 -10
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/ReviewStep.tsx +5 -1
- package/src/components/ImageBuilds/CreateImageBuildWizard/steps/SourceImageStep.tsx +13 -1
- package/src/components/ImageBuilds/CreateImageBuildWizard/types.ts +3 -6
- package/src/components/ImageBuilds/CreateImageBuildWizard/utils.ts +161 -37
- package/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.tsx +36 -17
- package/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.tsx +131 -44
- package/src/components/ImageBuilds/ImageBuildDetails/ImageBuildLogsTab.tsx +22 -26
- package/src/components/ImageBuilds/ImageBuildRow.tsx +41 -20
- package/src/components/ImageBuilds/ImageBuildsPage.tsx +34 -15
- package/src/components/ImageBuilds/ImageExportCards.tsx +198 -80
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.css +5 -1
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +14 -4
- package/src/components/Repository/CreateRepository/utils.ts +4 -4
- package/src/components/form/RepositorySelect.tsx +1 -0
- package/src/components/form/UploadField.tsx +29 -30
- package/src/components/form/validations.ts +156 -106
- package/src/components/modals/CreateRepositoryModal/CreateRepositoryModal.tsx +3 -1
- package/src/constants.ts +19 -6
- package/src/hooks/useWebSocket.ts +25 -3
- package/src/types/deviceSpec.ts +68 -108
- package/src/types/extraTypes.ts +2 -12
- package/src/types/rbac.ts +6 -0
- package/src/utils/imageBuilds.ts +22 -32
- package/src/utils/search.ts +2 -2
|
@@ -1,24 +1,125 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getImageExportResources = exports.getImageExportResource = exports.getImageBuildResource = exports.getInitialValues = exports.toImageBuildWithExports = exports.getValidationSchema = void 0;
|
|
3
|
+
exports.getImageExportResources = exports.getImageExportResource = exports.getImageBuildResource = exports.getInitialValues = exports.toImageBuildWithExports = exports.getValidationSchema = exports.PUBLIC_KEY_MAX_LENGTH = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const Yup = tslib_1.__importStar(require("yup"));
|
|
6
6
|
const imagebuilder_1 = require("@flightctl/types/imagebuilder");
|
|
7
|
-
const
|
|
7
|
+
const validations_1 = require("../../form/validations");
|
|
8
|
+
exports.PUBLIC_KEY_MAX_LENGTH = 8 * 1024; // (8 KB)
|
|
9
|
+
const VALID_SSH_PUBLIC_KEY_TYPES = [
|
|
10
|
+
'ssh-rsa',
|
|
11
|
+
'ssh-ed25519',
|
|
12
|
+
'ecdsa-sha2-nistp256',
|
|
13
|
+
'ecdsa-sha2-nistp384',
|
|
14
|
+
'ecdsa-sha2-nistp521',
|
|
15
|
+
'ssh-dss',
|
|
16
|
+
];
|
|
17
|
+
const SSH_PUBLIC_KEY_BASE64_DATA_REGEX = /^(?=.{50,}$)[A-Za-z0-9+/]+=*$/;
|
|
18
|
+
// Characters that could be used for injection attacks
|
|
19
|
+
const MALICIOUS_PUBLIC_KEY_CHARACTERS = /[;|&`()[\]{}<>"'\\\t$]/;
|
|
20
|
+
const OCI_IMAGE_NAME_MAX_LENGTH = 255;
|
|
21
|
+
const OCI_IMAGE_NAME_REGEX = /^[a-z0-9]+(?:[._-]+[a-z0-9]+)*(?:\/[a-z0-9]+(?:[._-]+[a-z0-9]+)*)*$/;
|
|
22
|
+
const OCI_IMAGE_NAME_VALID_CHARS = /^[a-z0-9._/-]+$/;
|
|
23
|
+
const OCI_IMAGE_TAG_MAX_LENGTH = 128;
|
|
24
|
+
const OCI_IMAGE_TAG_REGEX = /^[\w][\w.-]{0,127}$/;
|
|
25
|
+
const OCI_IMAGE_TAG_VALID_CHARS = /^[\w.-]+$/;
|
|
26
|
+
/** Returns an error message for image name: invalid chars, or invalid format. */
|
|
27
|
+
const getImageNameValidationError = (value, t) => {
|
|
28
|
+
if (!value)
|
|
29
|
+
return undefined;
|
|
30
|
+
if (value.length > OCI_IMAGE_NAME_MAX_LENGTH) {
|
|
31
|
+
return t('Image name must not exceed {{max}} characters.', { max: OCI_IMAGE_NAME_MAX_LENGTH });
|
|
32
|
+
}
|
|
33
|
+
if (!OCI_IMAGE_NAME_VALID_CHARS.test(value)) {
|
|
34
|
+
return t('Image name may only contain alphanumeric characters, dots, underscores, hyphens, and slashes.');
|
|
35
|
+
}
|
|
36
|
+
if (!OCI_IMAGE_NAME_REGEX.test(value)) {
|
|
37
|
+
return t('Only alphanumeric characters are allowed at the start and end of each path component.');
|
|
38
|
+
}
|
|
39
|
+
return undefined;
|
|
40
|
+
};
|
|
41
|
+
const getImageTagValidationError = (value, t) => {
|
|
42
|
+
if (!value)
|
|
43
|
+
return undefined;
|
|
44
|
+
if (value.length > OCI_IMAGE_TAG_MAX_LENGTH) {
|
|
45
|
+
return t('Image tag must not exceed {{max}} characters.', { max: OCI_IMAGE_TAG_MAX_LENGTH });
|
|
46
|
+
}
|
|
47
|
+
if (!OCI_IMAGE_TAG_VALID_CHARS.test(value)) {
|
|
48
|
+
return t('Image tag may only contain letters, numbers, underscores, dots, and hyphens.');
|
|
49
|
+
}
|
|
50
|
+
if (!OCI_IMAGE_TAG_REGEX.test(value)) {
|
|
51
|
+
return t('Image tag must start with a letter, number, or underscore.');
|
|
52
|
+
}
|
|
53
|
+
return undefined;
|
|
54
|
+
};
|
|
55
|
+
const getPublicKeyValidationError = (publicKey, t) => {
|
|
56
|
+
if (publicKey.length > exports.PUBLIC_KEY_MAX_LENGTH) {
|
|
57
|
+
return t('SSH public key is too long');
|
|
58
|
+
}
|
|
59
|
+
// Allow newlines only at the end
|
|
60
|
+
const trimmedKey = publicKey.replace(/[\r\n]+$/g, '');
|
|
61
|
+
if (/[\r\n]/.test(trimmedKey)) {
|
|
62
|
+
return t('A single public key can be provided only');
|
|
63
|
+
}
|
|
64
|
+
if (MALICIOUS_PUBLIC_KEY_CHARACTERS.test(trimmedKey)) {
|
|
65
|
+
return t('Invalid SSH public key');
|
|
66
|
+
}
|
|
67
|
+
const parts = trimmedKey.trim().split(/\s+/);
|
|
68
|
+
if (parts.length < 2) {
|
|
69
|
+
return t('Invalid SSH public key format. Expected: "[TYPE] key [comment]"');
|
|
70
|
+
}
|
|
71
|
+
const keyType = parts[0];
|
|
72
|
+
if (!VALID_SSH_PUBLIC_KEY_TYPES.includes(keyType)) {
|
|
73
|
+
return t('Unsupported SSH public key type. Supported types: {{supportedTypes}}', {
|
|
74
|
+
supportedTypes: VALID_SSH_PUBLIC_KEY_TYPES.join(', '),
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const base64Data = parts[1];
|
|
78
|
+
if (!SSH_PUBLIC_KEY_BASE64_DATA_REGEX.test(base64Data)) {
|
|
79
|
+
return t('Invalid SSH public key data');
|
|
80
|
+
}
|
|
81
|
+
return undefined;
|
|
82
|
+
};
|
|
83
|
+
const validImageBuildImageFields = (t) => Yup.object({
|
|
84
|
+
repository: Yup.string().required(t('Repository is required')),
|
|
85
|
+
imageName: Yup.string()
|
|
86
|
+
.required(t('Image name is required'))
|
|
87
|
+
.test('oci-image-name', function (value) {
|
|
88
|
+
if (!value)
|
|
89
|
+
return true;
|
|
90
|
+
const error = getImageNameValidationError(value, t);
|
|
91
|
+
return error ? this.createError({ message: error }) : true;
|
|
92
|
+
}),
|
|
93
|
+
imageTag: Yup.string()
|
|
94
|
+
.required(t('Image tag is required'))
|
|
95
|
+
.test('oci-image-tag', function (value) {
|
|
96
|
+
if (!value)
|
|
97
|
+
return true;
|
|
98
|
+
const error = getImageTagValidationError(value, t);
|
|
99
|
+
return error ? this.createError({ message: error }) : true;
|
|
100
|
+
}),
|
|
101
|
+
});
|
|
8
102
|
const getValidationSchema = (t) => {
|
|
9
|
-
return Yup.object({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
imageTag: Yup.string().required(t('Image tag is required')),
|
|
14
|
-
}).required(t('Source image is required')),
|
|
15
|
-
destination: Yup.object({
|
|
16
|
-
repository: Yup.string().required(t('Target repository is required')),
|
|
17
|
-
imageName: Yup.string().required(t('Image name is required')),
|
|
18
|
-
imageTag: Yup.string().required(t('Image tag is required')),
|
|
19
|
-
}).required(t('Target image is required')),
|
|
103
|
+
return Yup.lazy((values) => Yup.object({
|
|
104
|
+
buildName: (0, validations_1.validImageBuildName)(t),
|
|
105
|
+
source: validImageBuildImageFields(t).required(t('Source image is required')),
|
|
106
|
+
destination: validImageBuildImageFields(t).required(t('Target image is required')),
|
|
20
107
|
bindingType: Yup.string().required(t('Binding type is required')),
|
|
21
|
-
|
|
108
|
+
userConfiguration: Yup.object({
|
|
109
|
+
username: values.remoteAccessEnabled ? Yup.string().required(t('Username is required')) : Yup.string(),
|
|
110
|
+
publickey: values.remoteAccessEnabled
|
|
111
|
+
? Yup.string()
|
|
112
|
+
.required(t('SSH public key is required'))
|
|
113
|
+
.test('flightctl-ssh-public-key', function (publicKey) {
|
|
114
|
+
if (!publicKey) {
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
const error = getPublicKeyValidationError(publicKey, t);
|
|
118
|
+
return error ? this.createError({ message: error }) : true;
|
|
119
|
+
})
|
|
120
|
+
: Yup.string(),
|
|
121
|
+
}),
|
|
122
|
+
}));
|
|
22
123
|
};
|
|
23
124
|
exports.getValidationSchema = getValidationSchema;
|
|
24
125
|
// Returns an array with one item per format (VMDK, QCOW2, ISO), where each item is either
|
|
@@ -64,27 +165,32 @@ const toImageBuildWithExports = (imageBuild) => {
|
|
|
64
165
|
return Object.assign(Object.assign({}, imageBuildWithoutExports), { imageExports: latestExports, exportsCount: allExports.length });
|
|
65
166
|
};
|
|
66
167
|
exports.toImageBuildWithExports = toImageBuildWithExports;
|
|
67
|
-
const
|
|
168
|
+
const getExistingImageData = (image, repoIds) => {
|
|
169
|
+
if (repoIds.has(image.repository)) {
|
|
170
|
+
return image;
|
|
171
|
+
}
|
|
172
|
+
// When copying the image build, drop the reference to the repository if it doesn't exist anymore
|
|
173
|
+
return Object.assign(Object.assign({}, image), { repository: '' });
|
|
174
|
+
};
|
|
175
|
+
const getInitialValues = (imageBuild, repoIds) => {
|
|
68
176
|
if (imageBuild) {
|
|
69
177
|
const exportFormats = imageBuild.imageExports
|
|
70
178
|
.filter((ie) => ie !== undefined)
|
|
71
179
|
.map((imageExport) => imageExport.spec.format);
|
|
72
180
|
const userConfig = imageBuild.spec.userConfiguration;
|
|
73
|
-
const userConfiguration = userConfig
|
|
74
|
-
? Object.assign(Object.assign({}, userConfig), { enabled: !!(userConfig.username || userConfig.publickey) }) : {
|
|
75
|
-
username: '',
|
|
76
|
-
publickey: '',
|
|
77
|
-
enabled: false,
|
|
78
|
-
};
|
|
79
181
|
return {
|
|
80
|
-
|
|
81
|
-
|
|
182
|
+
// Since we're always creating new imageBuilds, we don't copy the current name
|
|
183
|
+
buildName: '',
|
|
184
|
+
source: getExistingImageData(imageBuild.spec.source, repoIds),
|
|
185
|
+
destination: getExistingImageData(imageBuild.spec.destination, repoIds),
|
|
82
186
|
bindingType: imageBuild.spec.binding.type,
|
|
83
187
|
exportFormats: exportFormats || [],
|
|
84
|
-
|
|
188
|
+
remoteAccessEnabled: !!((userConfig === null || userConfig === void 0 ? void 0 : userConfig.username) || (userConfig === null || userConfig === void 0 ? void 0 : userConfig.publickey)),
|
|
189
|
+
userConfiguration: userConfig || { username: '', publickey: '' },
|
|
85
190
|
};
|
|
86
191
|
}
|
|
87
192
|
return {
|
|
193
|
+
buildName: '',
|
|
88
194
|
source: {
|
|
89
195
|
repository: '',
|
|
90
196
|
imageName: '',
|
|
@@ -97,10 +203,10 @@ const getInitialValues = (imageBuild) => {
|
|
|
97
203
|
},
|
|
98
204
|
bindingType: imagebuilder_1.BindingType.BindingTypeEarly,
|
|
99
205
|
exportFormats: [],
|
|
206
|
+
remoteAccessEnabled: false,
|
|
100
207
|
userConfiguration: {
|
|
101
208
|
username: '',
|
|
102
209
|
publickey: '',
|
|
103
|
-
enabled: false,
|
|
104
210
|
},
|
|
105
211
|
};
|
|
106
212
|
};
|
|
@@ -109,13 +215,12 @@ exports.getInitialValues = getInitialValues;
|
|
|
109
215
|
const getHash = () => Math.floor(Math.random() * 0x1000000)
|
|
110
216
|
.toString(16)
|
|
111
217
|
.padStart(6, '0');
|
|
112
|
-
const generateBuildName = () => `imagebuild-${getHash()}`;
|
|
113
218
|
const generateExportName = (imageBuildName, format) => {
|
|
114
|
-
|
|
219
|
+
const formatKey = format === imagebuilder_1.ExportFormatType.ExportFormatTypeQCOW2DiskContainer ? 'qcow2-disk' : format;
|
|
220
|
+
return `${imageBuildName}-${formatKey}-${getHash()}`;
|
|
115
221
|
};
|
|
116
222
|
const getImageBuildResource = (values) => {
|
|
117
|
-
|
|
118
|
-
const name = generateBuildName();
|
|
223
|
+
const name = values.buildName;
|
|
119
224
|
const spec = {
|
|
120
225
|
source: values.source,
|
|
121
226
|
destination: values.destination,
|
|
@@ -124,16 +229,16 @@ const getImageBuildResource = (values) => {
|
|
|
124
229
|
},
|
|
125
230
|
};
|
|
126
231
|
// Allow the user to uncheck the toggle without having cleared the fields
|
|
127
|
-
const username =
|
|
128
|
-
const publickey =
|
|
129
|
-
if (
|
|
232
|
+
const username = values.userConfiguration.username || '';
|
|
233
|
+
const publickey = values.userConfiguration.publickey || '';
|
|
234
|
+
if (values.remoteAccessEnabled && username && publickey) {
|
|
130
235
|
spec.userConfiguration = {
|
|
131
236
|
username,
|
|
132
237
|
publickey,
|
|
133
238
|
};
|
|
134
239
|
}
|
|
135
240
|
return {
|
|
136
|
-
apiVersion:
|
|
241
|
+
apiVersion: imagebuilder_1.ApiVersion.ApiVersionV1alpha1,
|
|
137
242
|
kind: imagebuilder_1.ResourceKind.IMAGE_BUILD,
|
|
138
243
|
metadata: {
|
|
139
244
|
name,
|
|
@@ -145,7 +250,7 @@ exports.getImageBuildResource = getImageBuildResource;
|
|
|
145
250
|
const getImageExportResource = (imageBuildName, format) => {
|
|
146
251
|
const exportName = generateExportName(imageBuildName, format);
|
|
147
252
|
return {
|
|
148
|
-
apiVersion:
|
|
253
|
+
apiVersion: imagebuilder_1.ApiVersion.ApiVersionV1alpha1,
|
|
149
254
|
kind: imagebuilder_1.ResourceKind.IMAGE_EXPORT,
|
|
150
255
|
metadata: {
|
|
151
256
|
name: exportName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/CreateImageBuildWizard/utils.ts"],"names":[],"mappings":";;;;AACA,iDAA2B;AAE3B,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/CreateImageBuildWizard/utils.ts"],"names":[],"mappings":";;;;AACA,iDAA2B;AAE3B,gEAUuC;AACvC,wDAA6D;AAIhD,QAAA,qBAAqB,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,SAAS;AACxD,M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;QACL,UAAU,EAAE,yBAAU,CAAC,kBAAkB;QACzC,IAAI,EAAE,2BAAY,CAAC,YAAY;QAC/B,QAAQ,EAAE;YACR,IAAI,EAAE,UAAU;SACjB;QACD,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,IAAI,EAAE,YAAY;gBAClB,aAAa,EAAE,cAAc;aAC9B;YACD,MAAM;SACP;KACF,CAAC;AACJ,CAAC,CAAC;AAjBW,QAAA,sBAAsB,0BAiBjC;AAEK,MAAM,uBAAuB,GAAG,CAAC,MAA4B,EAAE,cAAsB,EAAiB,EAAE;IAC7G,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/D,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAA,8BAAsB,EAAC,cAAc,EAAE,MAAM,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC;AANW,QAAA,uBAAuB,2BAMlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBuildDetailsPage.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageBuildDetailsPage.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA+H/B,QAAA,MAAM,gCAAgC,yBAUrC,CAAC;AAEF,eAAe,gCAAgC,CAAC"}
|
package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.js
CHANGED
|
@@ -21,9 +21,13 @@ const ImageBuildYaml_1 = tslib_1.__importDefault(require("./ImageBuildYaml"));
|
|
|
21
21
|
const ImageBuildDetailsTab_1 = tslib_1.__importDefault(require("./ImageBuildDetailsTab"));
|
|
22
22
|
const ImageBuildExportsGallery_1 = tslib_1.__importDefault(require("./ImageBuildExportsGallery"));
|
|
23
23
|
const ImageBuildLogsTab_1 = tslib_1.__importDefault(require("./ImageBuildLogsTab"));
|
|
24
|
+
const CancelImageBuildModal_1 = tslib_1.__importDefault(require("../CancelImageBuildModal/CancelImageBuildModal"));
|
|
24
25
|
const imageBuildDetailsPermissions = [
|
|
25
26
|
{ kind: rbac_1.RESOURCE.IMAGE_BUILD, verb: rbac_1.VERB.CREATE },
|
|
27
|
+
{ kind: rbac_1.RESOURCE.IMAGE_BUILD_CANCEL, verb: rbac_1.VERB.CREATE },
|
|
26
28
|
{ kind: rbac_1.RESOURCE.IMAGE_BUILD, verb: rbac_1.VERB.DELETE },
|
|
29
|
+
// Users that can view logs for imagebuilds also can view logs for imageexports
|
|
30
|
+
{ kind: rbac_1.RESOURCE.IMAGE_BUILD_LOG, verb: rbac_1.VERB.GET },
|
|
27
31
|
];
|
|
28
32
|
const ImageBuildDetailsPageContent = () => {
|
|
29
33
|
const { t } = (0, useTranslation_1.useTranslation)();
|
|
@@ -31,42 +35,49 @@ const ImageBuildDetailsPageContent = () => {
|
|
|
31
35
|
const { router: { useParams, Routes, Route, Navigate }, } = (0, useAppContext_1.useAppContext)();
|
|
32
36
|
const { imageBuildId } = useParams();
|
|
33
37
|
const [imageBuild, isLoading, error, refetch] = (0, useImageBuilds_1.useImageBuild)(imageBuildId);
|
|
34
|
-
const [isDeleteModalOpen, setIsDeleteModalOpen] = React.useState();
|
|
35
38
|
const { checkPermissions } = (0, PermissionsContext_1.usePermissionsContext)();
|
|
36
|
-
const [canCreate, canDelete] = checkPermissions(imageBuildDetailsPermissions);
|
|
37
39
|
const buildReason = imageBuild ? (0, imageBuilds_1.getImageBuildStatusReason)(imageBuild) : undefined;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
+
const [canCreate, hasCancelPermission, canDelete, canViewLogs] = checkPermissions(imageBuildDetailsPermissions);
|
|
41
|
+
const canCancel = hasCancelPermission && buildReason && (0, imageBuilds_1.isImageBuildCancelable)(buildReason);
|
|
42
|
+
const tabKeys = React.useMemo(() => (canViewLogs ? ['details', 'exports', 'yaml', 'logs'] : ['details', 'exports', 'yaml']), [canViewLogs]);
|
|
43
|
+
const [isDeleteModalOpen, setIsDeleteModalOpen] = React.useState();
|
|
44
|
+
const [isCancelModalOpen, setIsCancelModalOpen] = React.useState();
|
|
45
|
+
return (React.createElement(DetailsPage_1.default, { loading: isLoading, error: error, id: imageBuildId, resourceLink: useNavigate_1.ROUTE.IMAGE_BUILDS, resourceType: "Image builds", resourceTypeLabel: t('Image builds'), nav: React.createElement(TabsNav_1.default, { "aria-label": "Image build details tabs", tabKeys: tabKeys },
|
|
46
|
+
React.createElement(react_core_1.Tab, { eventKey: "details", title: t('Base image') }),
|
|
40
47
|
React.createElement(react_core_1.Tab, { eventKey: "exports", title: t('Export images') }),
|
|
41
48
|
React.createElement(react_core_1.Tab, { eventKey: "yaml", title: t('YAML') }),
|
|
42
|
-
React.createElement(react_core_1.Tab, { eventKey: "logs", title: t('Logs') })), actions: (canCreate || canDelete) && (React.createElement(DetailsPageActions_1.default, null,
|
|
49
|
+
canViewLogs && React.createElement(react_core_1.Tab, { eventKey: "logs", title: t('Logs') })), actions: (canCreate || canDelete) && (React.createElement(DetailsPageActions_1.default, null,
|
|
43
50
|
React.createElement(react_core_1.DropdownList, null,
|
|
44
51
|
canCreate && (React.createElement(react_core_1.DropdownItem, { onClick: () => navigate({ route: useNavigate_1.ROUTE.IMAGE_BUILD_EDIT, postfix: imageBuildId }) }, buildReason === imagebuilder_1.ImageBuildConditionReason.ImageBuildConditionReasonFailed
|
|
45
52
|
? t('Retry')
|
|
46
53
|
: t('Duplicate'))),
|
|
47
|
-
|
|
54
|
+
canCancel && (React.createElement(react_core_1.DropdownItem, { onClick: () => setIsCancelModalOpen(true) }, t('Cancel image build'))),
|
|
55
|
+
canDelete && !canCancel && (React.createElement(react_core_1.DropdownItem, { onClick: () => setIsDeleteModalOpen(true) }, t('Delete image build')))))) }, imageBuild && (React.createElement(React.Fragment, null,
|
|
48
56
|
React.createElement(Routes, null,
|
|
49
57
|
React.createElement(Route, { index: true, element: React.createElement(Navigate, { to: "details", replace: true }) }),
|
|
50
58
|
React.createElement(Route, { path: "details", element: React.createElement(ImageBuildDetailsTab_1.default, { imageBuild: imageBuild }) }),
|
|
51
59
|
React.createElement(Route, { path: "exports", element: React.createElement(ImageBuildExportsGallery_1.default, { imageBuild: imageBuild, refetch: refetch }) }),
|
|
52
60
|
React.createElement(Route, { path: "yaml", element: React.createElement(ImageBuildYaml_1.default, { imageBuild: imageBuild, refetch: refetch }) }),
|
|
53
|
-
React.createElement(Route, { path: "logs", element: React.createElement(ImageBuildLogsTab_1.default, { imageBuild: imageBuild }) })),
|
|
61
|
+
canViewLogs && React.createElement(Route, { path: "logs", element: React.createElement(ImageBuildLogsTab_1.default, { imageBuild: imageBuild }) })),
|
|
54
62
|
isDeleteModalOpen && (React.createElement(DeleteImageBuildModal_1.default, { imageBuildId: imageBuildId, onClose: (hasDeleted) => {
|
|
55
63
|
if (hasDeleted) {
|
|
56
64
|
navigate(useNavigate_1.ROUTE.IMAGE_BUILDS);
|
|
57
65
|
}
|
|
58
66
|
setIsDeleteModalOpen(false);
|
|
67
|
+
} })),
|
|
68
|
+
isCancelModalOpen && (React.createElement(CancelImageBuildModal_1.default, { imageBuildId: imageBuildId, onClose: (confirmed) => {
|
|
69
|
+
setIsCancelModalOpen(false);
|
|
70
|
+
if (confirmed) {
|
|
71
|
+
refetch();
|
|
72
|
+
}
|
|
59
73
|
} }))))));
|
|
60
74
|
};
|
|
61
|
-
const ImageBuildDetailsPage = () => {
|
|
62
|
-
return (React.createElement(OciRegistriesContext_1.OciRegistriesContextProvider, null,
|
|
63
|
-
React.createElement(ImageBuildDetailsPageContent, null)));
|
|
64
|
-
};
|
|
65
75
|
const ImageBuildDetailsWithPermissions = () => {
|
|
66
76
|
const { checkPermissions, loading } = (0, PermissionsContext_1.usePermissionsContext)();
|
|
67
77
|
const [allowed] = checkPermissions([{ kind: rbac_1.RESOURCE.IMAGE_BUILD, verb: rbac_1.VERB.GET }]);
|
|
68
78
|
return (React.createElement(PageWithPermissions_1.default, { allowed: allowed, loading: loading },
|
|
69
|
-
React.createElement(
|
|
79
|
+
React.createElement(OciRegistriesContext_1.OciRegistriesContextProvider, null,
|
|
80
|
+
React.createElement(ImageBuildDetailsPageContent, null))));
|
|
70
81
|
};
|
|
71
82
|
exports.default = ImageBuildDetailsWithPermissions;
|
|
72
83
|
//# sourceMappingURL=ImageBuildDetailsPage.js.map
|
package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBuildDetailsPage.js","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,uDAAyE;AAEzE,gEAA0E;AAC1E,8CAAqD;AACrD,mGAAmE;AACnE,kEAA+D;AAC/D,4DAAgE;AAChE,wEAAwE;AACxE,gEAA6D;AAC7D,
|
|
1
|
+
{"version":3,"file":"ImageBuildDetailsPage.js","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/ImageBuildDetails/ImageBuildDetailsPage.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,uDAAyE;AAEzE,gEAA0E;AAC1E,8CAAqD;AACrD,mGAAmE;AACnE,kEAA+D;AAC/D,4DAAgE;AAChE,wEAAwE;AACxE,gEAA6D;AAC7D,4DAA+F;AAC/F,wFAAwD;AACxD,sGAAsE;AACtE,mHAAmF;AACnF,sDAAkD;AAClD,4EAA4C;AAC5C,kEAAuE;AACvE,8EAA8C;AAC9C,0FAA0D;AAC1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AE,oBAAC,2BAAiB,IAAC,UAAU,EAAE,UAAU,GAAI,GAAI,CACtF;QACR,iBAAiB,IAAI,CACpB,oBAAC,+BAAqB,IACpB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,CAAC,UAAoB,EAAE,EAAE;gBAChC,IAAI,UAAU,EAAE,CAAC;oBACf,QAAQ,CAAC,mBAAK,CAAC,YAAY,CAAC,CAAC;gBAC/B,CAAC;gBACD,oBAAoB,CAAC,KAAK,CAAC,CAAC;YAC9B,CAAC,GACD,CACH;QACA,iBAAiB,IAAI,CACpB,oBAAC,+BAAqB,IACpB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,CAAC,SAAS,EAAE,EAAE;gBACrB,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBAC5B,IAAI,SAAS,EAAE,CAAC;oBACd,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC,GACD,CACH,CACA,CACJ,CACW,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,gCAAgC,GAAG,GAAG,EAAE;IAC5C,MAAM,EAAE,gBAAgB,EAAE,OAAO,EAAE,GAAG,IAAA,0CAAqB,GAAE,CAAC;IAC9D,MAAM,CAAC,OAAO,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,eAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,WAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IACrF,OAAO,CACL,oBAAC,6BAAmB,IAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;QACrD,oBAAC,mDAA4B;YAC3B,oBAAC,4BAA4B,OAAG,CACH,CACX,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gCAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBuildExportsGallery.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"ImageBuildExportsGallery.d.ts","sourceRoot":"","sources":["../../../../../../src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAclE,KAAK,6BAA6B,GAAG;IACnC,UAAU,EAAE,qBAAqB,CAAC;IAClC,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAyBF,QAAA,MAAM,wBAAwB,4BAA6B,6BAA6B,sBAsKvF,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
package/dist/ui-components/src/components/ImageBuilds/ImageBuildDetails/ImageBuildExportsGallery.js
CHANGED
|
@@ -4,16 +4,23 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const React = tslib_1.__importStar(require("react"));
|
|
5
5
|
const react_core_1 = require("@patternfly/react-core");
|
|
6
6
|
const file_saver_1 = require("file-saver");
|
|
7
|
+
const imagebuilder_1 = require("@flightctl/types/imagebuilder");
|
|
8
|
+
const imageBuilds_1 = require("../../../utils/imageBuilds");
|
|
9
|
+
const rbac_1 = require("../../../types/rbac");
|
|
7
10
|
const useFetch_1 = require("../../../hooks/useFetch");
|
|
11
|
+
const PermissionsContext_1 = require("../../common/PermissionsContext");
|
|
8
12
|
const error_1 = require("../../../utils/error");
|
|
9
13
|
const utils_1 = require("../CreateImageBuildWizard/utils");
|
|
10
14
|
const ImageExportCards_1 = require("../ImageExportCards");
|
|
11
15
|
const OciRegistriesContext_1 = require("../OciRegistriesContext");
|
|
12
16
|
const time_1 = require("../../../utils/time");
|
|
13
|
-
const
|
|
17
|
+
const imageBuilds_2 = require("../../../utils/imageBuilds");
|
|
18
|
+
const useNavigate_1 = require("../../../hooks/useNavigate");
|
|
19
|
+
const ImageBuildLogsTab_1 = require("./ImageBuildLogsTab");
|
|
14
20
|
const REFRESH_IMAGE_BUILD_DELAY = 450;
|
|
15
21
|
// Delay to keep loading state while browser processes redirect
|
|
16
22
|
const DOWNLOAD_REDIRECT_DELAY = 1000;
|
|
23
|
+
const createExportAliases = ['retry', 'rebuild', 'createExport'];
|
|
17
24
|
const createDownloadLink = (url) => {
|
|
18
25
|
const link = document.createElement('a');
|
|
19
26
|
link.href = url;
|
|
@@ -22,16 +29,53 @@ const createDownloadLink = (url) => {
|
|
|
22
29
|
link.click();
|
|
23
30
|
document.body.removeChild(link);
|
|
24
31
|
};
|
|
32
|
+
const imageBuildExportsPermissions = [
|
|
33
|
+
{ kind: rbac_1.RESOURCE.IMAGE_EXPORT, verb: rbac_1.VERB.CREATE },
|
|
34
|
+
{ kind: rbac_1.RESOURCE.IMAGE_EXPORT, verb: rbac_1.VERB.DELETE },
|
|
35
|
+
{ kind: rbac_1.RESOURCE.IMAGE_EXPORT_LOG, verb: rbac_1.VERB.GET },
|
|
36
|
+
{ kind: rbac_1.RESOURCE.IMAGE_EXPORT_DOWNLOAD, verb: rbac_1.VERB.GET },
|
|
37
|
+
{ kind: rbac_1.RESOURCE.IMAGE_EXPORT_CANCEL, verb: rbac_1.VERB.CREATE },
|
|
38
|
+
];
|
|
25
39
|
const ImageBuildExportsGallery = ({ imageBuild, refetch }) => {
|
|
26
|
-
const { post, proxyFetch } = (0, useFetch_1.useFetch)();
|
|
40
|
+
const { post, proxyFetch, remove } = (0, useFetch_1.useFetch)();
|
|
41
|
+
const { checkPermissions } = (0, PermissionsContext_1.usePermissionsContext)();
|
|
42
|
+
const [canCreateExport, canDelete, canViewLogs, canDownload, canCancel] = checkPermissions(imageBuildExportsPermissions);
|
|
43
|
+
const buildReason = (0, imageBuilds_1.getImageBuildStatusReason)(imageBuild);
|
|
44
|
+
const actionPermissions = React.useMemo(() => {
|
|
45
|
+
const actions = [];
|
|
46
|
+
if (buildReason === imagebuilder_1.ImageBuildConditionReason.ImageBuildConditionReasonFailed ||
|
|
47
|
+
buildReason === imagebuilder_1.ImageBuildConditionReason.ImageBuildConditionReasonCanceled ||
|
|
48
|
+
buildReason === imagebuilder_1.ImageBuildConditionReason.ImageBuildConditionReasonCanceling) {
|
|
49
|
+
if (canDelete) {
|
|
50
|
+
actions.push('delete');
|
|
51
|
+
}
|
|
52
|
+
return actions;
|
|
53
|
+
}
|
|
54
|
+
if (canCreateExport) {
|
|
55
|
+
actions.push('createExport');
|
|
56
|
+
actions.push('rebuild');
|
|
57
|
+
actions.push('retry');
|
|
58
|
+
}
|
|
59
|
+
if (canDelete) {
|
|
60
|
+
actions.push('delete');
|
|
61
|
+
}
|
|
62
|
+
if (canViewLogs) {
|
|
63
|
+
actions.push('viewLogs');
|
|
64
|
+
}
|
|
65
|
+
if (canDownload) {
|
|
66
|
+
actions.push('download');
|
|
67
|
+
}
|
|
68
|
+
if (canCancel) {
|
|
69
|
+
actions.push('cancel');
|
|
70
|
+
}
|
|
71
|
+
return actions;
|
|
72
|
+
}, [buildReason, canCreateExport, canDelete, canViewLogs, canDownload, canCancel]);
|
|
73
|
+
const navigate = (0, useNavigate_1.useNavigate)();
|
|
27
74
|
const [error, setError] = React.useState();
|
|
28
75
|
const { ociRegistries } = (0, OciRegistriesContext_1.useOciRegistriesContext)();
|
|
29
|
-
const [
|
|
30
|
-
const [downloadingFormat, setDownloadingFormat] = React.useState();
|
|
76
|
+
const [activeFormatAction, setActiveFormatAction] = React.useState();
|
|
31
77
|
const imageBuildId = imageBuild.metadata.name;
|
|
32
|
-
const
|
|
33
|
-
setExportingFormat(format);
|
|
34
|
-
setError(undefined);
|
|
78
|
+
const handleCreateNewExport = (format) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
35
79
|
try {
|
|
36
80
|
const imageExport = (0, utils_1.getImageExportResource)(imageBuildId, format);
|
|
37
81
|
yield post('imageexports', imageExport);
|
|
@@ -42,55 +86,87 @@ const ImageBuildExportsGallery = ({ imageBuild, refetch }) => {
|
|
|
42
86
|
catch (error) {
|
|
43
87
|
// If process failed, it was likely very fast, so we also add the delay in this case.
|
|
44
88
|
yield (0, time_1.showSpinnerBriefly)(REFRESH_IMAGE_BUILD_DELAY);
|
|
45
|
-
|
|
89
|
+
throw error;
|
|
46
90
|
}
|
|
47
|
-
|
|
48
|
-
|
|
91
|
+
});
|
|
92
|
+
const handleDownload = (ieName, format) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
93
|
+
const response = yield proxyFetch(`imagebuilder/api/v1/imageexports/${ieName}/download`, {
|
|
94
|
+
method: 'GET',
|
|
95
|
+
credentials: 'include',
|
|
96
|
+
});
|
|
97
|
+
const downloadResult = yield (0, imageBuilds_2.getExportDownloadResult)(response);
|
|
98
|
+
if (downloadResult === null) {
|
|
99
|
+
yield (0, time_1.showSpinnerBriefly)(DOWNLOAD_REDIRECT_DELAY);
|
|
100
|
+
throw new Error(`Download failed: ${response.status} ${response.statusText}`);
|
|
101
|
+
}
|
|
102
|
+
if (downloadResult.type === 'redirect') {
|
|
103
|
+
createDownloadLink(downloadResult.url);
|
|
104
|
+
yield (0, time_1.showSpinnerBriefly)(DOWNLOAD_REDIRECT_DELAY);
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
const defaultFilename = `image-export-${ieName}.${format}`;
|
|
108
|
+
(0, file_saver_1.saveAs)(downloadResult.blob, downloadResult.filename || defaultFilename);
|
|
49
109
|
}
|
|
50
110
|
});
|
|
51
|
-
const
|
|
111
|
+
const handleCancel = (ieName) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
112
|
+
yield post(`imageexports/${ieName}/cancel`, {});
|
|
113
|
+
yield (0, time_1.showSpinnerBriefly)(REFRESH_IMAGE_BUILD_DELAY);
|
|
114
|
+
refetch();
|
|
115
|
+
});
|
|
116
|
+
const handleDelete = (ieName) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
117
|
+
yield remove(`imageexports/${ieName}`);
|
|
118
|
+
yield (0, time_1.showSpinnerBriefly)(REFRESH_IMAGE_BUILD_DELAY);
|
|
119
|
+
refetch();
|
|
120
|
+
});
|
|
121
|
+
const handleCardAction = ({ format, action }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
52
122
|
const imageExport = imageBuild.imageExports.find((ie) => (ie === null || ie === void 0 ? void 0 : ie.spec.format) === format);
|
|
53
|
-
if (!imageExport) {
|
|
123
|
+
if (!imageExport && !createExportAliases.includes(action)) {
|
|
54
124
|
return;
|
|
55
125
|
}
|
|
56
|
-
|
|
126
|
+
setActiveFormatAction({ format, action });
|
|
127
|
+
setError(undefined);
|
|
57
128
|
try {
|
|
58
|
-
const ieName = imageExport.metadata.name;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
129
|
+
const ieName = imageExport === null || imageExport === void 0 ? void 0 : imageExport.metadata.name;
|
|
130
|
+
switch (action) {
|
|
131
|
+
case 'createExport':
|
|
132
|
+
case 'retry':
|
|
133
|
+
case 'rebuild':
|
|
134
|
+
yield handleCreateNewExport(format);
|
|
135
|
+
break;
|
|
136
|
+
case 'download':
|
|
137
|
+
yield handleDownload(ieName, format);
|
|
138
|
+
break;
|
|
139
|
+
case 'cancel':
|
|
140
|
+
yield handleCancel(ieName);
|
|
141
|
+
break;
|
|
142
|
+
case 'delete':
|
|
143
|
+
yield handleDelete(ieName);
|
|
144
|
+
break;
|
|
145
|
+
case 'viewLogs': {
|
|
146
|
+
const searchParams = new URLSearchParams({
|
|
147
|
+
[ImageBuildLogsTab_1.IMAGE_EXPORT_ID_PARAM]: ieName,
|
|
148
|
+
});
|
|
149
|
+
navigate({ route: useNavigate_1.ROUTE.IMAGE_BUILD_DETAILS, postfix: `${imageBuildId}/logs?${searchParams.toString()}` });
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
77
152
|
}
|
|
78
153
|
}
|
|
79
|
-
catch (
|
|
80
|
-
setError({ format, message: (0, error_1.getErrorMessage)(
|
|
154
|
+
catch (error) {
|
|
155
|
+
setError({ format, message: (0, error_1.getErrorMessage)(error), action });
|
|
156
|
+
refetch();
|
|
81
157
|
}
|
|
82
158
|
finally {
|
|
83
|
-
|
|
159
|
+
setActiveFormatAction(undefined);
|
|
84
160
|
}
|
|
85
161
|
});
|
|
86
|
-
return (React.createElement(react_core_1.Gallery, { hasGutter: true, minWidths: { default: '350px' } }, (0,
|
|
162
|
+
return (React.createElement(react_core_1.Gallery, { hasGutter: true, minWidths: { default: '350px' } }, (0, imageBuilds_2.getAllExportFormats)().map((format) => {
|
|
87
163
|
const imageExport = imageBuild.imageExports.find((imageExport) => (imageExport === null || imageExport === void 0 ? void 0 : imageExport.spec.format) === format);
|
|
88
|
-
const isDisabled = exportingFormat && exportingFormat !== format;
|
|
89
164
|
// We can only link to the generic destination for the image build.
|
|
90
165
|
// The individual export artifacts are references to this generic output image.
|
|
91
|
-
const imageReference = (0,
|
|
166
|
+
const imageReference = (0, imageBuilds_2.getImageReference)(ociRegistries, imageBuild.spec.destination);
|
|
92
167
|
const hasError = (error === null || error === void 0 ? void 0 : error.format) === format;
|
|
93
|
-
|
|
168
|
+
const activeAction = (activeFormatAction === null || activeFormatAction === void 0 ? void 0 : activeFormatAction.format) === format ? activeFormatAction.action : undefined;
|
|
169
|
+
return (React.createElement(ImageExportCards_1.ViewImageBuildExportCard, { key: format, imageReference: imageReference, format: format, error: hasError ? error : null, imageExport: imageExport, activeAction: activeAction, onDismissError: () => setError(undefined), onCardAction: handleCardAction, actionPermissions: actionPermissions }));
|
|
94
170
|
})));
|
|
95
171
|
};
|
|
96
172
|
exports.default = ImageBuildExportsGallery;
|