@flightctl/ui-components 0.4.0 → 0.5.0-rc1
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/DetailsPageActions.d.ts +11 -4
- package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/DetailsPageActions.js +15 -4
- package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +2 -2
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +22 -15
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +42 -39
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts +7 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +41 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts +7 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +30 -0
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts +16 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js +57 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts +16 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +73 -0
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts +10 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js +19 -0
- package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts +8 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js +34 -0
- package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +0 -22
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +9 -92
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts +16 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/{DeviceTableRow.js → EnrolledDeviceTableRow.js} +9 -13
- package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts +23 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +99 -0
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -0
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts +2 -0
- package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js +16 -1
- package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +5 -3
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +7 -7
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +9 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js +37 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +6 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +4 -13
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -2
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +32 -3
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +4 -0
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +26 -0
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +63 -0
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +19 -10
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +9 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +52 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +8 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +95 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts +4 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +32 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts +4 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +78 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/types.d.ts +21 -0
- package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/types.js +6 -0
- package/dist/src/components/Fleet/CreateFleet/types.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +15 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +9 -7
- package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts +9 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/{FleetDevices.js → FleetDevicesCharts.js} +4 -4
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.js.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts +10 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts.map +1 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js +30 -0
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js.map +1 -0
- package/dist/src/components/Fleet/FleetResourceSyncs.js +2 -2
- package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
- package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetRow.js +7 -5
- package/dist/src/components/Fleet/FleetRow.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +2 -2
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/useFleets.d.ts +3 -3
- package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
- package/dist/src/components/Fleet/useFleets.js +3 -3
- package/dist/src/components/Fleet/useFleets.js.map +1 -1
- package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPage.js +6 -1
- package/dist/src/components/ListPage/ListPage.js.map +1 -1
- package/dist/src/components/ListPage/ListPageActions.d.ts +8 -15
- package/dist/src/components/ListPage/ListPageActions.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPageActions.js +25 -5
- package/dist/src/components/ListPage/ListPageActions.js.map +1 -1
- package/dist/src/components/ListPage/types.d.ts +11 -11
- package/dist/src/components/ListPage/types.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +0 -1
- package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -1
- package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -1
- package/dist/src/components/OverviewPage/OverviewPage.js +6 -1
- package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -1
- package/dist/src/components/Repository/useRepositories.d.ts +2 -2
- package/dist/src/components/Repository/useRepositories.d.ts.map +1 -1
- package/dist/src/components/Repository/useRepositories.js.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +2 -2
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Status/DeviceLifecycleStatus.d.ts +7 -0
- package/dist/src/components/Status/DeviceLifecycleStatus.d.ts.map +1 -0
- package/dist/src/components/Status/DeviceLifecycleStatus.js +25 -0
- package/dist/src/components/Status/DeviceLifecycleStatus.js.map +1 -0
- package/dist/src/components/Status/StatusDisplay.d.ts +1 -1
- package/dist/src/components/Status/StatusDisplay.d.ts.map +1 -1
- package/dist/src/components/Status/StatusDisplay.js +3 -3
- package/dist/src/components/Status/StatusDisplay.js.map +1 -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 +4 -3
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
- package/dist/src/components/Table/TablePagination.js +6 -5
- package/dist/src/components/Table/TablePagination.js.map +1 -1
- package/dist/src/components/common/EditableLabelControl.d.ts.map +1 -1
- package/dist/src/components/common/EditableLabelControl.js +5 -7
- package/dist/src/components/common/EditableLabelControl.js.map +1 -1
- package/dist/src/components/common/TechPreviewBadge.d.ts +4 -0
- package/dist/src/components/common/TechPreviewBadge.d.ts.map +1 -0
- package/dist/src/components/common/TechPreviewBadge.js +23 -0
- package/dist/src/components/common/TechPreviewBadge.js.map +1 -0
- package/dist/src/components/form/LabelsField.d.ts.map +1 -1
- package/dist/src/components/form/LabelsField.js +4 -1
- package/dist/src/components/form/LabelsField.js.map +1 -1
- package/dist/src/components/form/NumberField.d.ts +10 -0
- package/dist/src/components/form/NumberField.d.ts.map +1 -0
- package/dist/src/components/form/NumberField.js +51 -0
- package/dist/src/components/form/NumberField.js.map +1 -0
- package/dist/src/components/form/TextListField.d.ts +12 -0
- package/dist/src/components/form/TextListField.d.ts.map +1 -0
- package/dist/src/components/form/TextListField.js +46 -0
- package/dist/src/components/form/TextListField.js.map +1 -0
- package/dist/src/components/form/validations.d.ts +34 -6
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +78 -4
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts +9 -0
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts.map +1 -0
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.js +51 -0
- package/dist/src/components/modals/DecommissionModal/DecommissionModal.js.map +1 -0
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +4 -2
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +11 -4
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts +10 -0
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts.map +1 -0
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +67 -0
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -0
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/constants.js.map +1 -1
- package/dist/src/hooks/useAppContext.d.ts +1 -1
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +1 -1
- package/dist/src/hooks/useFetchPeriodically.js +10 -10
- package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
- package/dist/src/hooks/useTablePagination.d.ts +5 -3
- package/dist/src/hooks/useTablePagination.d.ts.map +1 -1
- package/dist/src/hooks/useTablePagination.js +9 -5
- package/dist/src/hooks/useTablePagination.js.map +1 -1
- package/dist/src/hooks/useWebSocket.d.ts +1 -1
- package/dist/src/hooks/useWebSocket.js +4 -4
- package/dist/src/hooks/useWebSocket.js.map +1 -1
- package/dist/src/links.d.ts +1 -0
- package/dist/src/links.d.ts.map +1 -1
- package/dist/src/links.js +2 -1
- package/dist/src/links.js.map +1 -1
- package/dist/src/types/rbac.d.ts +3 -1
- package/dist/src/types/rbac.d.ts.map +1 -1
- package/dist/src/types/rbac.js +2 -0
- package/dist/src/types/rbac.js.map +1 -1
- package/dist/src/utils/api.d.ts +3 -6
- package/dist/src/utils/api.d.ts.map +1 -1
- package/dist/src/utils/api.js.map +1 -1
- package/dist/src/utils/apiCalls.d.ts +2 -0
- package/dist/src/utils/apiCalls.d.ts.map +1 -0
- package/dist/src/utils/apiCalls.js +23 -0
- package/dist/src/utils/apiCalls.js.map +1 -0
- package/dist/src/utils/devices.d.ts +6 -3
- package/dist/src/utils/devices.d.ts.map +1 -1
- package/dist/src/utils/devices.js +20 -1
- package/dist/src/utils/devices.js.map +1 -1
- package/dist/src/utils/patch.d.ts +4 -1
- package/dist/src/utils/patch.d.ts.map +1 -1
- package/dist/src/utils/patch.js +166 -9
- package/dist/src/utils/patch.js.map +1 -1
- package/dist/src/utils/status/common.js +13 -12
- package/dist/src/utils/status/common.js.map +1 -1
- package/dist/src/utils/status/devices.d.ts +3 -3
- package/dist/src/utils/status/devices.d.ts.map +1 -1
- package/dist/src/utils/status/devices.js +40 -5
- package/dist/src/utils/status/devices.js.map +1 -1
- package/dist/src/utils/status/fleet.d.ts +4 -4
- package/dist/src/utils/status/fleet.d.ts.map +1 -1
- package/dist/src/utils/status/fleet.js +15 -2
- package/dist/src/utils/status/fleet.js.map +1 -1
- package/dist/src/utils/tooltip.d.ts +7 -0
- package/dist/src/utils/tooltip.d.ts.map +1 -0
- package/dist/src/utils/tooltip.js +6 -0
- package/dist/src/utils/tooltip.js.map +1 -0
- package/package.json +1 -1
- package/src/components/DetailsPage/DetailsPageActions.tsx +34 -6
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +1 -1
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +3 -3
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +53 -34
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +71 -54
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +75 -0
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +47 -0
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +1 -4
- package/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.tsx +89 -0
- package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +156 -0
- package/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.tsx +30 -0
- package/src/components/Device/DevicesPage/DevicesEmptyStates.tsx +46 -0
- package/src/components/Device/DevicesPage/DevicesPage.tsx +45 -215
- package/src/components/Device/DevicesPage/{DeviceTableRow.tsx → EnrolledDeviceTableRow.tsx} +16 -20
- package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +208 -0
- package/src/components/Device/DevicesPage/useDevices.ts +21 -1
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +6 -3
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +2 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +1 -0
- package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +1 -0
- package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +27 -19
- package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +55 -0
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +9 -7
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +10 -36
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +2 -2
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +2 -2
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +3 -2
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +46 -5
- package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +4 -0
- package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +62 -0
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +65 -30
- package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +87 -0
- package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +155 -0
- package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +91 -0
- package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +190 -0
- package/src/components/Fleet/CreateFleet/types.ts +25 -0
- package/src/components/Fleet/CreateFleet/utils.ts +20 -1
- package/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx +10 -7
- package/src/components/Fleet/FleetDetails/{FleetDevices.tsx → FleetDevicesCharts.tsx} +4 -4
- package/src/components/Fleet/FleetDetails/FleetDevicesCount.tsx +53 -0
- package/src/components/Fleet/FleetResourceSyncs.tsx +2 -2
- package/src/components/Fleet/FleetRow.tsx +12 -4
- package/src/components/Fleet/FleetsPage.tsx +2 -2
- package/src/components/Fleet/useFleets.ts +7 -7
- package/src/components/ListPage/ListPage.tsx +12 -4
- package/src/components/ListPage/ListPageActions.tsx +50 -16
- package/src/components/ListPage/types.ts +8 -8
- package/src/components/OverviewPage/Cards/Status/DeviceStatusChart.tsx +0 -1
- package/src/components/OverviewPage/OverviewPage.tsx +12 -4
- package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +1 -1
- package/src/components/Repository/useRepositories.ts +2 -2
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +2 -2
- package/src/components/Status/DeviceLifecycleStatus.tsx +33 -0
- package/src/components/Status/StatusDisplay.tsx +4 -4
- package/src/components/Table/Table.tsx +2 -1
- package/src/components/Table/TablePagination.tsx +9 -7
- package/src/components/common/EditableLabelControl.tsx +7 -6
- package/src/components/common/TechPreviewBadge.tsx +43 -0
- package/src/components/form/LabelsField.tsx +4 -1
- package/src/components/form/NumberField.tsx +78 -0
- package/src/components/form/TextListField.tsx +82 -0
- package/src/components/form/validations.ts +103 -10
- package/src/components/modals/DecommissionModal/DecommissionModal.tsx +95 -0
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -8
- package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +130 -0
- package/src/constants.ts +1 -1
- package/src/hooks/useAppContext.tsx +1 -1
- package/src/hooks/useFetchPeriodically.ts +11 -11
- package/src/hooks/{useTablePagination.tsx → useTablePagination.ts} +13 -7
- package/src/hooks/useWebSocket.ts +4 -4
- package/src/links.ts +2 -0
- package/src/types/rbac.ts +2 -0
- package/src/utils/api.ts +13 -6
- package/src/utils/apiCalls.ts +15 -0
- package/src/utils/devices.ts +21 -3
- package/src/utils/patch.ts +182 -8
- package/src/utils/status/common.ts +8 -8
- package/src/utils/status/devices.ts +39 -8
- package/src/utils/status/fleet.ts +21 -6
- package/src/utils/tooltip.ts +2 -0
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts +0 -8
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +0 -23
- package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +0 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +0 -16
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +0 -1
- package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts +0 -9
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts +0 -7
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts.map +0 -1
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js +0 -13
- package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js.map +0 -1
- package/dist/src/components/Status/IntegrityStatus.d.ts +0 -7
- package/dist/src/components/Status/IntegrityStatus.d.ts.map +0 -1
- package/dist/src/components/Status/IntegrityStatus.js +0 -17
- package/dist/src/components/Status/IntegrityStatus.js.map +0 -1
- package/dist/src/utils/status/integrity.d.ts +0 -5
- package/dist/src/utils/status/integrity.d.ts.map +0 -1
- package/dist/src/utils/status/integrity.js +0 -28
- package/dist/src/utils/status/integrity.js.map +0 -1
- package/src/components/DetailsPage/Tables/IntegrityDetails.tsx +0 -44
- package/src/components/Fleet/FleetDetails/FleetDevicesLink.tsx +0 -16
- package/src/components/Status/IntegrityStatus.tsx +0 -19
- package/src/utils/status/integrity.ts +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { FlightControlQuery } from '../types/extraTypes';
|
|
3
|
-
import { getQueryStringHash, getRequestQueryString
|
|
3
|
+
import { getQueryStringHash, getRequestQueryString } from '../utils/api';
|
|
4
4
|
|
|
5
5
|
import { useFetch } from './useFetch';
|
|
6
6
|
|
|
@@ -18,11 +18,10 @@ export const useFetchPeriodically = <R>(
|
|
|
18
18
|
const ref = React.useRef(0);
|
|
19
19
|
const prevResolvedQueryHash = React.useRef<string>();
|
|
20
20
|
|
|
21
|
-
const { get
|
|
21
|
+
const { get } = useFetch();
|
|
22
22
|
|
|
23
23
|
// When the query parameters change, the hash will too. We must perform a refetch outside the timeout loop
|
|
24
24
|
const queryStringHash = getQueryStringHash(query);
|
|
25
|
-
const isAPI = isApiQuery(query);
|
|
26
25
|
|
|
27
26
|
// Callback that generates the updated query for refreshes. It may provide updated values for parameters such as from/to for metric queries
|
|
28
27
|
const getRequestQuery = React.useCallback(() => getRequestQueryString(query), [query]);
|
|
@@ -40,18 +39,19 @@ export const useFetchPeriodically = <R>(
|
|
|
40
39
|
setIsUpdating(true);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
const
|
|
44
|
-
const data = await fetchFn(requestQuery, abortController.signal);
|
|
42
|
+
const data = (await get<R>(requestQuery, abortController.signal)) as R;
|
|
45
43
|
if (isLoading) {
|
|
46
44
|
setIsLoading(false);
|
|
47
45
|
}
|
|
48
46
|
setIsUpdating(false);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
|
|
48
|
+
if (onFetchComplete) {
|
|
49
|
+
onFetchComplete(data); // Data might be mutated at this point
|
|
50
|
+
setData(data);
|
|
51
|
+
} else {
|
|
52
|
+
setData(data);
|
|
54
53
|
}
|
|
54
|
+
setError(undefined);
|
|
55
55
|
} catch (err) {
|
|
56
56
|
// aborting fetch trows 'AbortError', we can ignore it
|
|
57
57
|
if (abortController.signal.aborted) {
|
|
@@ -78,7 +78,7 @@ export const useFetchPeriodically = <R>(
|
|
|
78
78
|
abortController?.abort();
|
|
79
79
|
};
|
|
80
80
|
// eslint-disable-next-line
|
|
81
|
-
}, [get,
|
|
81
|
+
}, [get, forceUpdate, queryStringHash]);
|
|
82
82
|
|
|
83
83
|
const refetch = React.useCallback(() => setForceUpdate((val) => val + 1), []);
|
|
84
84
|
|
|
@@ -3,15 +3,17 @@ import * as React from 'react';
|
|
|
3
3
|
import { ApiList } from '../utils/api';
|
|
4
4
|
import { PAGE_SIZE } from '../constants';
|
|
5
5
|
|
|
6
|
-
export type PaginationDetails = {
|
|
7
|
-
onPageFetched: (
|
|
6
|
+
export type PaginationDetails<T extends ApiList> = {
|
|
7
|
+
onPageFetched: (data: T) => void;
|
|
8
8
|
currentPage: number;
|
|
9
9
|
setCurrentPage: (page: number) => void;
|
|
10
10
|
nextContinue: string;
|
|
11
11
|
itemCount: number;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
type ProcessData<T> = (data: T) => void;
|
|
15
|
+
|
|
16
|
+
export const useTablePagination = <T extends ApiList>(processor?: ProcessData<T>): PaginationDetails<T> => {
|
|
15
17
|
const [currentPage, setCurrentPage] = React.useState<number>(1);
|
|
16
18
|
const [continueTokens, setContinueTokens] = React.useState<string[]>([]);
|
|
17
19
|
const [itemCount, setItemCount] = React.useState<number>(0);
|
|
@@ -19,11 +21,15 @@ export const useTablePagination = (): PaginationDetails => {
|
|
|
19
21
|
const nextContinue = currentPage <= 1 ? '' : continueTokens[currentPage - 2];
|
|
20
22
|
|
|
21
23
|
const onPageFetched = React.useCallback(
|
|
22
|
-
(
|
|
24
|
+
(data: T) => {
|
|
25
|
+
if (processor) {
|
|
26
|
+
// Can mutate the data
|
|
27
|
+
processor(data);
|
|
28
|
+
}
|
|
23
29
|
const prevItems = (currentPage - 1) * PAGE_SIZE;
|
|
24
|
-
setItemCount(prevItems + (
|
|
30
|
+
setItemCount(prevItems + (data?.items.length || 0) + (data.metadata.remainingItemCount || 0));
|
|
25
31
|
|
|
26
|
-
const nextToken =
|
|
32
|
+
const nextToken = data.metadata?.continue || '';
|
|
27
33
|
if (currentPage === 1) {
|
|
28
34
|
// Always reset the list when at first page
|
|
29
35
|
setContinueTokens([nextToken]);
|
|
@@ -37,7 +43,7 @@ export const useTablePagination = (): PaginationDetails => {
|
|
|
37
43
|
);
|
|
38
44
|
}
|
|
39
45
|
},
|
|
40
|
-
[setContinueTokens, continueTokens, setItemCount, currentPage],
|
|
46
|
+
[setContinueTokens, continueTokens, setItemCount, currentPage, processor],
|
|
41
47
|
);
|
|
42
48
|
|
|
43
49
|
return { onPageFetched, currentPage, setCurrentPage, nextContinue, itemCount };
|
|
@@ -3,7 +3,7 @@ import { useTranslation } from './useTranslation';
|
|
|
3
3
|
import { useAppContext } from './useAppContext';
|
|
4
4
|
|
|
5
5
|
export const useWebSocket = <T>(
|
|
6
|
-
|
|
6
|
+
deviceId: string,
|
|
7
7
|
onMsgReceived: (msg: T) => Promise<void>,
|
|
8
8
|
): {
|
|
9
9
|
sendMessage: (msg: string) => void;
|
|
@@ -30,8 +30,8 @@ export const useWebSocket = <T>(
|
|
|
30
30
|
try {
|
|
31
31
|
setIsConnecting(true);
|
|
32
32
|
setIsClosed(false);
|
|
33
|
-
const { wsEndpoint, protocols } = getWsEndpoint();
|
|
34
|
-
const ws = new WebSocket(
|
|
33
|
+
const { wsEndpoint, protocols } = getWsEndpoint(deviceId);
|
|
34
|
+
const ws = new WebSocket(wsEndpoint, protocols);
|
|
35
35
|
ws.addEventListener('open', () => setIsConnecting(false));
|
|
36
36
|
ws.addEventListener('close', () => setIsClosed(true));
|
|
37
37
|
ws.addEventListener('error', (evt) => {
|
|
@@ -48,7 +48,7 @@ export const useWebSocket = <T>(
|
|
|
48
48
|
wsRef.current?.close();
|
|
49
49
|
wsRef.current = undefined;
|
|
50
50
|
};
|
|
51
|
-
}, [
|
|
51
|
+
}, [deviceId, t, getWsEndpoint, reset]);
|
|
52
52
|
|
|
53
53
|
const reconnect = React.useCallback(() => {
|
|
54
54
|
wsRef.current?.close();
|
package/src/links.ts
CHANGED
|
@@ -3,3 +3,5 @@ export const CREATING_APPLICATIONS_LINK =
|
|
|
3
3
|
|
|
4
4
|
export const USING_TEMPLATE_VARIABLES_LINK =
|
|
5
5
|
'https://github.com/flightctl/flightctl/blob/main/docs/user/managing-fleets.md#defining-device-templates';
|
|
6
|
+
|
|
7
|
+
export const TECH_PREVIEW_LEVEL_LINK = 'https://access.redhat.com/support/offerings/techpreview';
|
package/src/types/rbac.ts
CHANGED
|
@@ -5,12 +5,14 @@ export enum VERB {
|
|
|
5
5
|
GET = 'get',
|
|
6
6
|
PATCH = 'patch',
|
|
7
7
|
POST = 'post',
|
|
8
|
+
UPDATE = 'update',
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export enum RESOURCE {
|
|
11
12
|
FLEET = 'fleets',
|
|
12
13
|
DEVICE = 'devices',
|
|
13
14
|
DEVICE_CONSOLE = 'devices/console',
|
|
15
|
+
DEVICE_DECOMMISSION = 'devices/decommission',
|
|
14
16
|
REPOSITORY = 'repositories',
|
|
15
17
|
RESOURCE_SYNC = 'resourcesyncs',
|
|
16
18
|
ENROLLMENT_REQUEST = 'enrollmentrequests',
|
package/src/utils/api.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Condition,
|
|
3
|
+
ConditionStatus,
|
|
4
|
+
ConditionType,
|
|
5
|
+
DeviceList,
|
|
6
|
+
EnrollmentRequestList,
|
|
7
|
+
FleetList,
|
|
8
|
+
ObjectMeta,
|
|
9
|
+
RepositoryList,
|
|
10
|
+
ResourceSyncList,
|
|
11
|
+
} from '@flightctl/types';
|
|
2
12
|
|
|
3
13
|
import { AnnotationType, ApiQuery, FlightControlQuery, MetricsQuery } from '../types/extraTypes';
|
|
4
14
|
import { getPeriodTimestamps } from '../utils/metrics';
|
|
@@ -42,12 +52,9 @@ const getRequestQueryString = (queryObj: FlightControlQuery) => {
|
|
|
42
52
|
return getMetricsQueryString(queryObj);
|
|
43
53
|
};
|
|
44
54
|
|
|
45
|
-
export
|
|
46
|
-
items: Array<R>;
|
|
47
|
-
metadata: ListMeta;
|
|
48
|
-
}
|
|
55
|
+
export type ApiList = EnrollmentRequestList | DeviceList | FleetList | RepositoryList | ResourceSyncList;
|
|
49
56
|
|
|
50
|
-
const getApiListCount =
|
|
57
|
+
const getApiListCount = (listResponse: ApiList | undefined): number | undefined => {
|
|
51
58
|
if (listResponse === undefined) {
|
|
52
59
|
return undefined;
|
|
53
60
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const getErrorMsgFromApiResponse = async (response: Response): Promise<string> => {
|
|
2
|
+
let errorText = '';
|
|
3
|
+
try {
|
|
4
|
+
const msg = await response.text();
|
|
5
|
+
try {
|
|
6
|
+
const json = JSON.parse(msg) as { message: string };
|
|
7
|
+
errorText = json.message;
|
|
8
|
+
} catch (e) {
|
|
9
|
+
errorText = msg;
|
|
10
|
+
}
|
|
11
|
+
} catch (e) {
|
|
12
|
+
//ignore
|
|
13
|
+
}
|
|
14
|
+
return `Error ${response.status}: ${response.statusText}${errorText ? `: ${errorText}` : ''}`;
|
|
15
|
+
};
|
package/src/utils/devices.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import { ObjectMeta } from '@flightctl/types';
|
|
1
|
+
import { Device, ObjectMeta } from '@flightctl/types';
|
|
2
|
+
import { TFunction } from 'react-i18next';
|
|
2
3
|
|
|
3
4
|
const deviceFleetRegExp = /^Fleet\/(?<fleetName>.*)$/;
|
|
4
5
|
|
|
5
|
-
const getDeviceFleet = (metadata: ObjectMeta) => {
|
|
6
|
+
export const getDeviceFleet = (metadata: ObjectMeta) => {
|
|
6
7
|
const match = deviceFleetRegExp.exec(metadata.owner || '');
|
|
7
8
|
return match?.groups?.fleetName || null;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
export
|
|
11
|
+
export const isDeviceEnrolled = (dev: Device) => !dev.spec?.decommissioning?.target;
|
|
12
|
+
|
|
13
|
+
export const getEditDisabledReason = (device: Device, t: TFunction) => {
|
|
14
|
+
if (getDeviceFleet(device.metadata)) {
|
|
15
|
+
return t('Device is bound to a fleet and its configurations cannot be edited.');
|
|
16
|
+
}
|
|
17
|
+
if (!isDeviceEnrolled(device)) {
|
|
18
|
+
return t('Device already started decommissioning and cannot be edited.');
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const getDecommissionDisabledReason = (device: Device, t: TFunction) => {
|
|
24
|
+
if (!isDeviceEnrolled(device)) {
|
|
25
|
+
return t('Device decommissioning already started.');
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
};
|
package/src/utils/patch.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { ApplicationSpec, PatchRequest } from '@flightctl/types';
|
|
1
|
+
import { ApplicationSpec, BatchSequence, DisruptionBudget, PatchRequest, RolloutPolicy } from '@flightctl/types';
|
|
2
2
|
import isNil from 'lodash/isNil';
|
|
3
|
-
import isEqual from 'lodash/isEqual';
|
|
4
|
-
import differenceWith from 'lodash/differenceWith';
|
|
5
3
|
|
|
6
4
|
import { FlightCtlLabel } from '../types/extraTypes';
|
|
7
5
|
import { toAPILabel } from './labels';
|
|
8
6
|
import { ApplicationFormSpec } from '../components/Device/EditDeviceWizard/types';
|
|
7
|
+
import {
|
|
8
|
+
BatchForm,
|
|
9
|
+
BatchLimitType,
|
|
10
|
+
DisruptionBudgetForm,
|
|
11
|
+
FleetFormValues,
|
|
12
|
+
RolloutPolicyForm,
|
|
13
|
+
} from '../components/Fleet/CreateFleet/types';
|
|
9
14
|
|
|
10
15
|
export const appendJSONPatch = <V = unknown>({
|
|
11
16
|
patches,
|
|
@@ -38,6 +43,15 @@ export const appendJSONPatch = <V = unknown>({
|
|
|
38
43
|
});
|
|
39
44
|
};
|
|
40
45
|
|
|
46
|
+
const listsHaveDifferences = (arr1: string[], arr2: string[]) => {
|
|
47
|
+
if (arr1.length !== arr2.length) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
return arr1.some((item1, index) => {
|
|
51
|
+
return arr2[index] !== item1;
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
41
55
|
export const getStringListPatches = (
|
|
42
56
|
path: string,
|
|
43
57
|
currentList: string[],
|
|
@@ -60,18 +74,178 @@ export const getStringListPatches = (
|
|
|
60
74
|
op: 'add',
|
|
61
75
|
value: valueBuilder(newList),
|
|
62
76
|
});
|
|
63
|
-
} else {
|
|
64
|
-
|
|
77
|
+
} else if (newLen !== curLen || listsHaveDifferences(currentList, newList)) {
|
|
78
|
+
patches.push({
|
|
79
|
+
path,
|
|
80
|
+
op: 'replace',
|
|
81
|
+
value: valueBuilder(newList),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return patches;
|
|
86
|
+
};
|
|
65
87
|
|
|
66
|
-
|
|
88
|
+
const toApiLimit = (formBatch: BatchForm) => {
|
|
89
|
+
if (!formBatch.limit) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
return formBatch.limitType === BatchLimitType.BatchLimitPercent ? `${formBatch.limit}%` : formBatch.limit;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const toApiDuration = (minutes: number) => {
|
|
96
|
+
const hours = minutes / 60;
|
|
97
|
+
if (hours % 1 === 0) {
|
|
98
|
+
return `${hours}h`;
|
|
99
|
+
}
|
|
100
|
+
return `${minutes}m`;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const toApiDeviceSelection = (policyForm: RolloutPolicyForm): BatchSequence => ({
|
|
104
|
+
strategy: 'BatchSequence',
|
|
105
|
+
sequence: policyForm.batches.map((formBatch) => {
|
|
106
|
+
return {
|
|
107
|
+
limit: toApiLimit(formBatch),
|
|
108
|
+
successThreshold: formBatch.successThreshold ? `${formBatch.successThreshold}%` : undefined,
|
|
109
|
+
selector: {
|
|
110
|
+
matchLabels: toAPILabel(formBatch.selector || []),
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}),
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const toApiDisruptionBudget = (disruptionValues: DisruptionBudgetForm) => {
|
|
117
|
+
const data: DisruptionBudget = {
|
|
118
|
+
groupBy: disruptionValues.groupBy || [],
|
|
119
|
+
};
|
|
120
|
+
if (typeof disruptionValues.minAvailable === 'number') {
|
|
121
|
+
data.minAvailable = disruptionValues.minAvailable;
|
|
122
|
+
}
|
|
123
|
+
if (typeof disruptionValues.maxUnavailable === 'number') {
|
|
124
|
+
data.maxUnavailable = disruptionValues.maxUnavailable;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return data;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
export const getRolloutPolicyData = ({ rolloutPolicy, disruptionBudget }: FleetFormValues) => {
|
|
131
|
+
const newRolloutPolicy: RolloutPolicy = {};
|
|
132
|
+
if (rolloutPolicy.isAdvanced) {
|
|
133
|
+
newRolloutPolicy.defaultUpdateTimeout = toApiDuration(rolloutPolicy.updateTimeout);
|
|
134
|
+
newRolloutPolicy.deviceSelection = toApiDeviceSelection(rolloutPolicy);
|
|
135
|
+
}
|
|
136
|
+
if (disruptionBudget.isAdvanced) {
|
|
137
|
+
newRolloutPolicy.disruptionBudget = toApiDisruptionBudget(disruptionBudget);
|
|
138
|
+
}
|
|
139
|
+
return newRolloutPolicy;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const getRolloutPolicyPatches = (
|
|
143
|
+
currentPolicy: RolloutPolicy | undefined,
|
|
144
|
+
fleetValues: FleetFormValues,
|
|
145
|
+
): PatchRequest => {
|
|
146
|
+
const currentBatches = currentPolicy?.deviceSelection?.sequence || [];
|
|
147
|
+
const currentDisruption = currentPolicy?.disruptionBudget;
|
|
148
|
+
|
|
149
|
+
const hadAdvancedSettings = currentBatches.length > 0 || !!currentDisruption;
|
|
150
|
+
const wantsAdvancedSettings = fleetValues.rolloutPolicy.isAdvanced || fleetValues.disruptionBudget.isAdvanced;
|
|
151
|
+
const updatedPolicy = fleetValues.rolloutPolicy;
|
|
152
|
+
|
|
153
|
+
if (hadAdvancedSettings !== wantsAdvancedSettings) {
|
|
154
|
+
return wantsAdvancedSettings
|
|
155
|
+
? [
|
|
156
|
+
{
|
|
157
|
+
op: 'add',
|
|
158
|
+
path: '/spec/rolloutPolicy',
|
|
159
|
+
value: getRolloutPolicyData(fleetValues),
|
|
160
|
+
},
|
|
161
|
+
]
|
|
162
|
+
: [
|
|
163
|
+
{
|
|
164
|
+
op: 'remove',
|
|
165
|
+
path: '/spec/rolloutPolicy',
|
|
166
|
+
},
|
|
167
|
+
];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const patches: PatchRequest = [];
|
|
171
|
+
if (fleetValues.rolloutPolicy.isAdvanced) {
|
|
172
|
+
// The timeout will be always expressed in minutes
|
|
173
|
+
if ((currentPolicy?.defaultUpdateTimeout || '') !== (updatedPolicy.updateTimeout || '')) {
|
|
174
|
+
appendJSONPatch({
|
|
175
|
+
patches,
|
|
176
|
+
originalValue: currentPolicy?.defaultUpdateTimeout,
|
|
177
|
+
newValue: toApiDuration(updatedPolicy.updateTimeout),
|
|
178
|
+
path: '/spec/rolloutPolicy/defaultUpdateTimeout',
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
if (currentBatches.length === updatedPolicy.batches.length) {
|
|
182
|
+
const hasBatchChanges = currentBatches.some((batch, index) => {
|
|
183
|
+
// The format of the numbers is different, we must convert them for comparison
|
|
184
|
+
const updatedBatch = updatedPolicy.batches[index];
|
|
185
|
+
if ((batch.limit || 0) !== (toApiLimit(updatedBatch) || 0)) {
|
|
186
|
+
return true;
|
|
187
|
+
}
|
|
188
|
+
const updatedThreshold = updatedBatch.successThreshold ? `${updatedBatch.successThreshold}%` : 0;
|
|
189
|
+
if (updatedThreshold !== (batch.successThreshold || 0)) {
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
const labelPatches = getLabelPatches('labels', batch.selector?.matchLabels || {}, updatedBatch.selector);
|
|
193
|
+
if (labelPatches.length > 0) {
|
|
194
|
+
return true;
|
|
195
|
+
}
|
|
196
|
+
return false;
|
|
197
|
+
});
|
|
198
|
+
if (hasBatchChanges) {
|
|
199
|
+
patches.push({
|
|
200
|
+
path: '/spec/rolloutPolicy/deviceSelection',
|
|
201
|
+
op: 'replace',
|
|
202
|
+
value: toApiDeviceSelection(updatedPolicy),
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
} else {
|
|
67
206
|
patches.push({
|
|
68
|
-
path,
|
|
207
|
+
path: '/spec/rolloutPolicy/deviceSelection',
|
|
69
208
|
op: 'replace',
|
|
70
|
-
value:
|
|
209
|
+
value: toApiDeviceSelection(updatedPolicy),
|
|
71
210
|
});
|
|
72
211
|
}
|
|
212
|
+
} else if (currentBatches.length > 0) {
|
|
213
|
+
patches.push({
|
|
214
|
+
path: '/spec/rolloutPolicy/deviceSelection',
|
|
215
|
+
op: 'remove',
|
|
216
|
+
});
|
|
217
|
+
patches.push({
|
|
218
|
+
path: '/spec/rolloutPolicy/defaultUpdateTimeout',
|
|
219
|
+
op: 'remove',
|
|
220
|
+
});
|
|
73
221
|
}
|
|
74
222
|
|
|
223
|
+
if (fleetValues.disruptionBudget.isAdvanced) {
|
|
224
|
+
const hasMinChanged = (currentDisruption?.minAvailable || '') !== (fleetValues.disruptionBudget.minAvailable || '');
|
|
225
|
+
const hasMaxChanged =
|
|
226
|
+
(currentDisruption?.maxUnavailable || '') !== (fleetValues.disruptionBudget.maxUnavailable || '');
|
|
227
|
+
|
|
228
|
+
const hasChanges =
|
|
229
|
+
hasMinChanged ||
|
|
230
|
+
hasMaxChanged ||
|
|
231
|
+
listsHaveDifferences(currentDisruption?.groupBy || [], fleetValues.disruptionBudget.groupBy || []);
|
|
232
|
+
|
|
233
|
+
if (hasChanges) {
|
|
234
|
+
appendJSONPatch({
|
|
235
|
+
path: '/spec/rolloutPolicy/disruptionBudget',
|
|
236
|
+
patches,
|
|
237
|
+
originalValue: currentDisruption,
|
|
238
|
+
newValue: fleetValues.disruptionBudget.isAdvanced
|
|
239
|
+
? toApiDisruptionBudget(fleetValues.disruptionBudget)
|
|
240
|
+
: undefined,
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
} else if (currentDisruption?.minAvailable || currentDisruption?.maxUnavailable) {
|
|
244
|
+
patches.push({
|
|
245
|
+
path: '/spec/rolloutPolicy/disruptionBudget',
|
|
246
|
+
op: 'remove',
|
|
247
|
+
});
|
|
248
|
+
}
|
|
75
249
|
return patches;
|
|
76
250
|
};
|
|
77
251
|
|
|
@@ -6,12 +6,12 @@ import { ExclamationTriangleIcon } from '@patternfly/react-icons/dist/js/icons/e
|
|
|
6
6
|
import { CheckCircleIcon } from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
7
7
|
import { OutlinedQuestionCircleIcon } from '@patternfly/react-icons/dist/js/icons/outlined-question-circle-icon';
|
|
8
8
|
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
9
|
+
import warningColor from '@patternfly/react-tokens/dist/js/global_warning_color_100';
|
|
10
|
+
import dangerColor from '@patternfly/react-tokens/dist/js/global_danger_color_100';
|
|
11
|
+
import successColor from '@patternfly/react-tokens/dist/js/global_success_color_100';
|
|
12
|
+
import disabledColor from '@patternfly/react-tokens/dist/js/global_disabled_color_100';
|
|
13
|
+
import activeColor from '@patternfly/react-tokens/dist/js/global_active_color_100';
|
|
14
|
+
import defaultColor from '@patternfly/react-tokens/dist/js/global_palette_black_1000';
|
|
15
15
|
|
|
16
16
|
export type StatusLevel = 'custom' | 'info' | 'success' | 'warning' | 'danger' | 'unknown';
|
|
17
17
|
|
|
@@ -61,10 +61,10 @@ export const getDefaultStatusColor = (level: StatusLevel) => {
|
|
|
61
61
|
color = successColor.value;
|
|
62
62
|
break;
|
|
63
63
|
case 'custom':
|
|
64
|
-
color =
|
|
64
|
+
color = defaultColor.value;
|
|
65
65
|
break;
|
|
66
66
|
default:
|
|
67
|
-
color =
|
|
67
|
+
color = disabledColor.value;
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
return color;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { TFunction } from 'react-i18next';
|
|
2
2
|
import { PowerOffIcon } from '@patternfly/react-icons/dist/js/icons';
|
|
3
|
+
import BanIcon from '@patternfly/react-icons/dist/js/icons/ban-icon';
|
|
3
4
|
|
|
4
5
|
import {
|
|
5
6
|
ApplicationsSummaryStatusType,
|
|
6
7
|
DeviceSummaryStatus as BEDeviceSummaryStatus,
|
|
7
|
-
|
|
8
|
+
Device,
|
|
8
9
|
DeviceIntegrityStatusSummaryType,
|
|
10
|
+
DeviceLifecycleStatusType,
|
|
9
11
|
DeviceSummaryStatusType,
|
|
10
|
-
DeviceUpdatedStatus,
|
|
11
12
|
DeviceUpdatedStatusType,
|
|
12
13
|
} from '@flightctl/types';
|
|
13
14
|
import { StatusItem } from './common';
|
|
@@ -30,13 +31,19 @@ export type DeviceSummaryStatus =
|
|
|
30
31
|
export const getDeviceSummaryStatus = (deviceStatus?: BEDeviceSummaryStatus): DeviceSummaryStatusType =>
|
|
31
32
|
deviceStatus?.status || DeviceSummaryStatusType.DeviceSummaryStatusUnknown;
|
|
32
33
|
|
|
33
|
-
export const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
export const getDeviceLifecycleStatus = (device: Device): DeviceLifecycleStatusType => {
|
|
35
|
+
const lifecycleStatus = device.status?.lifecycle?.status || DeviceLifecycleStatusType.DeviceLifecycleStatusEnrolled;
|
|
36
|
+
const isDecomStatus = [
|
|
37
|
+
DeviceLifecycleStatusType.DeviceLifecycleStatusDecommissioning,
|
|
38
|
+
DeviceLifecycleStatusType.DeviceLifecycleStatusDecommissioned,
|
|
39
|
+
].includes(lifecycleStatus);
|
|
37
40
|
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
if (!isDecomStatus && device.spec?.decommissioning?.target) {
|
|
42
|
+
return DeviceLifecycleStatusType.DeviceLifecycleStatusDecommissioning;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return lifecycleStatus;
|
|
46
|
+
};
|
|
40
47
|
|
|
41
48
|
export const getDeviceStatusItems = (t: TFunction): StatusItem<DeviceSummaryStatusType>[] => [
|
|
42
49
|
{
|
|
@@ -72,4 +79,28 @@ export const getDeviceStatusItems = (t: TFunction): StatusItem<DeviceSummaryStat
|
|
|
72
79
|
},
|
|
73
80
|
];
|
|
74
81
|
|
|
82
|
+
export const getDeviceLifecycleStatusItems = (t: TFunction): StatusItem<DeviceLifecycleStatusType>[] => [
|
|
83
|
+
{
|
|
84
|
+
id: DeviceLifecycleStatusType.DeviceLifecycleStatusDecommissioned,
|
|
85
|
+
label: t('Decommissioned'),
|
|
86
|
+
level: 'unknown',
|
|
87
|
+
customIcon: BanIcon,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: DeviceLifecycleStatusType.DeviceLifecycleStatusDecommissioning,
|
|
91
|
+
label: t('Decommissioning'),
|
|
92
|
+
level: 'warning',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: DeviceLifecycleStatusType.DeviceLifecycleStatusUnknown,
|
|
96
|
+
label: t('Unknown'),
|
|
97
|
+
level: 'unknown',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: DeviceLifecycleStatusType.DeviceLifecycleStatusEnrolled,
|
|
101
|
+
label: t('Enrolled'),
|
|
102
|
+
level: 'success',
|
|
103
|
+
},
|
|
104
|
+
];
|
|
105
|
+
|
|
75
106
|
export const deviceStatusOrder = getDeviceStatusItems((s: string) => s).map((item) => item.id);
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { ConditionStatus, ConditionType, Fleet } from '@flightctl/types';
|
|
2
|
-
import { FleetConditionType } from '../../types/extraTypes';
|
|
3
1
|
import { TFunction } from 'i18next';
|
|
2
|
+
|
|
3
|
+
import { Condition, ConditionStatus, ConditionType, Fleet } from '@flightctl/types';
|
|
4
|
+
import { FleetConditionType } from '../../types/extraTypes';
|
|
4
5
|
import { getConditionMessage } from '../error';
|
|
5
6
|
|
|
6
|
-
const
|
|
7
|
+
const FLEET_ROLLOUT_FAILED_REASON = 'Suspended';
|
|
8
|
+
|
|
9
|
+
export const fleetStatusLabels = (t: TFunction) => ({
|
|
7
10
|
[ConditionType.FleetOverlappingSelectors]: t('Selectors overlap'),
|
|
8
11
|
[ConditionType.FleetValid]: t('Valid'),
|
|
9
12
|
Invalid: t('Invalid'),
|
|
10
13
|
SyncPending: t('Sync pending'),
|
|
11
14
|
});
|
|
12
15
|
|
|
13
|
-
const getFleetSyncStatus = (
|
|
16
|
+
export const getFleetSyncStatus = (
|
|
14
17
|
fleet: Fleet,
|
|
15
|
-
t: TFunction
|
|
18
|
+
t: TFunction,
|
|
16
19
|
): {
|
|
17
20
|
status: FleetConditionType;
|
|
18
21
|
message: string | undefined;
|
|
@@ -44,4 +47,16 @@ const getFleetSyncStatus = (
|
|
|
44
47
|
};
|
|
45
48
|
};
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
const isFleetRolloutFailedCondition = (condition: Condition) =>
|
|
51
|
+
condition.type === ConditionType.FleetRolloutInProgress &&
|
|
52
|
+
condition.status === ConditionStatus.ConditionStatusFalse &&
|
|
53
|
+
condition.reason === FLEET_ROLLOUT_FAILED_REASON;
|
|
54
|
+
|
|
55
|
+
export const getFleetRolloutStatusWarning = (fleet: Fleet, t: TFunction) => {
|
|
56
|
+
const failedRolloutCondition = fleet.status?.conditions?.find(isFleetRolloutFailedCondition);
|
|
57
|
+
|
|
58
|
+
if (failedRolloutCondition) {
|
|
59
|
+
return getConditionMessage(failedRolloutCondition) || t('Last rollout did not complete successfully');
|
|
60
|
+
}
|
|
61
|
+
return undefined;
|
|
62
|
+
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { DeviceIntegrityStatus } from '@flightctl/types';
|
|
3
|
-
type IntegrityDetailsProps = {
|
|
4
|
-
integrity?: DeviceIntegrityStatus;
|
|
5
|
-
};
|
|
6
|
-
declare const IntegrityDetails: ({ integrity }: IntegrityDetailsProps) => React.JSX.Element;
|
|
7
|
-
export default IntegrityDetails;
|
|
8
|
-
//# sourceMappingURL=IntegrityDetails.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrityDetails.d.ts","sourceRoot":"","sources":["../../../../../src/components/DetailsPage/Tables/IntegrityDetails.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,KAAK,qBAAqB,GAAG;IAC3B,SAAS,CAAC,EAAE,qBAAqB,CAAC;CACnC,CAAC;AAEF,QAAA,MAAM,gBAAgB,kBAAmB,qBAAqB,sBAwB7D,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const React = tslib_1.__importStar(require("react"));
|
|
5
|
-
const react_core_1 = require("@patternfly/react-core");
|
|
6
|
-
const useTranslation_1 = require("../../../hooks/useTranslation");
|
|
7
|
-
const IntegrityStatus_1 = tslib_1.__importDefault(require("../../Status/IntegrityStatus"));
|
|
8
|
-
const FlightCtlDescriptionList_1 = tslib_1.__importDefault(require("../../common/FlightCtlDescriptionList"));
|
|
9
|
-
const IntegrityDetails = ({ integrity }) => {
|
|
10
|
-
const { t } = (0, useTranslation_1.useTranslation)();
|
|
11
|
-
const info = integrity === null || integrity === void 0 ? void 0 : integrity.summary.info;
|
|
12
|
-
const status = integrity === null || integrity === void 0 ? void 0 : integrity.summary.status;
|
|
13
|
-
return info || status ? (React.createElement(FlightCtlDescriptionList_1.default, { columnModifier: { lg: '3Col' } },
|
|
14
|
-
status && (React.createElement(react_core_1.DescriptionListGroup, null,
|
|
15
|
-
React.createElement(react_core_1.DescriptionListTerm, null, t('Status')),
|
|
16
|
-
React.createElement(react_core_1.DescriptionListDescription, null,
|
|
17
|
-
React.createElement(IntegrityStatus_1.default, { status: status })))),
|
|
18
|
-
info && (React.createElement(react_core_1.DescriptionListGroup, null,
|
|
19
|
-
React.createElement(react_core_1.DescriptionListTerm, null, t('Details')),
|
|
20
|
-
React.createElement(react_core_1.DescriptionListDescription, null, info))))) : (React.createElement(react_core_1.Bullseye, null, t('No system integrity details found.')));
|
|
21
|
-
};
|
|
22
|
-
exports.default = IntegrityDetails;
|
|
23
|
-
//# sourceMappingURL=IntegrityDetails.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrityDetails.js","sourceRoot":"","sources":["../../../../../src/components/DetailsPage/Tables/IntegrityDetails.tsx"],"names":[],"mappings":";;;AAAA,qDAA+B;AAC/B,uDAKgC;AAGhC,kEAA+D;AAC/D,2FAA2D;AAC3D,6GAAiF;AAMjF,MAAM,gBAAgB,GAAG,CAAC,EAAE,SAAS,EAAyB,EAAE,EAAE;IAChE,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,+BAAc,GAAE,CAAC;IAC/B,MAAM,IAAI,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,CAAC,IAAI,CAAC;IACrC,MAAM,MAAM,GAAG,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,CAAC,MAAM,CAAC;IACzC,OAAO,IAAI,IAAI,MAAM,CAAC,CAAC,CAAC,CACtB,oBAAC,kCAA4B,IAAC,cAAc,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;QACzD,MAAM,IAAI,CACT,oBAAC,iCAAoB;YACnB,oBAAC,gCAAmB,QAAE,CAAC,CAAC,QAAQ,CAAC,CAAuB;YACxD,oBAAC,uCAA0B;gBACzB,oBAAC,yBAAe,IAAC,MAAM,EAAE,MAAM,GAAI,CACR,CACR,CACxB;QACA,IAAI,IAAI,CACP,oBAAC,iCAAoB;YACnB,oBAAC,gCAAmB,QAAE,CAAC,CAAC,SAAS,CAAC,CAAuB;YACzD,oBAAC,uCAA0B,QAAE,IAAI,CAA8B,CAC1C,CACxB,CAC4B,CAChC,CAAC,CAAC,CAAC,CACF,oBAAC,qBAAQ,QAAE,CAAC,CAAC,oCAAoC,CAAC,CAAY,CAC/D,CAAC;AACJ,CAAC,CAAC;AAEF,kBAAe,gBAAgB,CAAC"}
|