@flightctl/ui-components 0.0.10 → 0.4.0-rc2
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/DetailsPage/Tables/ApplicationsTable.css +7 -0
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts +8 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +91 -9
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.d.ts.map +1 -1
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js +15 -51
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +10 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +65 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts +5 -4
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +18 -9
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts +3 -4
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +6 -18
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts +4 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +13 -4
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js +4 -14
- package/dist/src/components/Device/DevicesPage/DeviceFilterSelect.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js +14 -6
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts +0 -3
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js +2 -2
- package/dist/src/components/Device/DevicesPage/DeviceTableToolbar.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts +1 -4
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +70 -16
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +6 -8
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +41 -37
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/types.d.ts +1 -10
- package/dist/src/components/Device/DevicesPage/types.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/types.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts +9 -10
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js +9 -29
- package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +19 -4
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +7 -2
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +99 -7
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts +5 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.js → ApplicationTemplates.js} +31 -24
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +9 -10
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts +2 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -6
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.js → ConfigurationTemplates.js} +42 -28
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +53 -12
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +7 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js +13 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts +4 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +38 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts +3 -0
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -0
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.js +5 -2
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.d.ts → SystemdUnitsModal/SystemdUnitsModal.d.ts} +6 -6
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -0
- package/dist/src/components/Device/{MatchPatternsModal/MatchPatternsModal.js → SystemdUnitsModal/SystemdUnitsModal.js} +28 -15
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +15 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js +57 -0
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +14 -4
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +9 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -0
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestList.js +40 -38
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -0
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +15 -11
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.d.ts +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.d.ts.map +1 -0
- package/dist/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.js +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableToolbar.js.map +1 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +9 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +42 -0
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts +2 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +19 -2
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +2 -4
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +6 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +61 -35
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts +2 -2
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js +16 -6
- package/dist/src/components/Fleet/FleetDetails/FleetDetails.js.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts +2 -5
- package/dist/src/components/Fleet/FleetResourceSyncs.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetResourceSyncs.js +38 -24
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
- package/dist/src/components/Fleet/FleetRow.d.ts +2 -0
- package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetRow.js +16 -14
- package/dist/src/components/Fleet/FleetRow.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.d.ts +2 -2
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +34 -24
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts +2 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js +11 -2
- package/dist/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js +5 -2
- package/dist/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.js.map +1 -1
- package/dist/src/components/Fleet/useFleets.d.ts +11 -3
- package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
- package/dist/src/components/Fleet/useFleets.js +22 -12
- package/dist/src/components/Fleet/useFleets.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +5 -14
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts +0 -3
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js +2 -2
- package/dist/src/components/OverviewPage/Cards/Status/StatusCardFilters.js.map +1 -1
- package/dist/src/components/OverviewPage/Overview.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Overview.js +11 -5
- package/dist/src/components/OverviewPage/Overview.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts +2 -2
- package/dist/src/components/Repository/CreateRepository/CreateRepository.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js +15 -6
- package/dist/src/components/Repository/CreateRepository/CreateRepository.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +4 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.js +22 -6
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js +3 -2
- package/dist/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts +2 -2
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js +16 -5
- package/dist/src/components/Repository/RepositoryDetails/RepositoryDetails.js.map +1 -1
- package/dist/src/components/Repository/RepositoryList.d.ts +0 -1
- package/dist/src/components/Repository/RepositoryList.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryList.js +55 -46
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/Repository/useRepositories.d.ts +16 -0
- package/dist/src/components/Repository/useRepositories.d.ts.map +1 -0
- package/dist/src/components/Repository/useRepositories.js +40 -0
- package/dist/src/components/Repository/useRepositories.js.map +1 -0
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +21 -23
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Table/Table.d.ts +0 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +2 -2
- package/dist/src/components/Table/Table.js.map +1 -1
- package/dist/src/components/Table/TablePagination.d.ts +8 -0
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -0
- package/dist/src/components/Table/TablePagination.js +38 -0
- package/dist/src/components/Table/TablePagination.js.map +1 -0
- package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
- package/dist/src/components/Terminal/Terminal.js +1 -0
- package/dist/src/components/Terminal/Terminal.js.map +1 -1
- package/dist/src/components/common/AccessDenied.d.ts +4 -0
- package/dist/src/components/common/AccessDenied.d.ts.map +1 -0
- package/dist/src/components/common/AccessDenied.js +15 -0
- package/dist/src/components/common/AccessDenied.js.map +1 -0
- package/dist/src/components/common/ButtonWithPermissions.d.ts +8 -0
- package/dist/src/components/common/ButtonWithPermissions.d.ts.map +1 -0
- package/dist/src/components/common/ButtonWithPermissions.js +12 -0
- package/dist/src/components/common/ButtonWithPermissions.js.map +1 -0
- package/dist/src/components/common/LearnMoreLink.d.ts +7 -0
- package/dist/src/components/common/LearnMoreLink.d.ts.map +1 -0
- package/dist/src/components/common/LearnMoreLink.js +13 -0
- package/dist/src/components/common/LearnMoreLink.js.map +1 -0
- package/dist/src/components/common/PageWithPermissions.d.ts +7 -0
- package/dist/src/components/common/PageWithPermissions.d.ts.map +1 -0
- package/dist/src/components/common/PageWithPermissions.js +17 -0
- package/dist/src/components/common/PageWithPermissions.js.map +1 -0
- package/dist/src/components/form/FilterSelect.d.ts +2 -4
- package/dist/src/components/form/FilterSelect.d.ts.map +1 -1
- package/dist/src/components/form/FilterSelect.js.map +1 -1
- package/dist/src/components/form/FlightCtlForm.css +3 -0
- package/dist/src/components/form/FlightCtlForm.d.ts +1 -0
- package/dist/src/components/form/FlightCtlForm.d.ts.map +1 -1
- package/dist/src/components/form/FlightCtlForm.js +2 -1
- package/dist/src/components/form/FlightCtlForm.js.map +1 -1
- package/dist/src/components/form/FormSelect.d.ts +1 -0
- package/dist/src/components/form/FormSelect.d.ts.map +1 -1
- package/dist/src/components/form/FormSelect.js +14 -2
- package/dist/src/components/form/FormSelect.js.map +1 -1
- package/dist/src/components/form/LabelsField.d.ts +2 -1
- package/dist/src/components/form/LabelsField.d.ts.map +1 -1
- package/dist/src/components/form/LabelsField.js +6 -6
- package/dist/src/components/form/LabelsField.js.map +1 -1
- package/dist/src/components/form/validations.d.ts +13 -2
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +39 -24
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +2 -5
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +2 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +4 -4
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js +2 -3
- package/dist/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.d.ts.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +6 -5
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
- package/dist/src/constants.d.ts +2 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +3 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAccessReview.d.ts +4 -0
- package/dist/src/hooks/useAccessReview.d.ts.map +1 -0
- package/dist/src/hooks/useAccessReview.js +33 -0
- package/dist/src/hooks/useAccessReview.js.map +1 -0
- package/dist/src/hooks/useAppContext.d.ts +4 -3
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useAppContext.js +2 -2
- package/dist/src/hooks/useAppContext.js.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +4 -2
- package/dist/src/hooks/useFetch.d.ts.map +1 -1
- package/dist/src/hooks/useFetchPeriodically.d.ts +1 -1
- package/dist/src/hooks/useFetchPeriodically.d.ts.map +1 -1
- package/dist/src/hooks/useFetchPeriodically.js +4 -1
- package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
- package/dist/src/hooks/useFleetImportAccessReview.d.ts +3 -0
- package/dist/src/hooks/useFleetImportAccessReview.d.ts.map +1 -0
- package/dist/src/hooks/useFleetImportAccessReview.js +12 -0
- package/dist/src/hooks/useFleetImportAccessReview.js.map +1 -0
- package/dist/src/hooks/useTablePagination.d.ts +10 -0
- package/dist/src/hooks/useTablePagination.d.ts.map +1 -0
- package/dist/src/hooks/useTablePagination.js +33 -0
- package/dist/src/hooks/useTablePagination.js.map +1 -0
- package/dist/src/hooks/useWebSocket.d.ts +2 -2
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/useWebSocket.js.map +1 -1
- package/dist/src/links.d.ts +3 -0
- package/dist/src/links.d.ts.map +1 -0
- package/dist/src/links.js +6 -0
- package/dist/src/links.js.map +1 -0
- package/dist/src/types/rbac.d.ts +18 -0
- package/dist/src/types/rbac.d.ts.map +1 -0
- package/dist/src/types/rbac.js +23 -0
- package/dist/src/types/rbac.js.map +1 -0
- package/dist/src/utils/api.d.ts +3 -3
- package/dist/src/utils/api.d.ts.map +1 -1
- package/dist/src/utils/api.js.map +1 -1
- package/dist/src/utils/labels.d.ts +1 -1
- package/dist/src/utils/labels.d.ts.map +1 -1
- package/dist/src/utils/labels.js +4 -8
- package/dist/src/utils/labels.js.map +1 -1
- package/dist/src/utils/query.d.ts +9 -0
- package/dist/src/utils/query.d.ts.map +1 -1
- package/dist/src/utils/query.js +33 -1
- package/dist/src/utils/query.js.map +1 -1
- package/dist/src/utils/search.d.ts +1 -0
- package/dist/src/utils/search.d.ts.map +1 -1
- package/dist/src/utils/search.js +7 -7
- package/dist/src/utils/search.js.map +1 -1
- package/package.json +5 -5
- package/src/components/DetailsPage/Tables/ApplicationsTable.css +7 -0
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +150 -13
- package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +31 -132
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +102 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +33 -16
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +8 -38
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +21 -4
- package/src/components/Device/DevicesPage/DeviceFilterSelect.tsx +13 -34
- package/src/components/Device/DevicesPage/DeviceTableRow.tsx +21 -9
- package/src/components/Device/DevicesPage/DeviceTableToolbar.tsx +0 -7
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +93 -40
- package/src/components/Device/DevicesPage/DevicesPage.tsx +64 -58
- package/src/components/Device/DevicesPage/types.ts +1 -13
- package/src/components/Device/DevicesPage/useDevices.ts +19 -38
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +24 -4
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +156 -47
- package/src/components/Device/EditDeviceWizard/steps/{ApplicationsForm.tsx → ApplicationTemplates.tsx} +89 -53
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +22 -26
- package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +17 -12
- package/src/components/Device/EditDeviceWizard/steps/{ConfigTemplateForm.tsx → ConfigurationTemplates.tsx} +110 -52
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +108 -11
- package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +19 -0
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +75 -0
- package/src/components/Device/EditDeviceWizard/types.ts +3 -0
- package/src/components/Device/EditDeviceWizard/utils.ts +14 -4
- package/src/components/Device/{MatchPatternsModal/MatchPatternsModal.tsx → SystemdUnitsModal/SystemdUnitsModal.tsx} +36 -19
- package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +114 -0
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +28 -9
- package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestList.tsx +57 -48
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +28 -17
- package/src/components/{Device/DevicesPage → EnrollmentRequest}/EnrollmentRequestTableToolbar.tsx +3 -2
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +63 -0
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +28 -2
- package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +2 -5
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +7 -0
- package/src/components/Fleet/CreateFleet/utils.ts +101 -49
- package/src/components/Fleet/FleetDetails/FleetDetails.tsx +57 -36
- package/src/components/Fleet/FleetResourceSyncs.tsx +53 -41
- package/src/components/Fleet/FleetRow.tsx +28 -16
- package/src/components/Fleet/FleetsPage.tsx +63 -53
- package/src/components/Fleet/ImportFleetWizard/ImportFleetWizard.tsx +16 -3
- package/src/components/Fleet/ImportFleetWizard/steps/RepositoryStep.tsx +25 -19
- package/src/components/Fleet/useFleets.ts +40 -22
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +5 -18
- package/src/components/OverviewPage/Cards/Status/StatusCardFilters.tsx +0 -7
- package/src/components/OverviewPage/Overview.tsx +20 -8
- package/src/components/Repository/CreateRepository/CreateRepository.tsx +25 -9
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +5 -2
- package/src/components/Repository/CreateRepository/utils.ts +23 -7
- package/src/components/Repository/RepositoryDetails/DeleteRepositoryModal.tsx +5 -3
- package/src/components/Repository/RepositoryDetails/RepositoryDetails.tsx +32 -10
- package/src/components/Repository/RepositoryList.tsx +113 -71
- package/src/components/Repository/useRepositories.ts +59 -0
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +41 -40
- package/src/components/Table/Table.tsx +3 -4
- package/src/components/Table/TablePagination.tsx +74 -0
- package/src/components/Terminal/Terminal.tsx +1 -0
- package/src/components/common/AccessDenied.tsx +17 -0
- package/src/components/common/ButtonWithPermissions.tsx +14 -0
- package/src/components/common/LearnMoreLink.tsx +26 -0
- package/src/components/common/PageWithPermissions.tsx +19 -0
- package/src/components/form/FilterSelect.tsx +2 -4
- package/src/components/form/FlightCtlForm.css +3 -0
- package/src/components/form/FlightCtlForm.tsx +3 -1
- package/src/components/form/FormSelect.tsx +22 -2
- package/src/components/form/LabelsField.tsx +17 -13
- package/src/components/form/validations.ts +53 -25
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +2 -5
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -4
- package/src/components/modals/massModals/MassApproveDeviceModal/MassApproveDeviceModal.tsx +2 -4
- package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +8 -5
- package/src/constants.ts +2 -1
- package/src/hooks/useAccessReview.ts +33 -0
- package/src/hooks/useAppContext.tsx +6 -5
- package/src/hooks/useFetchPeriodically.ts +4 -0
- package/src/hooks/useFleetImportAccessReview.ts +8 -0
- package/src/hooks/useTablePagination.tsx +44 -0
- package/src/hooks/useWebSocket.ts +4 -4
- package/src/links.ts +5 -0
- package/src/types/rbac.ts +18 -0
- package/src/utils/api.ts +3 -3
- package/src/utils/labels.ts +3 -7
- package/src/utils/query.ts +41 -0
- package/src/utils/search.ts +1 -1
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts +0 -12
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js +0 -40
- package/dist/src/components/DetailsPage/Tables/SystemdDetailsTable.js.map +0 -1
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts +0 -10
- package/dist/src/components/Device/DeviceDetails/SystemdTable.d.ts.map +0 -1
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js +0 -38
- package/dist/src/components/Device/DeviceDetails/SystemdTable.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts +0 -6
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestList.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/EnrollmentRequestTableToolbar.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts +0 -5
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationsForm.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts +0 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigTemplateForm.js.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts +0 -11
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.d.ts.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js +0 -39
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsForm.js.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.d.ts.map +0 -1
- package/dist/src/components/Device/MatchPatternsModal/MatchPatternsModal.js.map +0 -1
- package/dist/src/components/common/HelperTextItems.d.ts +0 -3
- package/dist/src/components/common/HelperTextItems.d.ts.map +0 -1
- package/dist/src/components/common/HelperTextItems.js +0 -17
- package/dist/src/components/common/HelperTextItems.js.map +0 -1
- package/dist/src/hooks/useApiTableSort.d.ts +0 -8
- package/dist/src/hooks/useApiTableSort.d.ts.map +0 -1
- package/dist/src/hooks/useApiTableSort.js +0 -44
- package/dist/src/hooks/useApiTableSort.js.map +0 -1
- package/dist/src/hooks/useTableSort.d.ts +0 -7
- package/dist/src/hooks/useTableSort.d.ts.map +0 -1
- package/dist/src/hooks/useTableSort.js +0 -38
- package/dist/src/hooks/useTableSort.js.map +0 -1
- package/dist/src/utils/sort/generic.d.ts +0 -5
- package/dist/src/utils/sort/generic.d.ts.map +0 -1
- package/dist/src/utils/sort/generic.js +0 -10
- package/dist/src/utils/sort/generic.js.map +0 -1
- package/dist/src/utils/sort/repository.d.ts +0 -6
- package/dist/src/utils/sort/repository.d.ts.map +0 -1
- package/dist/src/utils/sort/repository.js +0 -28
- package/dist/src/utils/sort/repository.js.map +0 -1
- package/dist/src/utils/sort/resourceSync.d.ts +0 -6
- package/dist/src/utils/sort/resourceSync.d.ts.map +0 -1
- package/dist/src/utils/sort/resourceSync.js +0 -29
- package/dist/src/utils/sort/resourceSync.js.map +0 -1
- package/src/components/DetailsPage/Tables/SystemdDetailsTable.tsx +0 -63
- package/src/components/Device/DeviceDetails/SystemdTable.tsx +0 -65
- package/src/components/Device/MatchPatternsModal/MatchPatternsForm.tsx +0 -92
- package/src/components/common/HelperTextItems.tsx +0 -25
- package/src/hooks/useApiTableSort.ts +0 -49
- package/src/hooks/useTableSort.ts +0 -42
- package/src/utils/sort/generic.ts +0 -8
- package/src/utils/sort/repository.ts +0 -28
- package/src/utils/sort/resourceSync.ts +0 -30
package/dist/src/utils/search.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSearchResultsCount = exports.fuzzySeach = void 0;
|
|
3
|
+
exports.getSearchResultsCount = exports.fuzzySeach = exports.MAX_TOTAL_SEARCH_RESULTS = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fuzzysearch_1 = tslib_1.__importDefault(require("fuzzysearch"));
|
|
6
6
|
// Must be an even number for "getSearchResultsCount" to work
|
|
7
|
-
|
|
7
|
+
exports.MAX_TOTAL_SEARCH_RESULTS = 10;
|
|
8
8
|
const fuzzySeach = (filter, value) => {
|
|
9
9
|
if (!filter) {
|
|
10
10
|
return true;
|
|
@@ -14,14 +14,14 @@ const fuzzySeach = (filter, value) => {
|
|
|
14
14
|
};
|
|
15
15
|
exports.fuzzySeach = fuzzySeach;
|
|
16
16
|
const getSearchResultsCount = (labelCount, fleetCount) => {
|
|
17
|
-
if (labelCount + fleetCount <= MAX_TOTAL_SEARCH_RESULTS) {
|
|
17
|
+
if (labelCount + fleetCount <= exports.MAX_TOTAL_SEARCH_RESULTS) {
|
|
18
18
|
return [labelCount, fleetCount];
|
|
19
19
|
}
|
|
20
|
-
const min = Math.min(labelCount, fleetCount, MAX_TOTAL_SEARCH_RESULTS / 2);
|
|
21
|
-
if (min === MAX_TOTAL_SEARCH_RESULTS / 2) {
|
|
22
|
-
return [MAX_TOTAL_SEARCH_RESULTS / 2, MAX_TOTAL_SEARCH_RESULTS / 2];
|
|
20
|
+
const min = Math.min(labelCount, fleetCount, exports.MAX_TOTAL_SEARCH_RESULTS / 2);
|
|
21
|
+
if (min === exports.MAX_TOTAL_SEARCH_RESULTS / 2) {
|
|
22
|
+
return [exports.MAX_TOTAL_SEARCH_RESULTS / 2, exports.MAX_TOTAL_SEARCH_RESULTS / 2];
|
|
23
23
|
}
|
|
24
|
-
const rest = MAX_TOTAL_SEARCH_RESULTS - min;
|
|
24
|
+
const rest = exports.MAX_TOTAL_SEARCH_RESULTS - min;
|
|
25
25
|
return labelCount === min ? [labelCount, rest] : [rest, fleetCount];
|
|
26
26
|
};
|
|
27
27
|
exports.getSearchResultsCount = getSearchResultsCount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/utils/search.ts"],"names":[],"mappings":";;;;AAAA,sEAAgC;AAEhC,6DAA6D;
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/utils/search.ts"],"names":[],"mappings":";;;;AAAA,sEAAgC;AAEhC,6DAA6D;AAChD,QAAA,wBAAwB,GAAG,EAAE,CAAC;AAEpC,MAAM,UAAU,GAAG,CAAC,MAA0B,EAAE,KAAc,EAAW,EAAE;IAChF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IACD,6DAA6D;IAC7D,OAAO,IAAA,qBAAK,EAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAY,CAAC;AACrF,CAAC,CAAC;AANW,QAAA,UAAU,cAMrB;AAEK,MAAM,qBAAqB,GAAG,CAAC,UAAkB,EAAE,UAAkB,EAAE,EAAE;IAC9E,IAAI,UAAU,GAAG,UAAU,IAAI,gCAAwB,EAAE,CAAC;QACxD,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAClC,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,gCAAwB,GAAG,CAAC,CAAC,CAAC;IAC3E,IAAI,GAAG,KAAK,gCAAwB,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,CAAC,gCAAwB,GAAG,CAAC,EAAE,gCAAwB,GAAG,CAAC,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,IAAI,GAAG,gCAAwB,GAAG,GAAG,CAAC;IAC5C,OAAO,UAAU,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACtE,CAAC,CAAC;AAXW,QAAA,qBAAqB,yBAWhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flightctl/ui-components",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.4.0-rc2",
|
|
4
4
|
"description": "Components for Flightctl UI",
|
|
5
5
|
"repository": "https://github.com/flightctl/flightctl-ui.git",
|
|
6
6
|
"homepage": "https://github.com/flightctl/flightctl-ui.git",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@patternfly/react-charts": "^7.2.2",
|
|
46
|
-
"@patternfly/react-core": "^5.0.0",
|
|
47
|
-
"@patternfly/react-icons": "^5.0.0",
|
|
48
|
-
"@patternfly/react-styles": "^5.1.2",
|
|
49
|
-
"@patternfly/react-table": "^5.0.0",
|
|
46
|
+
"@patternfly/react-core": "^5.0.0 <= 5.4.8",
|
|
47
|
+
"@patternfly/react-icons": "^5.0.0 <= 5.4.2",
|
|
48
|
+
"@patternfly/react-styles": "^5.1.2 <= 5.4.1",
|
|
49
|
+
"@patternfly/react-table": "^5.0.0 <= 5.4.9",
|
|
50
50
|
"i18next": "21.8.14 - 23.x",
|
|
51
51
|
"react": "17.0.1 - 18.x",
|
|
52
52
|
"react-dom": "17.0.1 - 18.x",
|
|
@@ -1,19 +1,74 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { Bullseye } from '@patternfly/react-core';
|
|
2
|
+
import { Bullseye, Button, Spinner } from '@patternfly/react-core';
|
|
3
3
|
import { Table, Tbody, Td, Th, Thead, Tr } from '@patternfly/react-table';
|
|
4
|
+
import MinusCircleIcon from '@patternfly/react-icons/dist/js/icons/minus-circle-icon';
|
|
4
5
|
|
|
5
6
|
import { DeviceApplicationStatus } from '@flightctl/types';
|
|
6
7
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
7
8
|
import ApplicationStatus from '../../Status/ApplicationStatus';
|
|
9
|
+
import WithTooltip from '../../common/WithTooltip';
|
|
10
|
+
|
|
11
|
+
import './ApplicationsTable.css';
|
|
8
12
|
|
|
9
13
|
type ApplicationsTableProps = {
|
|
14
|
+
// Contains the statuses of all detected applications and systemdUnits
|
|
10
15
|
appsStatus: DeviceApplicationStatus[];
|
|
16
|
+
// List of apps as defined the device / fleet spec
|
|
17
|
+
specApps: string[];
|
|
18
|
+
// List of systemd units as defined in the device / fleet spec
|
|
19
|
+
specSystemdUnits: string[];
|
|
20
|
+
// Map: (systemdUnitName, timeItWasAdded)
|
|
21
|
+
addedSystemdUnitDates: Record<string, number>;
|
|
22
|
+
onSystemdDelete?: (deletedUnit: string) => void;
|
|
23
|
+
isUpdating: boolean;
|
|
24
|
+
canEdit: boolean;
|
|
11
25
|
};
|
|
12
26
|
|
|
13
|
-
const
|
|
27
|
+
const DELETE_SYSTED_TIMEOUT = 30000; // 30 seconds
|
|
28
|
+
|
|
29
|
+
const ApplicationsTable = ({
|
|
30
|
+
appsStatus,
|
|
31
|
+
specApps,
|
|
32
|
+
specSystemdUnits,
|
|
33
|
+
addedSystemdUnitDates,
|
|
34
|
+
onSystemdDelete,
|
|
35
|
+
isUpdating,
|
|
36
|
+
canEdit,
|
|
37
|
+
}: ApplicationsTableProps) => {
|
|
14
38
|
const { t } = useTranslation();
|
|
15
39
|
|
|
16
|
-
|
|
40
|
+
// Required to be able to detect removed systemd units for their correct type.
|
|
41
|
+
// It takes a bit for them to be removed from the applications list.
|
|
42
|
+
const [deletedSystemdUnits, setDeletedSystemdUnits] = React.useState<string[]>([]);
|
|
43
|
+
|
|
44
|
+
React.useEffect(() => {
|
|
45
|
+
// Remove a service from the deleted list if it was added back later
|
|
46
|
+
const filtered = deletedSystemdUnits.filter((deletedUnit) => {
|
|
47
|
+
if (addedSystemdUnitDates[deletedUnit]) {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
return true;
|
|
51
|
+
});
|
|
52
|
+
if (filtered.length < deletedSystemdUnits.length) {
|
|
53
|
+
setDeletedSystemdUnits(filtered);
|
|
54
|
+
}
|
|
55
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
|
+
}, [addedSystemdUnitDates]);
|
|
57
|
+
|
|
58
|
+
const appsAndSystemdUnits: string[] = [];
|
|
59
|
+
specApps.forEach((app) => {
|
|
60
|
+
appsAndSystemdUnits.push(app);
|
|
61
|
+
});
|
|
62
|
+
specSystemdUnits.forEach((systemdUnit) => {
|
|
63
|
+
appsAndSystemdUnits.push(systemdUnit);
|
|
64
|
+
});
|
|
65
|
+
appsStatus.forEach((appStatus) => {
|
|
66
|
+
if (!appsAndSystemdUnits.includes(appStatus.name)) {
|
|
67
|
+
appsAndSystemdUnits.push(appStatus.name);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
return appsAndSystemdUnits.length ? (
|
|
17
72
|
<Table aria-label={t('Device applications table')}>
|
|
18
73
|
<Thead>
|
|
19
74
|
<Tr>
|
|
@@ -21,19 +76,101 @@ const ApplicationsTable = ({ appsStatus }: ApplicationsTableProps) => {
|
|
|
21
76
|
<Th modifier="wrap">{t('Status')}</Th>
|
|
22
77
|
<Th modifier="wrap">{t('Ready')}</Th>
|
|
23
78
|
<Th modifier="wrap">{t('Restarts')}</Th>
|
|
79
|
+
<Th modifier="wrap">{t('Type')}</Th>
|
|
24
80
|
</Tr>
|
|
25
81
|
</Thead>
|
|
26
82
|
<Tbody>
|
|
27
|
-
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
83
|
+
{appsAndSystemdUnits.map((appName) => {
|
|
84
|
+
const appDetails = appsStatus.find((app) => app.name === appName);
|
|
85
|
+
const isDeletedSystemdUnit = deletedSystemdUnits.includes(appName);
|
|
86
|
+
const isAddedSystemdUnit = !!addedSystemdUnitDates[appName];
|
|
87
|
+
const isApp =
|
|
88
|
+
specApps.includes(appName) ||
|
|
89
|
+
!(specSystemdUnits.includes(appName) || isDeletedSystemdUnit || isAddedSystemdUnit);
|
|
90
|
+
|
|
91
|
+
const deleteSystemdUnit = canEdit && !isDeletedSystemdUnit && onSystemdDelete && (
|
|
92
|
+
<Button
|
|
93
|
+
aria-label={t('Delete')}
|
|
94
|
+
isDisabled={isUpdating}
|
|
95
|
+
variant="plain"
|
|
96
|
+
icon={<MinusCircleIcon />}
|
|
97
|
+
onClick={() => {
|
|
98
|
+
setDeletedSystemdUnits(deletedSystemdUnits.concat(appName));
|
|
99
|
+
onSystemdDelete(appName);
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
if (!appDetails) {
|
|
105
|
+
// It's an app or a systemd unit which has not been reported yet
|
|
106
|
+
const appAddedTime = addedSystemdUnitDates[appName] || 0;
|
|
107
|
+
// For apps there are is no spinner since we don't when the app was added to the spec
|
|
108
|
+
const showSpinner = !isApp && Date.now() - appAddedTime < DELETE_SYSTED_TIMEOUT;
|
|
109
|
+
return (
|
|
110
|
+
<Tr key={appName} className="applications-table__row">
|
|
111
|
+
<Td dataLabel={t('Name')}>{appName}</Td>
|
|
112
|
+
<Td dataLabel={t('Status')} colSpan={3}>
|
|
113
|
+
{showSpinner ? (
|
|
114
|
+
<>
|
|
115
|
+
<Spinner size="sm" /> {t('Waiting for service to be reported...')}
|
|
116
|
+
</>
|
|
117
|
+
) : (
|
|
118
|
+
t('Information not available yet')
|
|
119
|
+
)}
|
|
120
|
+
</Td>
|
|
121
|
+
<Td dataLabel={t('Type')}>
|
|
122
|
+
{isApp ? (
|
|
123
|
+
<>{t('App')}</>
|
|
124
|
+
) : (
|
|
125
|
+
<>
|
|
126
|
+
{t('Systemd')} {deleteSystemdUnit}
|
|
127
|
+
</>
|
|
128
|
+
)}
|
|
129
|
+
</Td>
|
|
130
|
+
</Tr>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
let typeColumnContent: React.ReactNode;
|
|
135
|
+
|
|
136
|
+
if (isApp) {
|
|
137
|
+
typeColumnContent = t('App');
|
|
138
|
+
} else if (onSystemdDelete) {
|
|
139
|
+
let extraContent: React.ReactNode;
|
|
140
|
+
if (isDeletedSystemdUnit) {
|
|
141
|
+
extraContent = (
|
|
142
|
+
<WithTooltip
|
|
143
|
+
showTooltip
|
|
144
|
+
content={t('{{ appName }} is being removed, this may take some time.', { appName })}
|
|
145
|
+
>
|
|
146
|
+
<Spinner size="sm" />
|
|
147
|
+
</WithTooltip>
|
|
148
|
+
);
|
|
149
|
+
} else {
|
|
150
|
+
extraContent = deleteSystemdUnit;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
typeColumnContent = (
|
|
154
|
+
<>
|
|
155
|
+
{t('Systemd')} {extraContent}
|
|
156
|
+
</>
|
|
157
|
+
);
|
|
158
|
+
} else {
|
|
159
|
+
typeColumnContent = t('Systemd');
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<Tr key={appName} className="fctl-applications-table__row">
|
|
164
|
+
<Td dataLabel={t('Name')}>{appName}</Td>
|
|
165
|
+
<Td dataLabel={t('Status')}>
|
|
166
|
+
<ApplicationStatus status={appDetails.status} />
|
|
167
|
+
</Td>
|
|
168
|
+
<Td dataLabel={t('Ready')}>{appDetails.ready}</Td>
|
|
169
|
+
<Td dataLabel={t('Restarts')}>{appDetails.restarts}</Td>
|
|
170
|
+
<Td dataLabel={t('Type')}>{typeColumnContent}</Td>
|
|
171
|
+
</Tr>
|
|
172
|
+
);
|
|
173
|
+
})}
|
|
37
174
|
</Tbody>
|
|
38
175
|
</Table>
|
|
39
176
|
) : (
|
|
@@ -1,144 +1,43 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Alert,
|
|
4
|
-
Button,
|
|
5
|
-
ClipboardCopy,
|
|
6
|
-
FormGroup,
|
|
7
|
-
Grid,
|
|
8
|
-
GridItem,
|
|
9
|
-
Modal,
|
|
10
|
-
OrderType,
|
|
11
|
-
Radio,
|
|
12
|
-
Stack,
|
|
13
|
-
StackItem,
|
|
14
|
-
TextContent,
|
|
15
|
-
TextList,
|
|
16
|
-
TextListItem,
|
|
17
|
-
} from '@patternfly/react-core';
|
|
2
|
+
import { Button, List, ListComponent, ListItem, Modal, OrderType, Stack, StackItem } from '@patternfly/react-core';
|
|
18
3
|
import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
19
|
-
import FlightCtlForm from '../../form/FlightCtlForm';
|
|
20
4
|
|
|
21
5
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
22
|
-
import { useAppContext } from '../../../hooks/useAppContext';
|
|
23
6
|
|
|
24
7
|
const AddDeviceModal = ({ onClose }: { onClose: VoidFunction }) => {
|
|
25
8
|
const { t } = useTranslation();
|
|
26
|
-
const { qcow2ImgUrl, bootcImgUrl } = useAppContext();
|
|
27
|
-
const [imgType, setImgType] = React.useState<'bootc' | 'qcow2'>();
|
|
28
9
|
|
|
29
|
-
React.useEffect(() => {
|
|
30
|
-
if (!!bootcImgUrl) {
|
|
31
|
-
setImgType('bootc');
|
|
32
|
-
} else if (!!qcow2ImgUrl) {
|
|
33
|
-
setImgType('qcow2');
|
|
34
|
-
}
|
|
35
|
-
}, [qcow2ImgUrl, bootcImgUrl]);
|
|
36
|
-
|
|
37
|
-
const actions = [
|
|
38
|
-
<Button key="close" variant="secondary" onClick={onClose}>
|
|
39
|
-
{t('Close')}
|
|
40
|
-
</Button>,
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
if (imgType === 'qcow2') {
|
|
44
|
-
actions.unshift(
|
|
45
|
-
<Button key="download" onClick={() => window.open(qcow2ImgUrl, '_blank')}>
|
|
46
|
-
{t('Download disk')}
|
|
47
|
-
</Button>,
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
10
|
return (
|
|
51
|
-
<Modal variant="medium" title={t('Add
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
name="qcow2"
|
|
82
|
-
onChange={(_, checked) => checked && setImgType('qcow2')}
|
|
83
|
-
label={qcow2ImgUrl ? t('Use a disk image (qcow2)') : t('Use a disk image (qcow2) (Not available)')}
|
|
84
|
-
id="qcow2"
|
|
85
|
-
isDisabled={!qcow2ImgUrl}
|
|
86
|
-
/>
|
|
87
|
-
</GridItem>
|
|
88
|
-
<GridItem>
|
|
89
|
-
{imgType === 'bootc' && (
|
|
90
|
-
<Alert isInline variant="info" title={t('Adding devices instructions')}>
|
|
91
|
-
<TextContent>
|
|
92
|
-
<TextList component="ol" type={OrderType.number} style={{ marginLeft: 0 }}>
|
|
93
|
-
<TextListItem>{t('Boot you device.')}</TextListItem>
|
|
94
|
-
<TextListItem>{t('Ensure that your device has a disk available for installation.')}</TextListItem>
|
|
95
|
-
<TextListItem>
|
|
96
|
-
{t('Execute the following podman command')}
|
|
97
|
-
<ClipboardCopy isReadOnly hoverTip={t('Copy')} clickTip={t('Copied')}>
|
|
98
|
-
{`podman run --rm --privileged --pid=host -v /var/lib/containers:/var/lib/containers --security-opt label=type:unconfined_t ${bootcImgUrl} bootc install to-disk /path/to/disk`}
|
|
99
|
-
</ClipboardCopy>
|
|
100
|
-
</TextListItem>
|
|
101
|
-
<TextListItem>{t('Ensure that your device will boot from `/path/to/disk`.')}</TextListItem>
|
|
102
|
-
<TextListItem>{t('Reboot the device.')}</TextListItem>
|
|
103
|
-
<TextListItem>
|
|
104
|
-
{t('Booted device should appear in the devices table. This might take a few minutes.')}
|
|
105
|
-
</TextListItem>
|
|
106
|
-
</TextList>
|
|
107
|
-
</TextContent>
|
|
108
|
-
</Alert>
|
|
109
|
-
)}
|
|
110
|
-
{imgType === 'qcow2' && (
|
|
111
|
-
<Stack hasGutter>
|
|
112
|
-
<StackItem>
|
|
113
|
-
<Alert isInline variant="info" title={t('Adding devices instructions')}>
|
|
114
|
-
<TextContent>
|
|
115
|
-
<TextList component="ol" type={OrderType.number} style={{ marginLeft: 0 }}>
|
|
116
|
-
<TextListItem>{t('Download the qcow2 disk and use it to boot your device.')}</TextListItem>
|
|
117
|
-
<TextListItem>
|
|
118
|
-
{t('Booted device should appear in the devices table. This might take a few minutes.')}
|
|
119
|
-
</TextListItem>
|
|
120
|
-
</TextList>
|
|
121
|
-
</TextContent>
|
|
122
|
-
</Alert>
|
|
123
|
-
</StackItem>
|
|
124
|
-
<StackItem>
|
|
125
|
-
<FlightCtlForm>
|
|
126
|
-
<FormGroup label={t('Disk URL')}>
|
|
127
|
-
<ClipboardCopy isReadOnly hoverTip={t('Copy')} clickTip={t('Copied')}>
|
|
128
|
-
{qcow2ImgUrl}
|
|
129
|
-
</ClipboardCopy>
|
|
130
|
-
</FormGroup>
|
|
131
|
-
<FormGroup label={t('Command to download the disk')}>
|
|
132
|
-
<ClipboardCopy isReadOnly hoverTip={t('Copy')} clickTip={t('Copied')}>
|
|
133
|
-
{`wget -O disk.qcow2 ${qcow2ImgUrl}`}
|
|
134
|
-
</ClipboardCopy>
|
|
135
|
-
</FormGroup>
|
|
136
|
-
</FlightCtlForm>
|
|
137
|
-
</StackItem>
|
|
138
|
-
</Stack>
|
|
139
|
-
)}
|
|
140
|
-
</GridItem>
|
|
141
|
-
</Grid>
|
|
11
|
+
<Modal variant="medium" title={t('Add devices')} onClose={onClose} isOpen>
|
|
12
|
+
<Stack hasGutter>
|
|
13
|
+
<StackItem>{t('You can add devices following these steps:')}</StackItem>
|
|
14
|
+
<StackItem>
|
|
15
|
+
<List component={ListComponent.ol} type={OrderType.number}>
|
|
16
|
+
<ListItem>{t('Request an enrollment certificate for your device')}</ListItem>
|
|
17
|
+
<ListItem>{t('Build a bootc OS image')}</ListItem>
|
|
18
|
+
<ListItem>{t('Create, sign and publish a bootable OS disk image')}</ListItem>
|
|
19
|
+
<ListItem>{t('Boot your device into the OS disk image')}</ListItem>
|
|
20
|
+
</List>
|
|
21
|
+
</StackItem>
|
|
22
|
+
<StackItem>
|
|
23
|
+
<Button
|
|
24
|
+
component="a"
|
|
25
|
+
variant="link"
|
|
26
|
+
isInline
|
|
27
|
+
href="https://github.com/flightctl/flightctl/blob/main/docs/user/getting-started.md#building-a-bootable-container-image-including-the-flight-control-agent"
|
|
28
|
+
target="_blank"
|
|
29
|
+
icon={<ExternalLinkAltIcon />}
|
|
30
|
+
iconPosition="end"
|
|
31
|
+
>
|
|
32
|
+
{t('Learn more about adding devices')}{' '}
|
|
33
|
+
</Button>
|
|
34
|
+
</StackItem>
|
|
35
|
+
<StackItem className="pf-v5-u-mt-md">
|
|
36
|
+
<Button variant="primary" isInline onClick={onClose}>
|
|
37
|
+
{t('Close')}
|
|
38
|
+
</Button>
|
|
39
|
+
</StackItem>
|
|
40
|
+
</Stack>
|
|
142
41
|
</Modal>
|
|
143
42
|
);
|
|
144
43
|
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button, CardTitle, Flex, FlexItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
import { Device } from '@flightctl/types';
|
|
5
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
6
|
+
import { useFetch } from '../../../hooks/useFetch';
|
|
7
|
+
import { getStringListPatches } from '../../../utils/patch';
|
|
8
|
+
import { getDeviceFleet } from '../../../utils/devices';
|
|
9
|
+
import SystemdUnitsModal from '../SystemdUnitsModal/SystemdUnitsModal';
|
|
10
|
+
import ApplicationsTable from '../../DetailsPage/Tables/ApplicationsTable';
|
|
11
|
+
import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
|
|
12
|
+
|
|
13
|
+
type DeviceDetailsTabProps = {
|
|
14
|
+
device: Required<Device>;
|
|
15
|
+
refetch: VoidFunction;
|
|
16
|
+
canEdit: boolean;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const DeviceApplications = ({ device, refetch, canEdit }: React.PropsWithChildren<DeviceDetailsTabProps>) => {
|
|
20
|
+
const { t } = useTranslation();
|
|
21
|
+
const { patch } = useFetch();
|
|
22
|
+
const [showSystemdModal, setShowSystemdModal] = React.useState<boolean>(false);
|
|
23
|
+
const [isUpdating, setIsUpdating] = React.useState<boolean>(false);
|
|
24
|
+
const [addedSystemdDates, setAddedSystemdDates] = React.useState<Record<string, number>>({});
|
|
25
|
+
|
|
26
|
+
const onClose = (hasChanges?: boolean, addedUnits?: string[]) => {
|
|
27
|
+
if (hasChanges) {
|
|
28
|
+
refetch();
|
|
29
|
+
}
|
|
30
|
+
if (addedUnits?.length) {
|
|
31
|
+
const allAddedUnitDates = { ...addedSystemdDates };
|
|
32
|
+
const addedDate = Date.now();
|
|
33
|
+
addedUnits.forEach((newUnit) => {
|
|
34
|
+
allAddedUnitDates[newUnit] = addedDate;
|
|
35
|
+
});
|
|
36
|
+
setAddedSystemdDates(allAddedUnitDates);
|
|
37
|
+
}
|
|
38
|
+
setShowSystemdModal(false);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const isManagedDevice = !!getDeviceFleet(device.metadata);
|
|
42
|
+
const trackedSystemdUnits = device.spec?.systemd?.matchPatterns || [];
|
|
43
|
+
const specApps = device.spec?.applications?.map((app) => app.name || app.image) || [];
|
|
44
|
+
const apps = device.status.applications; // includes available systemdUnits
|
|
45
|
+
|
|
46
|
+
const deleteSystemdUnit = isManagedDevice
|
|
47
|
+
? undefined
|
|
48
|
+
: (removedUnit: string) => {
|
|
49
|
+
const updateDeviceSpec = async () => {
|
|
50
|
+
const patches = getStringListPatches(
|
|
51
|
+
'/spec/systemd',
|
|
52
|
+
trackedSystemdUnits,
|
|
53
|
+
trackedSystemdUnits.filter((unit) => unit !== removedUnit),
|
|
54
|
+
(units: string[]) => ({ matchPatterns: units }),
|
|
55
|
+
);
|
|
56
|
+
if (patches.length > 0) {
|
|
57
|
+
setIsUpdating(true);
|
|
58
|
+
await patch(`devices/${device.metadata.name}`, patches);
|
|
59
|
+
refetch();
|
|
60
|
+
setIsUpdating(false);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
void updateDeviceSpec();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<DetailsPageCard>
|
|
68
|
+
<CardTitle>
|
|
69
|
+
<Flex justifyContent={{ default: 'justifyContentSpaceBetween' }}>
|
|
70
|
+
<FlexItem>{t('Applications')}</FlexItem>
|
|
71
|
+
{!isManagedDevice && canEdit && (
|
|
72
|
+
<FlexItem>
|
|
73
|
+
<Button
|
|
74
|
+
variant="link"
|
|
75
|
+
isDisabled={isUpdating}
|
|
76
|
+
onClick={() => {
|
|
77
|
+
setShowSystemdModal(true);
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{t('Track systemd services')}
|
|
81
|
+
</Button>
|
|
82
|
+
</FlexItem>
|
|
83
|
+
)}
|
|
84
|
+
</Flex>
|
|
85
|
+
</CardTitle>
|
|
86
|
+
<DetailsPageCardBody>
|
|
87
|
+
<ApplicationsTable
|
|
88
|
+
appsStatus={apps}
|
|
89
|
+
specApps={specApps}
|
|
90
|
+
specSystemdUnits={trackedSystemdUnits}
|
|
91
|
+
onSystemdDelete={deleteSystemdUnit}
|
|
92
|
+
isUpdating={isUpdating}
|
|
93
|
+
addedSystemdUnitDates={addedSystemdDates}
|
|
94
|
+
canEdit={canEdit}
|
|
95
|
+
/>
|
|
96
|
+
{showSystemdModal && <SystemdUnitsModal device={device} onClose={onClose} />}
|
|
97
|
+
</DetailsPageCardBody>
|
|
98
|
+
</DetailsPageCard>
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export default DeviceApplications;
|
|
@@ -10,13 +10,17 @@ import { useTranslation } from '../../../hooks/useTranslation';
|
|
|
10
10
|
import { ROUTE, useNavigate } from '../../../hooks/useNavigate';
|
|
11
11
|
import { useAppContext } from '../../../hooks/useAppContext';
|
|
12
12
|
import DeviceDetailsTab from './DeviceDetailsTab';
|
|
13
|
-
import { useTemplateVersion } from '../../../hooks/useTemplateVersion';
|
|
14
13
|
import TerminalTab from './TerminalTab';
|
|
15
14
|
import NavItem from '../../NavItem/NavItem';
|
|
16
15
|
import DeviceStatusDebugModal from './DeviceStatusDebugModal';
|
|
17
16
|
import { getDeviceFleet } from '../../../utils/devices';
|
|
17
|
+
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
18
|
+
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
19
|
+
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
type DeviceDetailsPageProps = React.PropsWithChildren<{ hideTerminal?: boolean }>;
|
|
22
|
+
|
|
23
|
+
const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) => {
|
|
20
24
|
const { t } = useTranslation();
|
|
21
25
|
const {
|
|
22
26
|
router: { useParams, Routes, Route, Navigate },
|
|
@@ -25,13 +29,15 @@ const DeviceDetailsPage = ({ children, hideTerminal }: React.PropsWithChildren<{
|
|
|
25
29
|
const [device, loading, error, refetch] = useFetchPeriodically<Required<Device>>({ endpoint: `devices/${deviceId}` });
|
|
26
30
|
const [showDebugInfo, setShowDebugInfo] = React.useState<boolean>(false);
|
|
27
31
|
|
|
28
|
-
const [, /* useTv */ tv, loadingTv, errorTv] = useTemplateVersion(device);
|
|
29
|
-
|
|
30
32
|
const navigate = useNavigate();
|
|
31
33
|
const { remove } = useFetch();
|
|
32
34
|
|
|
33
35
|
const deviceAlias = device?.metadata.labels?.alias || deviceId;
|
|
34
36
|
|
|
37
|
+
const [canDelete] = useAccessReview(RESOURCE.DEVICE, VERB.DELETE);
|
|
38
|
+
const [canEdit] = useAccessReview(RESOURCE.DEVICE, VERB.PATCH);
|
|
39
|
+
const [canOpenTerminal] = useAccessReview(RESOURCE.DEVICE_CONSOLE, VERB.GET);
|
|
40
|
+
|
|
35
41
|
const { deleteAction, deleteModal } = useDeleteAction({
|
|
36
42
|
onDelete: async () => {
|
|
37
43
|
await remove(`devices/${deviceId}`);
|
|
@@ -51,7 +57,7 @@ const DeviceDetailsPage = ({ children, hideTerminal }: React.PropsWithChildren<{
|
|
|
51
57
|
|
|
52
58
|
return (
|
|
53
59
|
<DetailsPage
|
|
54
|
-
loading={loading
|
|
60
|
+
loading={loading}
|
|
55
61
|
error={error}
|
|
56
62
|
id={deviceId}
|
|
57
63
|
title={deviceAlias}
|
|
@@ -62,20 +68,22 @@ const DeviceDetailsPage = ({ children, hideTerminal }: React.PropsWithChildren<{
|
|
|
62
68
|
<Nav variant="tertiary">
|
|
63
69
|
<NavList>
|
|
64
70
|
<NavItem to="details">{t('Details')}</NavItem>
|
|
65
|
-
<NavItem to="terminal">{t('Terminal')}</NavItem>
|
|
71
|
+
{!hideTerminal && canOpenTerminal && <NavItem to="terminal">{t('Terminal')}</NavItem>}
|
|
66
72
|
</NavList>
|
|
67
73
|
</Nav>
|
|
68
74
|
}
|
|
69
75
|
actions={
|
|
70
76
|
<DetailsPageActions>
|
|
71
77
|
<DropdownList>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
{canEdit && (
|
|
79
|
+
<DropdownItem
|
|
80
|
+
onClick={() => navigate({ route: ROUTE.DEVICE_EDIT, postfix: deviceId })}
|
|
81
|
+
{...editActionProps}
|
|
82
|
+
>
|
|
83
|
+
{t('Edit device configurations')}
|
|
84
|
+
</DropdownItem>
|
|
85
|
+
)}
|
|
86
|
+
{canDelete && deleteAction}
|
|
79
87
|
<DropdownItem
|
|
80
88
|
onClick={() => {
|
|
81
89
|
setShowDebugInfo(!showDebugInfo);
|
|
@@ -93,12 +101,12 @@ const DeviceDetailsPage = ({ children, hideTerminal }: React.PropsWithChildren<{
|
|
|
93
101
|
<Route
|
|
94
102
|
path="details"
|
|
95
103
|
element={
|
|
96
|
-
<DeviceDetailsTab device={device}
|
|
104
|
+
<DeviceDetailsTab device={device} refetch={refetch} canEdit={canEdit}>
|
|
97
105
|
{children}
|
|
98
106
|
</DeviceDetailsTab>
|
|
99
107
|
}
|
|
100
108
|
/>
|
|
101
|
-
{!hideTerminal && <Route path="terminal" element={<TerminalTab device={device} />} />}
|
|
109
|
+
{!hideTerminal && canOpenTerminal && <Route path="terminal" element={<TerminalTab device={device} />} />}
|
|
102
110
|
</Routes>
|
|
103
111
|
)}
|
|
104
112
|
{deleteModal}
|
|
@@ -114,4 +122,13 @@ const DeviceDetailsPage = ({ children, hideTerminal }: React.PropsWithChildren<{
|
|
|
114
122
|
);
|
|
115
123
|
};
|
|
116
124
|
|
|
117
|
-
|
|
125
|
+
const DeviceDetailsPageWithPermissions = (props: DeviceDetailsPageProps) => {
|
|
126
|
+
const [allowed, loading] = useAccessReview(RESOURCE.DEVICE, VERB.GET);
|
|
127
|
+
return (
|
|
128
|
+
<PageWithPermissions allowed={allowed} loading={loading}>
|
|
129
|
+
<DeviceDetailsPage {...props} />
|
|
130
|
+
</PageWithPermissions>
|
|
131
|
+
);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export default DeviceDetailsPageWithPermissions;
|