@flightctl/ui-components 0.5.1 → 0.6.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/DetailsPage.d.ts +3 -2
- package/dist/src/components/DetailsPage/DetailsPage.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/DetailsPage.js +2 -2
- package/dist/src/components/DetailsPage/DetailsPage.js.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.d.ts.map +1 -1
- package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +5 -3
- 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 +4 -5
- package/dist/src/components/Device/AddDeviceModal/AddDeviceModal.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.d.ts +10 -0
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.d.ts.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.js +110 -0
- package/dist/src/components/Device/DeviceDetails/DeviceAliasEdit.js.map +1 -0
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +7 -1
- 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 +9 -6
- 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 +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +3 -3
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -1
- package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +3 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js +34 -3
- package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +1 -1
- package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js +35 -30
- package/dist/src/components/Device/DevicesPage/DeviceToolbarFilters.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/DevicesPage.js +11 -2
- package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -1
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +14 -11
- package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +9 -2
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js +21 -6
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +11 -4
- package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts +6 -5
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js +123 -10
- package/dist/src/components/Device/EditDeviceWizard/deviceSpecUtils.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js +19 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js +49 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +52 -19
- 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 +13 -16
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.js +5 -5
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.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 +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js +16 -16
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.d.ts +8 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.d.ts.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.js +58 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.js.map +1 -0
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts +2 -2
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js +17 -12
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewApplications.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts +2 -4
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +29 -3
- package/dist/src/components/Device/EditDeviceWizard/utils.d.ts.map +1 -1
- package/dist/src/components/Device/EditDeviceWizard/utils.js +8 -7
- package/dist/src/components/Device/EditDeviceWizard/utils.js.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.d.ts.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.js.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts +1 -4
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.d.ts.map +1 -1
- package/dist/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +5 -5
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts +2 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +19 -11
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js +5 -1
- package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.js.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
- package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js +8 -4
- 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 +2 -2
- 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 +8 -1
- package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +19 -2
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +53 -18
- package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js +1 -2
- package/dist/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +9 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +22 -9
- package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +4 -4
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +5 -5
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.css +3 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.d.ts +9 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.d.ts.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.js +127 -0
- package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.js.map +1 -0
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
- package/dist/src/components/Fleet/CreateFleet/utils.js +13 -4
- package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.d.ts.map +1 -1
- package/dist/src/components/Fleet/FleetsPage.js +8 -12
- package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js +1 -1
- package/dist/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.js.map +1 -1
- package/dist/src/components/ListPage/ListPage.d.ts +1 -0
- package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
- package/dist/src/components/ListPage/ListPage.js +3 -3
- package/dist/src/components/ListPage/ListPage.js.map +1 -1
- package/dist/src/components/Masthead/CommandLineToolsPage.d.ts +4 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.d.ts.map +1 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.js +90 -0
- package/dist/src/components/Masthead/CommandLineToolsPage.js.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesModal.d.ts.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesModal.js.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesProvider.d.ts.map +1 -0
- package/dist/src/components/Masthead/UserPreferencesProvider.js.map +1 -0
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js +3 -3
- package/dist/src/components/OverviewPage/Cards/Status/StatusCard.js.map +1 -1
- package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.d.ts +4 -0
- package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.d.ts.map +1 -0
- package/dist/src/components/OverviewPage/Cards/{ToDo/ToDoCard.js → Tasks/TasksCard.js} +4 -4
- package/dist/src/components/OverviewPage/Cards/Tasks/TasksCard.js.map +1 -0
- package/dist/src/components/OverviewPage/Overview.js +2 -2
- package/dist/src/components/OverviewPage/Overview.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js +6 -5
- package/dist/src/components/Repository/CreateRepository/CreateRepositoryForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js +3 -3
- package/dist/src/components/Repository/CreateRepository/CreateResourceSyncsForm.js.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.d.ts.map +1 -1
- package/dist/src/components/Repository/CreateRepository/utils.js +4 -1
- package/dist/src/components/Repository/CreateRepository/utils.js.map +1 -1
- package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.d.ts.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/RepositoryList.d.ts.map +1 -1
- package/dist/src/components/Repository/RepositoryList.js +3 -11
- package/dist/src/components/Repository/RepositoryList.js.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.d.ts.map +1 -1
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +3 -6
- package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
- package/dist/src/components/Status/DeviceResourceStatus.js +3 -3
- package/dist/src/components/Status/utils.d.ts.map +1 -1
- package/dist/src/components/Status/utils.js +3 -3
- package/dist/src/components/Status/utils.js.map +1 -1
- package/dist/src/components/Table/Table.d.ts +2 -1
- package/dist/src/components/Table/Table.d.ts.map +1 -1
- package/dist/src/components/Table/Table.js +9 -5
- package/dist/src/components/Table/Table.js.map +1 -1
- package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
- package/dist/src/components/Table/TablePagination.js +1 -1
- package/dist/src/components/Table/TablePagination.js.map +1 -1
- package/dist/src/components/Terminal/Terminal.d.ts +1 -1
- package/dist/src/components/Terminal/Terminal.d.ts.map +1 -1
- package/dist/src/components/Terminal/Terminal.js +10 -3
- package/dist/src/components/Terminal/Terminal.js.map +1 -1
- package/dist/src/components/charts/DonutChart.js +1 -1
- package/dist/src/components/charts/DonutChart.js.map +1 -1
- package/dist/src/components/common/LeaveFormConfirmation.js +1 -1
- package/dist/src/components/common/LeaveFormConfirmation.js.map +1 -1
- package/dist/src/components/common/WithHelperText.d.ts +10 -5
- package/dist/src/components/common/WithHelperText.d.ts.map +1 -1
- package/dist/src/components/common/WithHelperText.js +13 -8
- package/dist/src/components/common/WithHelperText.js.map +1 -1
- package/dist/src/components/form/CheckboxField.d.ts +6 -3
- package/dist/src/components/form/CheckboxField.d.ts.map +1 -1
- package/dist/src/components/form/CheckboxField.js +20 -1
- package/dist/src/components/form/CheckboxField.js.map +1 -1
- package/dist/src/components/form/FormSelectTypeahead.d.ts +3 -3
- package/dist/src/components/form/FormSelectTypeahead.d.ts.map +1 -1
- package/dist/src/components/form/FormSelectTypeahead.js +43 -53
- package/dist/src/components/form/FormSelectTypeahead.js.map +1 -1
- package/dist/src/components/form/RichValidationTextField.d.ts +1 -1
- package/dist/src/components/form/RichValidationTextField.d.ts.map +1 -1
- package/dist/src/components/form/RichValidationTextField.js +8 -4
- package/dist/src/components/form/RichValidationTextField.js.map +1 -1
- package/dist/src/components/form/validations.d.ts +44 -4
- package/dist/src/components/form/validations.d.ts.map +1 -1
- package/dist/src/components/form/validations.js +148 -25
- package/dist/src/components/form/validations.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js +5 -3
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.js.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.d.ts.map +1 -1
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js +3 -2
- package/dist/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.js.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +7 -12
- package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +4 -4
- package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js +4 -4
- package/dist/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js +2 -2
- package/dist/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.js.map +1 -1
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js +2 -2
- package/dist/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.js.map +1 -1
- package/dist/src/hooks/timeZones.d.ts +3 -0
- package/dist/src/hooks/timeZones.d.ts.map +1 -0
- package/dist/src/hooks/timeZones.js +607 -0
- package/dist/src/hooks/timeZones.js.map +1 -0
- package/dist/src/hooks/useAppContext.d.ts +14 -8
- package/dist/src/hooks/useAppContext.d.ts.map +1 -1
- package/dist/src/hooks/useAppContext.js +13 -6
- package/dist/src/hooks/useAppContext.js.map +1 -1
- package/dist/src/hooks/useFetch.d.ts +3 -5
- package/dist/src/hooks/useFetch.d.ts.map +1 -1
- package/dist/src/hooks/useFetch.js +3 -2
- package/dist/src/hooks/useFetch.js.map +1 -1
- package/dist/src/hooks/useNavigate.d.ts +2 -1
- package/dist/src/hooks/useNavigate.d.ts.map +1 -1
- package/dist/src/hooks/useNavigate.js +1 -0
- package/dist/src/hooks/useNavigate.js.map +1 -1
- package/dist/src/hooks/useTimeZones.d.ts +4 -0
- package/dist/src/hooks/useTimeZones.d.ts.map +1 -0
- package/dist/src/hooks/useTimeZones.js +22 -0
- package/dist/src/hooks/useTimeZones.js.map +1 -0
- package/dist/src/hooks/useWebSocket.d.ts +6 -2
- package/dist/src/hooks/useWebSocket.d.ts.map +1 -1
- package/dist/src/hooks/useWebSocket.js +22 -7
- 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 -1
- package/dist/src/links.js +10 -3
- package/dist/src/links.js.map +1 -1
- package/dist/src/types/deviceSpec.d.ts +93 -5
- package/dist/src/types/deviceSpec.d.ts.map +1 -1
- package/dist/src/types/deviceSpec.js +28 -2
- package/dist/src/types/deviceSpec.js.map +1 -1
- package/dist/src/types/extraTypes.d.ts +19 -1
- package/dist/src/types/extraTypes.d.ts.map +1 -1
- package/dist/src/types/extraTypes.js.map +1 -1
- package/dist/src/utils/labels.d.ts +1 -0
- package/dist/src/utils/labels.d.ts.map +1 -1
- package/dist/src/utils/labels.js +9 -2
- package/dist/src/utils/labels.js.map +1 -1
- package/dist/src/utils/patch.d.ts +13 -5
- package/dist/src/utils/patch.d.ts.map +1 -1
- package/dist/src/utils/patch.js +115 -71
- package/dist/src/utils/patch.js.map +1 -1
- package/dist/src/utils/query.d.ts +1 -0
- package/dist/src/utils/query.d.ts.map +1 -1
- package/dist/src/utils/query.js +10 -3
- package/dist/src/utils/query.js.map +1 -1
- package/dist/src/utils/search.d.ts +6 -0
- package/dist/src/utils/search.d.ts.map +1 -1
- package/dist/src/utils/search.js +9 -1
- package/dist/src/utils/search.js.map +1 -1
- package/dist/src/utils/time.d.ts +31 -0
- package/dist/src/utils/time.d.ts.map +1 -0
- package/dist/src/utils/time.js +134 -0
- package/dist/src/utils/time.js.map +1 -0
- package/package.json +1 -4
- package/src/components/DetailsPage/DetailsPage.tsx +6 -4
- package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +6 -3
- package/src/components/Device/AddDeviceModal/AddDeviceModal.tsx +4 -13
- package/src/components/Device/DeviceDetails/DeviceAliasEdit.tsx +180 -0
- package/src/components/Device/DeviceDetails/DeviceApplications.tsx +8 -1
- package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +21 -5
- package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +3 -4
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +7 -10
- package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +3 -3
- package/src/components/Device/DeviceDetails/TerminalTab.tsx +43 -5
- package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +2 -1
- package/src/components/Device/DevicesPage/DeviceToolbarFilters.tsx +66 -38
- package/src/components/Device/DevicesPage/DevicesPage.tsx +11 -2
- package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +16 -11
- package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +11 -2
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardFooter.tsx +22 -6
- package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +15 -2
- package/src/components/Device/EditDeviceWizard/deviceSpecUtils.ts +147 -14
- package/src/components/Device/EditDeviceWizard/steps/ApplicationImageForm.tsx +28 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationInlineForm.tsx +94 -0
- package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +81 -50
- package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +23 -28
- package/src/components/Device/EditDeviceWizard/steps/ConfigK8sSecretTemplateForm.tsx +1 -2
- package/src/components/Device/EditDeviceWizard/steps/ConfigWithRepositoryTemplateForm.tsx +18 -39
- package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +8 -14
- package/src/components/Device/EditDeviceWizard/steps/DeviceTemplateStep.tsx +26 -39
- package/src/components/Device/EditDeviceWizard/steps/DeviceUpdateStep.tsx +88 -0
- package/src/components/Device/EditDeviceWizard/steps/GeneralInfoStep.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/steps/ReviewApplications.tsx +18 -19
- package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +3 -3
- package/src/components/Device/EditDeviceWizard/steps/ReviewTrackedSystemdServices.tsx +2 -2
- package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +2 -1
- package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +1 -1
- package/src/components/Device/EditDeviceWizard/utils.ts +16 -9
- package/src/components/Device/SystemdUnitsModal/SystemdUnitsModal.tsx +7 -6
- package/src/components/Device/SystemdUnitsModal/TrackSystemdUnitsForm.tsx +1 -5
- package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +7 -9
- package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +30 -17
- package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +5 -1
- package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +12 -4
- package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +4 -3
- package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +9 -2
- package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +51 -17
- package/src/components/Fleet/CreateFleet/steps/DeviceLabelSelector.tsx +1 -1
- package/src/components/Fleet/CreateFleet/steps/GeneralInfoStep.tsx +2 -13
- package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +3 -3
- package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +10 -1
- package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +49 -16
- package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +18 -33
- package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +14 -24
- package/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.css +3 -0
- package/src/components/Fleet/CreateFleet/steps/UpdateStepUpdatePolicy.tsx +246 -0
- package/src/components/Fleet/CreateFleet/utils.ts +23 -7
- package/src/components/Fleet/FleetsPage.tsx +15 -17
- package/src/components/Fleet/ImportFleetWizard/steps/ResourceSyncStep.tsx +1 -1
- package/src/components/ListPage/ListPage.tsx +7 -4
- package/src/components/Masthead/CommandLineToolsPage.tsx +179 -0
- package/src/components/OverviewPage/Cards/Status/StatusCard.tsx +6 -6
- package/src/components/OverviewPage/Cards/{ToDo/ToDoCard.tsx → Tasks/TasksCard.tsx} +3 -3
- package/src/components/OverviewPage/Overview.tsx +2 -2
- package/src/components/Repository/CreateRepository/CreateRepositoryForm.tsx +11 -26
- package/src/components/Repository/CreateRepository/CreateResourceSyncsForm.tsx +8 -17
- package/src/components/Repository/CreateRepository/utils.ts +4 -1
- package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +3 -4
- package/src/components/Repository/RepositoryList.tsx +9 -16
- package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +7 -11
- package/src/components/Status/DeviceResourceStatus.tsx +4 -4
- package/src/components/Status/utils.ts +3 -5
- package/src/components/Table/Table.tsx +32 -9
- package/src/components/Table/TablePagination.tsx +0 -1
- package/src/components/Terminal/Terminal.tsx +10 -4
- package/src/components/charts/DonutChart.tsx +2 -2
- package/src/components/common/LeaveFormConfirmation.tsx +2 -2
- package/src/components/common/WithHelperText.tsx +53 -21
- package/src/components/form/CheckboxField.tsx +28 -3
- package/src/components/form/FormSelectTypeahead.tsx +53 -80
- package/src/components/form/RichValidationTextField.tsx +73 -62
- package/src/components/form/validations.ts +207 -28
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceForm.tsx +5 -5
- package/src/components/modals/ApproveDeviceModal/ApproveDeviceModal.tsx +3 -2
- package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -20
- package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +2 -2
- package/src/components/modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal.tsx +2 -2
- package/src/components/modals/massModals/MassDeleteFleetModal/MassDeleteFleetModal.tsx +2 -2
- package/src/components/modals/massModals/MassDeleteRepositoryModal/MassDeleteRepositoryModal.tsx +2 -2
- package/src/hooks/timeZones.ts +606 -0
- package/src/hooks/useAppContext.tsx +20 -10
- package/src/hooks/useFetch.ts +3 -2
- package/src/hooks/useNavigate.tsx +1 -0
- package/src/hooks/useTimeZones.ts +26 -0
- package/src/hooks/useWebSocket.ts +29 -7
- package/src/links.ts +13 -4
- package/src/types/deviceSpec.ts +118 -2
- package/src/types/extraTypes.ts +33 -1
- package/src/utils/labels.ts +7 -1
- package/src/utils/patch.ts +126 -72
- package/src/utils/query.ts +13 -4
- package/src/utils/search.ts +8 -0
- package/src/utils/time.ts +147 -0
- package/dist/jest.config.d.ts +0 -12
- package/dist/jest.config.d.ts.map +0 -1
- package/dist/jest.config.js +0 -24
- package/dist/jest.config.js.map +0 -1
- package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts +0 -2
- package/dist/src/components/DetailsPage/DetailsPage.spec.d.ts.map +0 -1
- package/dist/src/components/DetailsPage/DetailsPage.spec.js +0 -81
- package/dist/src/components/DetailsPage/DetailsPage.spec.js.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts +0 -23
- package/dist/src/components/Device/EditDeviceWizard/types.d.ts.map +0 -1
- package/dist/src/components/Device/EditDeviceWizard/types.js +0 -3
- package/dist/src/components/Device/EditDeviceWizard/types.js.map +0 -1
- package/dist/src/components/Fleet/CreateFleet/types.d.ts +0 -29
- package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +0 -1
- package/dist/src/components/Fleet/CreateFleet/types.js +0 -9
- package/dist/src/components/Fleet/CreateFleet/types.js.map +0 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts +0 -4
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.d.ts.map +0 -1
- package/dist/src/components/OverviewPage/Cards/ToDo/ToDoCard.js.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesModal.d.ts.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesModal.js.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesProvider.d.ts.map +0 -1
- package/dist/src/components/UserPreferences/UserPreferencesProvider.js.map +0 -1
- package/dist/src/setupTests.d.ts +0 -2
- package/dist/src/setupTests.d.ts.map +0 -1
- package/dist/src/setupTests.js +0 -24
- package/dist/src/setupTests.js.map +0 -1
- package/dist/src/tests/test-utils.d.ts +0 -7
- package/dist/src/tests/test-utils.d.ts.map +0 -1
- package/dist/src/tests/test-utils.js +0 -21
- package/dist/src/tests/test-utils.js.map +0 -1
- package/src/components/DetailsPage/DetailsPage.spec.tsx +0 -128
- package/src/components/Device/EditDeviceWizard/types.ts +0 -22
- package/src/components/Fleet/CreateFleet/types.ts +0 -33
- package/src/setupTests.ts +0 -21
- package/src/tests/test-utils.tsx +0 -21
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesModal.d.ts +0 -0
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesModal.js +0 -0
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.d.ts +0 -0
- /package/dist/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.js +0 -0
- /package/src/components/{UserPreferences → Masthead}/UserPreferencesModal.tsx +0 -0
- /package/src/components/{UserPreferences → Masthead}/UserPreferencesProvider.tsx +0 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStartGraceDuration = exports.getUpdateCronExpression = exports.getWeekDays = exports.getTime = exports.getEndTime = exports.durationToMinutes = exports.Weekday = exports.UpdateScheduleMode = exports.localDeviceTimezone = exports.defaultEndTime = exports.defaultStartTime = exports.formatted24HourClockRegExp = exports.valid24HourClockRegExp = exports.getSelectableTimes = exports.formatTimePart = void 0;
|
|
4
|
+
const formatTimePart = (val) => val.toString().padStart(2, '0');
|
|
5
|
+
exports.formatTimePart = formatTimePart;
|
|
6
|
+
const getSelectableTimes = () => {
|
|
7
|
+
const times = {};
|
|
8
|
+
for (let hour = 0; hour < 24; hour++) {
|
|
9
|
+
for (let minute = 0; minute < 60; minute += 15) {
|
|
10
|
+
const timeString = `${(0, exports.formatTimePart)(hour)}:${(0, exports.formatTimePart)(minute)}`;
|
|
11
|
+
times[timeString] = timeString;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return times;
|
|
15
|
+
};
|
|
16
|
+
exports.getSelectableTimes = getSelectableTimes;
|
|
17
|
+
exports.valid24HourClockRegExp = /^([01]?[0-9]|2[0-3]):?([0-5][0-9])$/;
|
|
18
|
+
exports.formatted24HourClockRegExp = /^([01][0-9]|2[0-3]):([0-5][0-9])$/;
|
|
19
|
+
exports.defaultStartTime = '00:00';
|
|
20
|
+
exports.defaultEndTime = '23:59';
|
|
21
|
+
exports.localDeviceTimezone = 'Local'; // matches the API's default value
|
|
22
|
+
const defaultUpdateDuration = '30m';
|
|
23
|
+
var UpdateScheduleMode;
|
|
24
|
+
(function (UpdateScheduleMode) {
|
|
25
|
+
UpdateScheduleMode["Weekly"] = "weekly";
|
|
26
|
+
UpdateScheduleMode["Daily"] = "daily";
|
|
27
|
+
})(UpdateScheduleMode || (exports.UpdateScheduleMode = UpdateScheduleMode = {}));
|
|
28
|
+
var Weekday;
|
|
29
|
+
(function (Weekday) {
|
|
30
|
+
Weekday[Weekday["Sunday"] = 0] = "Sunday";
|
|
31
|
+
Weekday[Weekday["Monday"] = 1] = "Monday";
|
|
32
|
+
Weekday[Weekday["Tuesday"] = 2] = "Tuesday";
|
|
33
|
+
Weekday[Weekday["Wednesday"] = 3] = "Wednesday";
|
|
34
|
+
Weekday[Weekday["Thursday"] = 4] = "Thursday";
|
|
35
|
+
Weekday[Weekday["Friday"] = 5] = "Friday";
|
|
36
|
+
Weekday[Weekday["Saturday"] = 6] = "Saturday";
|
|
37
|
+
})(Weekday || (exports.Weekday = Weekday = {}));
|
|
38
|
+
var CronParts;
|
|
39
|
+
(function (CronParts) {
|
|
40
|
+
CronParts[CronParts["Minutes"] = 0] = "Minutes";
|
|
41
|
+
CronParts[CronParts["Hours"] = 1] = "Hours";
|
|
42
|
+
CronParts[CronParts["Days"] = 2] = "Days";
|
|
43
|
+
CronParts[CronParts["Months"] = 3] = "Months";
|
|
44
|
+
CronParts[CronParts["WeekDays"] = 4] = "WeekDays";
|
|
45
|
+
})(CronParts || (CronParts = {}));
|
|
46
|
+
const durationToMinutes = (duration) => {
|
|
47
|
+
const timeoutVal = Number(duration.replace(/[shm]/, ''));
|
|
48
|
+
if (!timeoutVal) {
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
|
51
|
+
if (duration.includes('s')) {
|
|
52
|
+
return Math.round(timeoutVal / 60);
|
|
53
|
+
}
|
|
54
|
+
if (duration.includes('h')) {
|
|
55
|
+
return Math.round(timeoutVal * 60);
|
|
56
|
+
}
|
|
57
|
+
return timeoutVal;
|
|
58
|
+
};
|
|
59
|
+
exports.durationToMinutes = durationToMinutes;
|
|
60
|
+
const getEndTime = (startTime, duration) => {
|
|
61
|
+
if (startTime === exports.defaultStartTime && !duration) {
|
|
62
|
+
return exports.defaultEndTime;
|
|
63
|
+
}
|
|
64
|
+
const [hours, minutes] = startTime.split(':').map(Number);
|
|
65
|
+
const durationMinutes = (0, exports.durationToMinutes)(duration || defaultUpdateDuration);
|
|
66
|
+
const totalMinutes = hours * 60 + minutes + durationMinutes;
|
|
67
|
+
const newHours = Math.floor(totalMinutes / 60) % 24;
|
|
68
|
+
const newMinutes = totalMinutes % 60;
|
|
69
|
+
return `${(0, exports.formatTimePart)(newHours)}:${(0, exports.formatTimePart)(newMinutes)}`;
|
|
70
|
+
};
|
|
71
|
+
exports.getEndTime = getEndTime;
|
|
72
|
+
// Cron expression example: "0 4 * * 2,5"
|
|
73
|
+
const getTime = (cronExp) => {
|
|
74
|
+
const tokens = (cronExp || '').split(' ').filter(Boolean);
|
|
75
|
+
if (tokens.length !== 5) {
|
|
76
|
+
return exports.defaultStartTime;
|
|
77
|
+
}
|
|
78
|
+
const hours = tokens[CronParts.Hours];
|
|
79
|
+
const minutes = tokens[CronParts.Minutes];
|
|
80
|
+
// Ensure hours and minutes are valid numbers (eg. fails when specifying ranges or steps)
|
|
81
|
+
if (Number.isNaN(Number(hours)) || Number.isNaN(Number(minutes))) {
|
|
82
|
+
return exports.defaultStartTime;
|
|
83
|
+
}
|
|
84
|
+
return `${(0, exports.formatTimePart)(hours)}:${(0, exports.formatTimePart)(minutes)}`;
|
|
85
|
+
};
|
|
86
|
+
exports.getTime = getTime;
|
|
87
|
+
const getMinuteDifference = (timeA, timeB) => {
|
|
88
|
+
const [aHours, aMinutes] = timeA.split(':').map(Number);
|
|
89
|
+
const [bHours, bMinutes] = timeB.split(':').map(Number);
|
|
90
|
+
const totalMinutesA = aHours * 60 + aMinutes;
|
|
91
|
+
const totalMinutesB = bHours * 60 + bMinutes;
|
|
92
|
+
let difference = totalMinutesB - totalMinutesA;
|
|
93
|
+
// Adjust for crossing midnight by adding 24 hours if A is after B
|
|
94
|
+
if (difference < 0) {
|
|
95
|
+
difference += 24 * 60;
|
|
96
|
+
}
|
|
97
|
+
return difference;
|
|
98
|
+
};
|
|
99
|
+
const getWeekDays = (cronExp) => {
|
|
100
|
+
const defaultDays = [true, true, true, true, true, true, true];
|
|
101
|
+
let selectedDays = defaultDays;
|
|
102
|
+
if (cronExp) {
|
|
103
|
+
const weekDayExp = cronExp.split(' ')[CronParts.WeekDays];
|
|
104
|
+
if (weekDayExp !== '*') {
|
|
105
|
+
const days = weekDayExp.split(',').map(Number);
|
|
106
|
+
selectedDays = defaultDays.map((_, index) => {
|
|
107
|
+
return days.includes(index);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
allSelected: selectedDays.every(Boolean),
|
|
113
|
+
selectedDays,
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
exports.getWeekDays = getWeekDays;
|
|
117
|
+
const getUpdateCronExpression = (startTime, scheduleMode, weekDays) => {
|
|
118
|
+
const [hours, minutes] = startTime.split(':').map(Number);
|
|
119
|
+
const weekDayVals = weekDays
|
|
120
|
+
.map((isActive, index) => {
|
|
121
|
+
return isActive || scheduleMode === UpdateScheduleMode.Daily ? index : null;
|
|
122
|
+
})
|
|
123
|
+
.filter((num) => num !== null);
|
|
124
|
+
return `${minutes} ${hours} * * ${weekDayVals.join(',')}`;
|
|
125
|
+
};
|
|
126
|
+
exports.getUpdateCronExpression = getUpdateCronExpression;
|
|
127
|
+
const getStartGraceDuration = (startTime, endTime) => {
|
|
128
|
+
if (startTime && startTime === endTime) {
|
|
129
|
+
return '24h';
|
|
130
|
+
}
|
|
131
|
+
return `${getMinuteDifference(startTime, endTime)}m`;
|
|
132
|
+
};
|
|
133
|
+
exports.getStartGraceDuration = getStartGraceDuration;
|
|
134
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../../src/utils/time.ts"],"names":[],"mappings":";;;AAEO,MAAM,cAAc,GAAG,CAAC,GAAoB,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAA3E,QAAA,cAAc,kBAA6D;AAEjF,MAAM,kBAAkB,GAAG,GAAG,EAAE;IACrC,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;QACrC,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,EAAE,EAAE,MAAM,IAAI,EAAE,EAAE,CAAC;YAC/C,MAAM,UAAU,GAAG,GAAG,IAAA,sBAAc,EAAC,IAAI,CAAC,IAAI,IAAA,sBAAc,EAAC,MAAM,CAAC,EAAE,CAAC;YACvE,KAAK,CAAC,UAAU,CAAC,GAAG,UAAU,CAAC;QACjC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AATW,QAAA,kBAAkB,sBAS7B;AAEW,QAAA,sBAAsB,GAAG,qCAAqC,CAAC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;QACvC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,GAAG,mBAAmB,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC;AACvD,CAAC,CAAC;AALW,QAAA,qBAAqB,yBAKhC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flightctl/ui-components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -22,9 +22,6 @@
|
|
|
22
22
|
"build": "tsc --build && npm run copy:css",
|
|
23
23
|
"copy:css": "rsync -Rurv --include '*/' --include '*.css' --exclude '*' src dist",
|
|
24
24
|
"dev": "tsc -w",
|
|
25
|
-
"test": "jest",
|
|
26
|
-
"test:watch": "jest --watch",
|
|
27
|
-
"test:coverage": "jest --coverage",
|
|
28
25
|
"ts-node": "ts-node -O '{\"module\":\"commonjs\"}'"
|
|
29
26
|
},
|
|
30
27
|
"devDependencies": {
|
|
@@ -21,7 +21,8 @@ import './DetailsPage.css';
|
|
|
21
21
|
|
|
22
22
|
export type DetailsPageProps = {
|
|
23
23
|
id: string;
|
|
24
|
-
|
|
24
|
+
breadcrumbTitle?: string;
|
|
25
|
+
title?: React.ReactNode;
|
|
25
26
|
children: React.ReactNode;
|
|
26
27
|
error: unknown;
|
|
27
28
|
loading: boolean;
|
|
@@ -32,8 +33,9 @@ export type DetailsPageProps = {
|
|
|
32
33
|
nav?: React.ReactNode;
|
|
33
34
|
};
|
|
34
35
|
|
|
35
|
-
const DetailsPage
|
|
36
|
+
const DetailsPage = ({
|
|
36
37
|
id,
|
|
38
|
+
breadcrumbTitle,
|
|
37
39
|
title,
|
|
38
40
|
children,
|
|
39
41
|
error,
|
|
@@ -43,7 +45,7 @@ const DetailsPage: React.FC<DetailsPageProps> = ({
|
|
|
43
45
|
resourceTypeLabel,
|
|
44
46
|
actions,
|
|
45
47
|
nav,
|
|
46
|
-
}) => {
|
|
48
|
+
}: DetailsPageProps) => {
|
|
47
49
|
const { t } = useTranslation();
|
|
48
50
|
let content = children;
|
|
49
51
|
if (error) {
|
|
@@ -71,7 +73,7 @@ const DetailsPage: React.FC<DetailsPageProps> = ({
|
|
|
71
73
|
<BreadcrumbItem>
|
|
72
74
|
<Link to={resourceLink}>{resourceTypeLabel}</Link>
|
|
73
75
|
</BreadcrumbItem>
|
|
74
|
-
<BreadcrumbItem isActive>{
|
|
76
|
+
<BreadcrumbItem isActive>{breadcrumbTitle || id}</BreadcrumbItem>
|
|
75
77
|
</Breadcrumb>
|
|
76
78
|
</PageSection>
|
|
77
79
|
<PageSection variant="light">
|
|
@@ -104,20 +104,23 @@ const ApplicationsTable = ({
|
|
|
104
104
|
if (!appDetails) {
|
|
105
105
|
// It's an app or a systemd unit which has not been reported yet
|
|
106
106
|
const appAddedTime = addedSystemdUnitDates[appName] || 0;
|
|
107
|
-
// For apps there
|
|
107
|
+
// For apps there is no spinner since we don't know when the app was added to the spec
|
|
108
108
|
const showSpinner = !isApp && Date.now() - appAddedTime < DELETE_SYSTED_TIMEOUT;
|
|
109
109
|
return (
|
|
110
110
|
<Tr key={appName} className="applications-table__row">
|
|
111
111
|
<Td dataLabel={t('Name')}>{appName}</Td>
|
|
112
|
-
|
|
112
|
+
|
|
113
|
+
<Td dataLabel={t('Status')} colSpan={showSpinner ? 3 : 1}>
|
|
113
114
|
{showSpinner ? (
|
|
114
115
|
<>
|
|
115
116
|
<Spinner size="sm" /> {t('Waiting for service to be reported...')}
|
|
116
117
|
</>
|
|
117
118
|
) : (
|
|
118
|
-
|
|
119
|
+
'-'
|
|
119
120
|
)}
|
|
120
121
|
</Td>
|
|
122
|
+
{!showSpinner && <Td dataLabel={t('Ready')}>-</Td>}
|
|
123
|
+
{!showSpinner && <Td dataLabel={t('Restarts')}>-</Td>}
|
|
121
124
|
<Td dataLabel={t('Type')}>
|
|
122
125
|
{isApp ? (
|
|
123
126
|
<>{t('App')}</>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button, List, ListComponent, ListItem, Modal, OrderType, Stack, StackItem } from '@patternfly/react-core';
|
|
3
|
-
import { ExternalLinkAltIcon } from '@patternfly/react-icons/dist/js/icons/external-link-alt-icon';
|
|
4
3
|
|
|
5
4
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
5
|
+
import { ADDING_NEW_DEVICES_LINK } from '../../../links';
|
|
6
|
+
import LearnMoreLink from '../../common/LearnMoreLink';
|
|
6
7
|
|
|
7
8
|
const AddDeviceModal = ({ onClose }: { onClose: VoidFunction }) => {
|
|
8
9
|
const { t } = useTranslation();
|
|
9
10
|
|
|
10
11
|
return (
|
|
11
|
-
<Modal variant="
|
|
12
|
+
<Modal variant="small" title={t('Add devices')} onClose={onClose} isOpen>
|
|
12
13
|
<Stack hasGutter>
|
|
13
14
|
<StackItem>{t('You can add devices following these steps:')}</StackItem>
|
|
14
15
|
<StackItem>
|
|
@@ -20,17 +21,7 @@ const AddDeviceModal = ({ onClose }: { onClose: VoidFunction }) => {
|
|
|
20
21
|
</List>
|
|
21
22
|
</StackItem>
|
|
22
23
|
<StackItem>
|
|
23
|
-
<
|
|
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>
|
|
24
|
+
<LearnMoreLink link={ADDING_NEW_DEVICES_LINK} text={t('Learn more about adding devices')} />
|
|
34
25
|
</StackItem>
|
|
35
26
|
<StackItem className="pf-v5-u-mt-md">
|
|
36
27
|
<Button variant="primary" isInline onClick={onClose}>
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Alert, Button, Grid, GridItem, Icon } from '@patternfly/react-core';
|
|
3
|
+
import { PencilAltIcon } from '@patternfly/react-icons/dist/js/icons/pencil-alt-icon';
|
|
4
|
+
import { Formik, useField } from 'formik';
|
|
5
|
+
import * as Yup from 'yup';
|
|
6
|
+
|
|
7
|
+
import { Device, PatchRequest } from '@flightctl/types';
|
|
8
|
+
import { useFetch } from '../../../hooks/useFetch';
|
|
9
|
+
import { useTranslation } from '../../../hooks/useTranslation';
|
|
10
|
+
import { getErrorMessage } from '../../../utils/error';
|
|
11
|
+
import RichValidationTextField from '../../form/RichValidationTextField';
|
|
12
|
+
import { getLabelValueValidations, validKubernetesLabelValue } from '../../form/validations';
|
|
13
|
+
|
|
14
|
+
type DeviceAliasEditProps = { deviceId: string; hasLabels: boolean; alias?: string; onAliasEdited: VoidFunction };
|
|
15
|
+
type DeviceAliasEditValues = { alias: string };
|
|
16
|
+
|
|
17
|
+
const DeviceAliasInputField = ({
|
|
18
|
+
alias,
|
|
19
|
+
textInputRef,
|
|
20
|
+
toggleIsEditing,
|
|
21
|
+
onSubmit,
|
|
22
|
+
}: {
|
|
23
|
+
alias?: string;
|
|
24
|
+
textInputRef: React.RefObject<HTMLInputElement>;
|
|
25
|
+
toggleIsEditing: VoidFunction;
|
|
26
|
+
onSubmit: ({ alias }: DeviceAliasEditValues) => void;
|
|
27
|
+
}) => {
|
|
28
|
+
const { t } = useTranslation();
|
|
29
|
+
|
|
30
|
+
const [{ value }, , { setTouched, setValue }] = useField<string>('alias');
|
|
31
|
+
|
|
32
|
+
const onAliasKeyDown = React.useCallback(
|
|
33
|
+
async (e: React.KeyboardEvent<HTMLInputElement>) => {
|
|
34
|
+
if (e.key === 'Enter' || e.key === 'Tab') {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
const newErrors = await setTouched(true, true);
|
|
37
|
+
if (Object.keys(newErrors || {}).length === 0) {
|
|
38
|
+
void onSubmit({ alias: (e.target as HTMLInputElement).value });
|
|
39
|
+
}
|
|
40
|
+
} else if (e.key === 'Escape') {
|
|
41
|
+
e.preventDefault();
|
|
42
|
+
setValue(alias || t('Untitled'));
|
|
43
|
+
toggleIsEditing();
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[t, onSubmit, alias, setValue, setTouched, toggleIsEditing],
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<RichValidationTextField
|
|
51
|
+
fieldName="alias"
|
|
52
|
+
ref={textInputRef}
|
|
53
|
+
validations={getLabelValueValidations(t)}
|
|
54
|
+
placeholder={alias || t('Untitled')}
|
|
55
|
+
onKeyDown={onAliasKeyDown}
|
|
56
|
+
onBlur={async () => {
|
|
57
|
+
const newErrors = await setTouched(true, true);
|
|
58
|
+
if (Object.keys(newErrors || {}).length === 0) {
|
|
59
|
+
void onSubmit({ alias: value });
|
|
60
|
+
}
|
|
61
|
+
}}
|
|
62
|
+
/>
|
|
63
|
+
);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const DeviceAliasEdit = ({ deviceId, hasLabels, alias: originalAlias = '', onAliasEdited }: DeviceAliasEditProps) => {
|
|
67
|
+
const { t } = useTranslation();
|
|
68
|
+
const { patch } = useFetch();
|
|
69
|
+
|
|
70
|
+
const textInputRef = React.useRef<HTMLInputElement>(null);
|
|
71
|
+
|
|
72
|
+
const [isEditing, setIsEditing] = React.useState<boolean>();
|
|
73
|
+
const [isSubmitting, setIsSubmitting] = React.useState<boolean>();
|
|
74
|
+
const [submitError, setSubmitError] = React.useState<string>();
|
|
75
|
+
|
|
76
|
+
const toggleIsEditing = React.useCallback(() => {
|
|
77
|
+
setIsEditing((wasEditing) => !wasEditing);
|
|
78
|
+
}, []);
|
|
79
|
+
|
|
80
|
+
React.useEffect(() => {
|
|
81
|
+
// Focus the field after it became editable - before that, the input is not rendered
|
|
82
|
+
if (isEditing) {
|
|
83
|
+
textInputRef?.current?.focus();
|
|
84
|
+
}
|
|
85
|
+
}, [isEditing]);
|
|
86
|
+
|
|
87
|
+
const onSubmit = React.useCallback(
|
|
88
|
+
async ({ alias }: DeviceAliasEditValues) => {
|
|
89
|
+
if (alias === originalAlias || (!hasLabels && !alias)) {
|
|
90
|
+
toggleIsEditing();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const req: PatchRequest = [];
|
|
95
|
+
if (!hasLabels) {
|
|
96
|
+
req.push({
|
|
97
|
+
path: '/metadata/labels',
|
|
98
|
+
op: 'add',
|
|
99
|
+
value: {
|
|
100
|
+
alias,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
} else if (alias) {
|
|
104
|
+
req.push({
|
|
105
|
+
path: '/metadata/labels/alias',
|
|
106
|
+
op: 'replace',
|
|
107
|
+
value: alias,
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
req.push({
|
|
111
|
+
path: '/metadata/labels/alias',
|
|
112
|
+
op: 'remove',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
try {
|
|
117
|
+
setSubmitError(undefined);
|
|
118
|
+
setIsSubmitting(true);
|
|
119
|
+
await patch<Device>(`devices/${deviceId}`, req);
|
|
120
|
+
onAliasEdited();
|
|
121
|
+
toggleIsEditing();
|
|
122
|
+
} catch (e) {
|
|
123
|
+
setSubmitError(getErrorMessage(e));
|
|
124
|
+
} finally {
|
|
125
|
+
setIsSubmitting(false);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
[deviceId, originalAlias, hasLabels, onAliasEdited, patch, toggleIsEditing],
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Grid hasGutter>
|
|
133
|
+
<Formik<DeviceAliasEditValues>
|
|
134
|
+
initialValues={{
|
|
135
|
+
alias: originalAlias,
|
|
136
|
+
}}
|
|
137
|
+
validationSchema={Yup.object({
|
|
138
|
+
alias: validKubernetesLabelValue(t, { isRequired: false, fieldName: t('Alias') }),
|
|
139
|
+
})}
|
|
140
|
+
validateOnBlur
|
|
141
|
+
onSubmit={onSubmit}
|
|
142
|
+
>
|
|
143
|
+
<GridItem md={6}>
|
|
144
|
+
{isEditing ? (
|
|
145
|
+
<DeviceAliasInputField
|
|
146
|
+
alias={originalAlias}
|
|
147
|
+
textInputRef={textInputRef}
|
|
148
|
+
onSubmit={onSubmit}
|
|
149
|
+
toggleIsEditing={toggleIsEditing}
|
|
150
|
+
/>
|
|
151
|
+
) : (
|
|
152
|
+
<>
|
|
153
|
+
{originalAlias || t('Untitled')}
|
|
154
|
+
<Button
|
|
155
|
+
variant="plain"
|
|
156
|
+
aria-label={t('Edit alias')}
|
|
157
|
+
onClick={toggleIsEditing}
|
|
158
|
+
isDisabled={isSubmitting}
|
|
159
|
+
icon={
|
|
160
|
+
<Icon size="md">
|
|
161
|
+
<PencilAltIcon />
|
|
162
|
+
</Icon>
|
|
163
|
+
}
|
|
164
|
+
/>
|
|
165
|
+
</>
|
|
166
|
+
)}
|
|
167
|
+
</GridItem>
|
|
168
|
+
</Formik>
|
|
169
|
+
<GridItem md={8}>
|
|
170
|
+
{submitError && (
|
|
171
|
+
<Alert isInline variant="danger" title={t('Device alias could not be updated')}>
|
|
172
|
+
{getErrorMessage(submitError)}
|
|
173
|
+
</Alert>
|
|
174
|
+
)}
|
|
175
|
+
</GridItem>
|
|
176
|
+
</Grid>
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
export default DeviceAliasEdit;
|
|
@@ -9,6 +9,7 @@ import { getDeviceFleet } from '../../../utils/devices';
|
|
|
9
9
|
import SystemdUnitsModal from '../SystemdUnitsModal/SystemdUnitsModal';
|
|
10
10
|
import ApplicationsTable from '../../DetailsPage/Tables/ApplicationsTable';
|
|
11
11
|
import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
|
|
12
|
+
import { isImageAppProvider } from '../../../types/deviceSpec';
|
|
12
13
|
|
|
13
14
|
type DeviceDetailsTabProps = {
|
|
14
15
|
device: Required<Device>;
|
|
@@ -40,7 +41,13 @@ const DeviceApplications = ({ device, refetch, canEdit }: React.PropsWithChildre
|
|
|
40
41
|
|
|
41
42
|
const isManagedDevice = !!getDeviceFleet(device.metadata);
|
|
42
43
|
const trackedSystemdUnits = device.spec?.systemd?.matchPatterns || [];
|
|
43
|
-
const specApps =
|
|
44
|
+
const specApps =
|
|
45
|
+
device.spec?.applications?.map((app) => {
|
|
46
|
+
if (isImageAppProvider(app)) {
|
|
47
|
+
return app.name || app.image;
|
|
48
|
+
}
|
|
49
|
+
return app.name as string;
|
|
50
|
+
}) || [];
|
|
44
51
|
const apps = device.status.applications; // includes available systemdUnits
|
|
45
52
|
|
|
46
53
|
const deleteSystemdUnit = isManagedDevice
|
|
@@ -18,6 +18,7 @@ import { getEditDisabledReason, isDeviceEnrolled } from '../../../utils/devices'
|
|
|
18
18
|
import { RESOURCE, VERB } from '../../../types/rbac';
|
|
19
19
|
import { useAccessReview } from '../../../hooks/useAccessReview';
|
|
20
20
|
import PageWithPermissions from '../../common/PageWithPermissions';
|
|
21
|
+
import DeviceAliasEdit from './DeviceAliasEdit';
|
|
21
22
|
|
|
22
23
|
type DeviceDetailsPageProps = React.PropsWithChildren<{ hideTerminal?: boolean }>;
|
|
23
24
|
|
|
@@ -33,8 +34,9 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
|
|
|
33
34
|
|
|
34
35
|
const [showDebugInfo, setShowDebugInfo] = React.useState<boolean>(false);
|
|
35
36
|
|
|
36
|
-
const
|
|
37
|
-
const
|
|
37
|
+
const deviceLabels = device?.metadata.labels;
|
|
38
|
+
const deviceAlias = deviceLabels?.alias;
|
|
39
|
+
const isEnrolled = !device || isDeviceEnrolled(device);
|
|
38
40
|
|
|
39
41
|
const [hasTerminalAccess] = useAccessReview(RESOURCE.DEVICE_CONSOLE, VERB.GET);
|
|
40
42
|
const [canDelete] = useAccessReview(RESOURCE.DEVICE, VERB.DELETE);
|
|
@@ -48,7 +50,7 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
|
|
|
48
50
|
await remove(`devices/${deviceId}`);
|
|
49
51
|
navigate(ROUTE.DEVICES);
|
|
50
52
|
},
|
|
51
|
-
resourceName: deviceAlias,
|
|
53
|
+
resourceName: deviceAlias || deviceId,
|
|
52
54
|
resourceType: 'device',
|
|
53
55
|
buttonLabel: isEnrolled ? undefined : t('Delete forever'),
|
|
54
56
|
});
|
|
@@ -70,7 +72,21 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
|
|
|
70
72
|
loading={loading}
|
|
71
73
|
error={error}
|
|
72
74
|
id={deviceId}
|
|
73
|
-
|
|
75
|
+
breadcrumbTitle={deviceAlias}
|
|
76
|
+
title={
|
|
77
|
+
canEdit ? (
|
|
78
|
+
/* key={deviceAlias} is needed for the input field to be initialized with the alias as its value */
|
|
79
|
+
<DeviceAliasEdit
|
|
80
|
+
key={deviceAlias}
|
|
81
|
+
deviceId={deviceId}
|
|
82
|
+
alias={deviceAlias}
|
|
83
|
+
hasLabels={!!deviceLabels}
|
|
84
|
+
onAliasEdited={refetch}
|
|
85
|
+
/>
|
|
86
|
+
) : (
|
|
87
|
+
deviceAlias
|
|
88
|
+
)
|
|
89
|
+
}
|
|
74
90
|
resourceLink={ROUTE.DEVICES}
|
|
75
91
|
resourceType="Devices"
|
|
76
92
|
resourceTypeLabel={t('Devices')}
|
|
@@ -106,7 +122,7 @@ const DeviceDetailsPage = ({ children, hideTerminal }: DeviceDetailsPageProps) =
|
|
|
106
122
|
</DetailsPageActions>
|
|
107
123
|
) : (
|
|
108
124
|
canDelete && (
|
|
109
|
-
<Button aria-label={t('Delete device forever')} variant="danger">
|
|
125
|
+
<Button component="a" aria-label={t('Delete device forever')} variant="danger" tabIndex={0}>
|
|
110
126
|
{deleteAction}
|
|
111
127
|
</Button>
|
|
112
128
|
)
|
|
@@ -19,7 +19,7 @@ import { timeSinceText } from '../../../utils/dates';
|
|
|
19
19
|
import { useTranslation } from '../../../hooks/useTranslation';
|
|
20
20
|
import EditLabelsForm, { ViewLabels } from '../../modals/EditLabelsModal/EditLabelsForm';
|
|
21
21
|
import ResourceLink from '../../common/ResourceLink';
|
|
22
|
-
import
|
|
22
|
+
import LabelWithHelperText from '../../common/WithHelperText';
|
|
23
23
|
import FlightControlDescriptionList from '../../common/FlightCtlDescriptionList';
|
|
24
24
|
import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
|
|
25
25
|
import RepositorySourceList from '../../Repository/RepositoryDetails/RepositorySourceList';
|
|
@@ -137,12 +137,11 @@ const DecommissionedDeviceDetails = ({ device, children }: React.PropsWithChildr
|
|
|
137
137
|
</DescriptionListGroup>
|
|
138
138
|
<DescriptionListGroup>
|
|
139
139
|
<DescriptionListTerm>
|
|
140
|
-
<
|
|
140
|
+
<LabelWithHelperText
|
|
141
|
+
label={t('Status')}
|
|
141
142
|
content={t(
|
|
142
143
|
'Indicates whether the device is available to be managed and assigned to do work or is moving to an end-of-life state.',
|
|
143
144
|
)}
|
|
144
|
-
ariaLabel={t('Status')}
|
|
145
|
-
showLabel
|
|
146
145
|
/>
|
|
147
146
|
</DescriptionListTerm>
|
|
148
147
|
<DescriptionListDescription>
|
|
@@ -11,7 +11,7 @@ import { timeSinceText } from '../../../../utils/dates';
|
|
|
11
11
|
import { useTranslation } from '../../../../hooks/useTranslation';
|
|
12
12
|
import DetailsPageCard, { DetailsPageCardBody } from '../../../DetailsPage/DetailsPageCard';
|
|
13
13
|
import FlightControlDescriptionList from '../../../common/FlightCtlDescriptionList';
|
|
14
|
-
import
|
|
14
|
+
import LabelWithHelperText from '../../../common/WithHelperText';
|
|
15
15
|
import ApplicationSummaryStatus from '../../../Status/ApplicationSummaryStatus';
|
|
16
16
|
import DeviceStatus from '../../../Status/DeviceStatus';
|
|
17
17
|
import SystemUpdateStatus from '../../../Status/SystemUpdateStatus';
|
|
@@ -26,10 +26,9 @@ const StatusContent = ({ device }: { device: Required<Device> }) => {
|
|
|
26
26
|
<FlightControlDescriptionList columnModifier={{ default: '3Col' }}>
|
|
27
27
|
<DescriptionListGroup>
|
|
28
28
|
<DescriptionListTerm>
|
|
29
|
-
<
|
|
29
|
+
<LabelWithHelperText
|
|
30
|
+
label={t('Application status')}
|
|
30
31
|
content={t('Indicates the overall status of application workloads on the device.')}
|
|
31
|
-
ariaLabel={t('Application status')}
|
|
32
|
-
showLabel
|
|
33
32
|
/>
|
|
34
33
|
</DescriptionListTerm>
|
|
35
34
|
<DescriptionListDescription>
|
|
@@ -38,10 +37,9 @@ const StatusContent = ({ device }: { device: Required<Device> }) => {
|
|
|
38
37
|
</DescriptionListGroup>
|
|
39
38
|
<DescriptionListGroup>
|
|
40
39
|
<DescriptionListTerm>
|
|
41
|
-
<
|
|
40
|
+
<LabelWithHelperText
|
|
41
|
+
label={t('Device status')}
|
|
42
42
|
content={t('Indicates the overall status of the device hardware and operating system.')}
|
|
43
|
-
ariaLabel={t('Device status')}
|
|
44
|
-
showLabel
|
|
45
43
|
/>{' '}
|
|
46
44
|
</DescriptionListTerm>
|
|
47
45
|
<DescriptionListDescription>
|
|
@@ -50,12 +48,11 @@ const StatusContent = ({ device }: { device: Required<Device> }) => {
|
|
|
50
48
|
</DescriptionListGroup>
|
|
51
49
|
<DescriptionListGroup>
|
|
52
50
|
<DescriptionListTerm>
|
|
53
|
-
<
|
|
51
|
+
<LabelWithHelperText
|
|
52
|
+
label={t('Update status')}
|
|
54
53
|
content={t(
|
|
55
54
|
'Indicates whether a system is running the latest target configuration or is updating towards it.',
|
|
56
55
|
)}
|
|
57
|
-
ariaLabel={t('Update status')}
|
|
58
|
-
showLabel
|
|
59
56
|
/>
|
|
60
57
|
</DescriptionListTerm>
|
|
61
58
|
<DescriptionListDescription>
|
package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx
CHANGED
|
@@ -23,19 +23,19 @@ const SystemResourcesContent = ({ device }: { device: Required<Device> }) => {
|
|
|
23
23
|
<DescriptionListGroup>
|
|
24
24
|
<DescriptionListTerm>{t('CPU pressure')}</DescriptionListTerm>
|
|
25
25
|
<DescriptionListDescription>
|
|
26
|
-
<DeviceResourceStatus device={device} monitorType="
|
|
26
|
+
<DeviceResourceStatus device={device} monitorType="CPU" />
|
|
27
27
|
</DescriptionListDescription>
|
|
28
28
|
</DescriptionListGroup>
|
|
29
29
|
<DescriptionListGroup>
|
|
30
30
|
<DescriptionListTerm>{t('Disk pressure')}</DescriptionListTerm>
|
|
31
31
|
<DescriptionListDescription>
|
|
32
|
-
<DeviceResourceStatus device={device} monitorType="
|
|
32
|
+
<DeviceResourceStatus device={device} monitorType="Disk" />
|
|
33
33
|
</DescriptionListDescription>
|
|
34
34
|
</DescriptionListGroup>
|
|
35
35
|
<DescriptionListGroup>
|
|
36
36
|
<DescriptionListTerm>{t('Memory pressure')}</DescriptionListTerm>
|
|
37
37
|
<DescriptionListDescription>
|
|
38
|
-
<DeviceResourceStatus device={device} monitorType="
|
|
38
|
+
<DeviceResourceStatus device={device} monitorType="Memory" />
|
|
39
39
|
</DescriptionListDescription>
|
|
40
40
|
</DescriptionListGroup>
|
|
41
41
|
</FlightControlDescriptionList>
|