@flightctl/ui-components 0.4.0 → 0.5.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.
Files changed (384) hide show
  1. package/dist/src/components/DetailsPage/DetailsPageActions.d.ts +11 -4
  2. package/dist/src/components/DetailsPage/DetailsPageActions.d.ts.map +1 -1
  3. package/dist/src/components/DetailsPage/DetailsPageActions.js +15 -4
  4. package/dist/src/components/DetailsPage/DetailsPageActions.js.map +1 -1
  5. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js +1 -1
  6. package/dist/src/components/DetailsPage/Tables/ApplicationsTable.js.map +1 -1
  7. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts +1 -1
  8. package/dist/src/components/Device/DeviceDetails/DeviceApplications.d.ts.map +1 -1
  9. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js +2 -2
  10. package/dist/src/components/Device/DeviceDetails/DeviceApplications.js.map +1 -1
  11. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.d.ts.map +1 -1
  12. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js +22 -15
  13. package/dist/src/components/Device/DeviceDetails/DeviceDetailsPage.js.map +1 -1
  14. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.d.ts.map +1 -1
  15. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js +42 -39
  16. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTab.js.map +1 -1
  17. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts +7 -0
  18. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.d.ts.map +1 -0
  19. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js +41 -0
  20. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.js.map +1 -0
  21. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts +7 -0
  22. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.d.ts.map +1 -0
  23. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js +30 -0
  24. package/dist/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.js.map +1 -0
  25. package/dist/src/components/Device/DeviceDetails/TerminalTab.d.ts.map +1 -1
  26. package/dist/src/components/Device/DeviceDetails/TerminalTab.js +1 -1
  27. package/dist/src/components/Device/DeviceDetails/TerminalTab.js.map +1 -1
  28. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts +16 -0
  29. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.d.ts.map +1 -0
  30. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js +57 -0
  31. package/dist/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.js.map +1 -0
  32. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts +16 -0
  33. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.d.ts.map +1 -0
  34. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js +73 -0
  35. package/dist/src/components/Device/DevicesPage/DecommissionedDevicesTable.js.map +1 -0
  36. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts +10 -0
  37. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.d.ts.map +1 -0
  38. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js +19 -0
  39. package/dist/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.js.map +1 -0
  40. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts +8 -0
  41. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.d.ts.map +1 -0
  42. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js +34 -0
  43. package/dist/src/components/Device/DevicesPage/DevicesEmptyStates.js.map +1 -0
  44. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts +0 -22
  45. package/dist/src/components/Device/DevicesPage/DevicesPage.d.ts.map +1 -1
  46. package/dist/src/components/Device/DevicesPage/DevicesPage.js +9 -92
  47. package/dist/src/components/Device/DevicesPage/DevicesPage.js.map +1 -1
  48. package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts +16 -0
  49. package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.d.ts.map +1 -0
  50. package/dist/src/components/Device/DevicesPage/{DeviceTableRow.js → EnrolledDeviceTableRow.js} +9 -13
  51. package/dist/src/components/Device/DevicesPage/EnrolledDeviceTableRow.js.map +1 -0
  52. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts +23 -0
  53. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.d.ts.map +1 -0
  54. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js +99 -0
  55. package/dist/src/components/Device/DevicesPage/EnrolledDevicesTable.js.map +1 -0
  56. package/dist/src/components/Device/DevicesPage/useDevices.d.ts +2 -0
  57. package/dist/src/components/Device/DevicesPage/useDevices.d.ts.map +1 -1
  58. package/dist/src/components/Device/DevicesPage/useDevices.js +16 -1
  59. package/dist/src/components/Device/DevicesPage/useDevices.js.map +1 -1
  60. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.d.ts.map +1 -1
  61. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js +5 -3
  62. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizard.js.map +1 -1
  63. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js +1 -1
  64. package/dist/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.js.map +1 -1
  65. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.d.ts.map +1 -1
  66. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js +2 -2
  67. package/dist/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.js.map +1 -1
  68. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.d.ts.map +1 -1
  69. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js +1 -1
  70. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.js.map +1 -1
  71. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.d.ts.map +1 -1
  72. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js +1 -1
  73. package/dist/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.js.map +1 -1
  74. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.d.ts.map +1 -1
  75. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js +7 -7
  76. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.js.map +1 -1
  77. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts +9 -0
  78. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.d.ts.map +1 -0
  79. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js +37 -0
  80. package/dist/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.js.map +1 -0
  81. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.d.ts.map +1 -1
  82. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js +6 -4
  83. package/dist/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.js.map +1 -1
  84. package/dist/src/components/Device/EditDeviceWizard/utils.d.ts +1 -1
  85. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.d.ts.map +1 -1
  86. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js +4 -13
  87. package/dist/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.js.map +1 -1
  88. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js +2 -2
  89. package/dist/src/components/EnrollmentRequest/EnrollmentRequestList.js.map +1 -1
  90. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts +2 -2
  91. package/dist/src/components/EnrollmentRequest/EnrollmentRequestTableRow.d.ts.map +1 -1
  92. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts +2 -2
  93. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.d.ts.map +1 -1
  94. package/dist/src/components/EnrollmentRequest/useEnrollmentRequests.js.map +1 -1
  95. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.d.ts.map +1 -1
  96. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js +32 -3
  97. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizard.js.map +1 -1
  98. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.d.ts.map +1 -1
  99. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js +4 -0
  100. package/dist/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.js.map +1 -1
  101. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts +26 -0
  102. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.d.ts.map +1 -0
  103. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js +63 -0
  104. package/dist/src/components/Fleet/CreateFleet/fleetSpecUtils.js.map +1 -0
  105. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.d.ts.map +1 -1
  106. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js +19 -10
  107. package/dist/src/components/Fleet/CreateFleet/steps/ReviewStep.js.map +1 -1
  108. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts +9 -0
  109. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.d.ts.map +1 -0
  110. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js +52 -0
  111. package/dist/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.js.map +1 -0
  112. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts +8 -0
  113. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.d.ts.map +1 -0
  114. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js +95 -0
  115. package/dist/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.js.map +1 -0
  116. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts +4 -0
  117. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.d.ts.map +1 -0
  118. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js +31 -0
  119. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.js.map +1 -0
  120. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts +4 -0
  121. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.d.ts.map +1 -0
  122. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js +78 -0
  123. package/dist/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.js.map +1 -0
  124. package/dist/src/components/Fleet/CreateFleet/types.d.ts +21 -0
  125. package/dist/src/components/Fleet/CreateFleet/types.d.ts.map +1 -1
  126. package/dist/src/components/Fleet/CreateFleet/types.js +6 -0
  127. package/dist/src/components/Fleet/CreateFleet/types.js.map +1 -1
  128. package/dist/src/components/Fleet/CreateFleet/utils.d.ts.map +1 -1
  129. package/dist/src/components/Fleet/CreateFleet/utils.js +15 -1
  130. package/dist/src/components/Fleet/CreateFleet/utils.js.map +1 -1
  131. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.d.ts.map +1 -1
  132. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js +9 -7
  133. package/dist/src/components/Fleet/FleetDetails/FleetDetailsContent.js.map +1 -1
  134. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts +9 -0
  135. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.d.ts.map +1 -0
  136. package/dist/src/components/Fleet/FleetDetails/{FleetDevices.js → FleetDevicesCharts.js} +4 -4
  137. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCharts.js.map +1 -0
  138. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts +10 -0
  139. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.d.ts.map +1 -0
  140. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js +30 -0
  141. package/dist/src/components/Fleet/FleetDetails/FleetDevicesCount.js.map +1 -0
  142. package/dist/src/components/Fleet/FleetResourceSyncs.js +2 -2
  143. package/dist/src/components/Fleet/FleetResourceSyncs.js.map +1 -1
  144. package/dist/src/components/Fleet/FleetRow.d.ts.map +1 -1
  145. package/dist/src/components/Fleet/FleetRow.js +7 -5
  146. package/dist/src/components/Fleet/FleetRow.js.map +1 -1
  147. package/dist/src/components/Fleet/FleetsPage.js +2 -2
  148. package/dist/src/components/Fleet/FleetsPage.js.map +1 -1
  149. package/dist/src/components/Fleet/useFleets.d.ts +3 -3
  150. package/dist/src/components/Fleet/useFleets.d.ts.map +1 -1
  151. package/dist/src/components/Fleet/useFleets.js +3 -3
  152. package/dist/src/components/Fleet/useFleets.js.map +1 -1
  153. package/dist/src/components/ListPage/ListPage.d.ts.map +1 -1
  154. package/dist/src/components/ListPage/ListPage.js +6 -1
  155. package/dist/src/components/ListPage/ListPage.js.map +1 -1
  156. package/dist/src/components/ListPage/ListPageActions.d.ts +8 -15
  157. package/dist/src/components/ListPage/ListPageActions.d.ts.map +1 -1
  158. package/dist/src/components/ListPage/ListPageActions.js +25 -5
  159. package/dist/src/components/ListPage/ListPageActions.js.map +1 -1
  160. package/dist/src/components/ListPage/types.d.ts +11 -11
  161. package/dist/src/components/ListPage/types.d.ts.map +1 -1
  162. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.d.ts.map +1 -1
  163. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js +0 -1
  164. package/dist/src/components/OverviewPage/Cards/Status/DeviceStatusChart.js.map +1 -1
  165. package/dist/src/components/OverviewPage/OverviewPage.d.ts.map +1 -1
  166. package/dist/src/components/OverviewPage/OverviewPage.js +6 -1
  167. package/dist/src/components/OverviewPage/OverviewPage.js.map +1 -1
  168. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js +1 -1
  169. package/dist/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.js.map +1 -1
  170. package/dist/src/components/Repository/useRepositories.d.ts +2 -2
  171. package/dist/src/components/Repository/useRepositories.d.ts.map +1 -1
  172. package/dist/src/components/Repository/useRepositories.js.map +1 -1
  173. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js +2 -2
  174. package/dist/src/components/ResourceSync/RepositoryResourceSyncList.js.map +1 -1
  175. package/dist/src/components/Status/DeviceLifecycleStatus.d.ts +7 -0
  176. package/dist/src/components/Status/DeviceLifecycleStatus.d.ts.map +1 -0
  177. package/dist/src/components/Status/DeviceLifecycleStatus.js +25 -0
  178. package/dist/src/components/Status/DeviceLifecycleStatus.js.map +1 -0
  179. package/dist/src/components/Status/StatusDisplay.d.ts +1 -1
  180. package/dist/src/components/Status/StatusDisplay.d.ts.map +1 -1
  181. package/dist/src/components/Status/StatusDisplay.js +3 -3
  182. package/dist/src/components/Status/StatusDisplay.js.map +1 -1
  183. package/dist/src/components/Table/Table.d.ts.map +1 -1
  184. package/dist/src/components/Table/Table.js +2 -2
  185. package/dist/src/components/Table/Table.js.map +1 -1
  186. package/dist/src/components/Table/TablePagination.d.ts +4 -3
  187. package/dist/src/components/Table/TablePagination.d.ts.map +1 -1
  188. package/dist/src/components/Table/TablePagination.js +6 -5
  189. package/dist/src/components/Table/TablePagination.js.map +1 -1
  190. package/dist/src/components/common/EditableLabelControl.d.ts.map +1 -1
  191. package/dist/src/components/common/EditableLabelControl.js +5 -7
  192. package/dist/src/components/common/EditableLabelControl.js.map +1 -1
  193. package/dist/src/components/common/TechPreviewBadge.d.ts +4 -0
  194. package/dist/src/components/common/TechPreviewBadge.d.ts.map +1 -0
  195. package/dist/src/components/common/TechPreviewBadge.js +23 -0
  196. package/dist/src/components/common/TechPreviewBadge.js.map +1 -0
  197. package/dist/src/components/form/LabelsField.d.ts.map +1 -1
  198. package/dist/src/components/form/LabelsField.js +4 -1
  199. package/dist/src/components/form/LabelsField.js.map +1 -1
  200. package/dist/src/components/form/NumberField.d.ts +10 -0
  201. package/dist/src/components/form/NumberField.d.ts.map +1 -0
  202. package/dist/src/components/form/NumberField.js +51 -0
  203. package/dist/src/components/form/NumberField.js.map +1 -0
  204. package/dist/src/components/form/TextListField.d.ts +12 -0
  205. package/dist/src/components/form/TextListField.d.ts.map +1 -0
  206. package/dist/src/components/form/TextListField.js +46 -0
  207. package/dist/src/components/form/TextListField.js.map +1 -0
  208. package/dist/src/components/form/validations.d.ts +34 -6
  209. package/dist/src/components/form/validations.d.ts.map +1 -1
  210. package/dist/src/components/form/validations.js +78 -4
  211. package/dist/src/components/form/validations.js.map +1 -1
  212. package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts +9 -0
  213. package/dist/src/components/modals/DecommissionModal/DecommissionModal.d.ts.map +1 -0
  214. package/dist/src/components/modals/DecommissionModal/DecommissionModal.js +51 -0
  215. package/dist/src/components/modals/DecommissionModal/DecommissionModal.js.map +1 -0
  216. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts +4 -2
  217. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.d.ts.map +1 -1
  218. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js +11 -4
  219. package/dist/src/components/modals/EditLabelsModal/EditLabelsForm.js.map +1 -1
  220. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts +10 -0
  221. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.d.ts.map +1 -0
  222. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js +67 -0
  223. package/dist/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.js.map +1 -0
  224. package/dist/src/constants.d.ts +1 -1
  225. package/dist/src/constants.d.ts.map +1 -1
  226. package/dist/src/constants.js +1 -1
  227. package/dist/src/constants.js.map +1 -1
  228. package/dist/src/hooks/useAppContext.d.ts +1 -1
  229. package/dist/src/hooks/useAppContext.d.ts.map +1 -1
  230. package/dist/src/hooks/useFetch.d.ts +1 -1
  231. package/dist/src/hooks/useFetchPeriodically.js +10 -10
  232. package/dist/src/hooks/useFetchPeriodically.js.map +1 -1
  233. package/dist/src/hooks/useTablePagination.d.ts +5 -3
  234. package/dist/src/hooks/useTablePagination.d.ts.map +1 -1
  235. package/dist/src/hooks/useTablePagination.js +9 -5
  236. package/dist/src/hooks/useTablePagination.js.map +1 -1
  237. package/dist/src/hooks/useWebSocket.d.ts +1 -1
  238. package/dist/src/hooks/useWebSocket.js +4 -4
  239. package/dist/src/hooks/useWebSocket.js.map +1 -1
  240. package/dist/src/links.d.ts +1 -0
  241. package/dist/src/links.d.ts.map +1 -1
  242. package/dist/src/links.js +2 -1
  243. package/dist/src/links.js.map +1 -1
  244. package/dist/src/types/rbac.d.ts +3 -1
  245. package/dist/src/types/rbac.d.ts.map +1 -1
  246. package/dist/src/types/rbac.js +2 -0
  247. package/dist/src/types/rbac.js.map +1 -1
  248. package/dist/src/utils/api.d.ts +3 -6
  249. package/dist/src/utils/api.d.ts.map +1 -1
  250. package/dist/src/utils/api.js.map +1 -1
  251. package/dist/src/utils/apiCalls.d.ts +2 -0
  252. package/dist/src/utils/apiCalls.d.ts.map +1 -0
  253. package/dist/src/utils/apiCalls.js +23 -0
  254. package/dist/src/utils/apiCalls.js.map +1 -0
  255. package/dist/src/utils/devices.d.ts +6 -3
  256. package/dist/src/utils/devices.d.ts.map +1 -1
  257. package/dist/src/utils/devices.js +20 -1
  258. package/dist/src/utils/devices.js.map +1 -1
  259. package/dist/src/utils/patch.d.ts +4 -1
  260. package/dist/src/utils/patch.d.ts.map +1 -1
  261. package/dist/src/utils/patch.js +166 -9
  262. package/dist/src/utils/patch.js.map +1 -1
  263. package/dist/src/utils/status/common.js +13 -12
  264. package/dist/src/utils/status/common.js.map +1 -1
  265. package/dist/src/utils/status/devices.d.ts +3 -3
  266. package/dist/src/utils/status/devices.d.ts.map +1 -1
  267. package/dist/src/utils/status/devices.js +40 -5
  268. package/dist/src/utils/status/devices.js.map +1 -1
  269. package/dist/src/utils/status/fleet.d.ts +4 -4
  270. package/dist/src/utils/status/fleet.d.ts.map +1 -1
  271. package/dist/src/utils/status/fleet.js +15 -2
  272. package/dist/src/utils/status/fleet.js.map +1 -1
  273. package/dist/src/utils/tooltip.d.ts +7 -0
  274. package/dist/src/utils/tooltip.d.ts.map +1 -0
  275. package/dist/src/utils/tooltip.js +6 -0
  276. package/dist/src/utils/tooltip.js.map +1 -0
  277. package/package.json +1 -1
  278. package/src/components/DetailsPage/DetailsPageActions.tsx +34 -6
  279. package/src/components/DetailsPage/Tables/ApplicationsTable.tsx +1 -1
  280. package/src/components/Device/DeviceDetails/DeviceApplications.tsx +3 -3
  281. package/src/components/Device/DeviceDetails/DeviceDetailsPage.tsx +53 -34
  282. package/src/components/Device/DeviceDetails/DeviceDetailsTab.tsx +71 -54
  283. package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/StatusContent.tsx +75 -0
  284. package/src/components/Device/DeviceDetails/DeviceDetailsTabContent/SystemResourcesContent.tsx +47 -0
  285. package/src/components/Device/DeviceDetails/TerminalTab.tsx +1 -4
  286. package/src/components/Device/DevicesPage/DecommissionedDeviceTableRow.tsx +89 -0
  287. package/src/components/Device/DevicesPage/DecommissionedDevicesTable.tsx +156 -0
  288. package/src/components/Device/DevicesPage/DeviceNameOnlyToolbarFilter.tsx +30 -0
  289. package/src/components/Device/DevicesPage/DevicesEmptyStates.tsx +46 -0
  290. package/src/components/Device/DevicesPage/DevicesPage.tsx +45 -215
  291. package/src/components/Device/DevicesPage/{DeviceTableRow.tsx → EnrolledDeviceTableRow.tsx} +16 -20
  292. package/src/components/Device/DevicesPage/EnrolledDevicesTable.tsx +208 -0
  293. package/src/components/Device/DevicesPage/useDevices.ts +21 -1
  294. package/src/components/Device/EditDeviceWizard/EditDeviceWizard.tsx +6 -3
  295. package/src/components/Device/EditDeviceWizard/EditDeviceWizardNav.tsx +1 -1
  296. package/src/components/Device/EditDeviceWizard/steps/ApplicationTemplates.tsx +2 -0
  297. package/src/components/Device/EditDeviceWizard/steps/ConfigInlineTemplateForm.tsx +1 -0
  298. package/src/components/Device/EditDeviceWizard/steps/ConfigurationTemplates.tsx +1 -0
  299. package/src/components/Device/EditDeviceWizard/steps/ReviewDeviceStep.tsx +27 -19
  300. package/src/components/Device/EditDeviceWizard/steps/ReviewUpdatePolicy.tsx +55 -0
  301. package/src/components/Device/EditDeviceWizard/steps/SystemdUnitsForm.tsx +9 -7
  302. package/src/components/EnrollmentRequest/EnrollmentRequestDetails/EnrollmentRequestDetails.tsx +10 -36
  303. package/src/components/EnrollmentRequest/EnrollmentRequestList.tsx +2 -2
  304. package/src/components/EnrollmentRequest/EnrollmentRequestTableRow.tsx +2 -2
  305. package/src/components/EnrollmentRequest/useEnrollmentRequests.ts +3 -2
  306. package/src/components/Fleet/CreateFleet/CreateFleetWizard.tsx +46 -5
  307. package/src/components/Fleet/CreateFleet/CreateFleetWizardFooter.tsx +4 -0
  308. package/src/components/Fleet/CreateFleet/fleetSpecUtils.ts +62 -0
  309. package/src/components/Fleet/CreateFleet/steps/ReviewStep.tsx +65 -30
  310. package/src/components/Fleet/CreateFleet/steps/UpdateConfirmChangesModal.tsx +87 -0
  311. package/src/components/Fleet/CreateFleet/steps/UpdatePolicyStep.tsx +155 -0
  312. package/src/components/Fleet/CreateFleet/steps/UpdateStepDisruptionBudget.tsx +87 -0
  313. package/src/components/Fleet/CreateFleet/steps/UpdateStepRolloutPolicy.tsx +190 -0
  314. package/src/components/Fleet/CreateFleet/types.ts +25 -0
  315. package/src/components/Fleet/CreateFleet/utils.ts +20 -1
  316. package/src/components/Fleet/FleetDetails/FleetDetailsContent.tsx +10 -7
  317. package/src/components/Fleet/FleetDetails/{FleetDevices.tsx → FleetDevicesCharts.tsx} +4 -4
  318. package/src/components/Fleet/FleetDetails/FleetDevicesCount.tsx +53 -0
  319. package/src/components/Fleet/FleetResourceSyncs.tsx +2 -2
  320. package/src/components/Fleet/FleetRow.tsx +12 -4
  321. package/src/components/Fleet/FleetsPage.tsx +2 -2
  322. package/src/components/Fleet/useFleets.ts +7 -7
  323. package/src/components/ListPage/ListPage.tsx +12 -4
  324. package/src/components/ListPage/ListPageActions.tsx +50 -16
  325. package/src/components/ListPage/types.ts +8 -8
  326. package/src/components/OverviewPage/Cards/Status/DeviceStatusChart.tsx +0 -1
  327. package/src/components/OverviewPage/OverviewPage.tsx +12 -4
  328. package/src/components/Repository/RepositoryDetails/RepositoryResourceSyncsCard.tsx +1 -1
  329. package/src/components/Repository/useRepositories.ts +2 -2
  330. package/src/components/ResourceSync/RepositoryResourceSyncList.tsx +2 -2
  331. package/src/components/Status/DeviceLifecycleStatus.tsx +33 -0
  332. package/src/components/Status/StatusDisplay.tsx +4 -4
  333. package/src/components/Table/Table.tsx +2 -1
  334. package/src/components/Table/TablePagination.tsx +9 -7
  335. package/src/components/common/EditableLabelControl.tsx +7 -6
  336. package/src/components/common/TechPreviewBadge.tsx +43 -0
  337. package/src/components/form/LabelsField.tsx +4 -1
  338. package/src/components/form/NumberField.tsx +78 -0
  339. package/src/components/form/TextListField.tsx +82 -0
  340. package/src/components/form/validations.ts +103 -10
  341. package/src/components/modals/DecommissionModal/DecommissionModal.tsx +95 -0
  342. package/src/components/modals/EditLabelsModal/EditLabelsForm.tsx +9 -8
  343. package/src/components/modals/massModals/MassDecommissionDeviceModal/MassDecommissionDeviceModal.tsx +130 -0
  344. package/src/constants.ts +1 -1
  345. package/src/hooks/useAppContext.tsx +1 -1
  346. package/src/hooks/useFetchPeriodically.ts +11 -11
  347. package/src/hooks/{useTablePagination.tsx → useTablePagination.ts} +13 -7
  348. package/src/hooks/useWebSocket.ts +4 -4
  349. package/src/links.ts +2 -0
  350. package/src/types/rbac.ts +2 -0
  351. package/src/utils/api.ts +13 -6
  352. package/src/utils/apiCalls.ts +15 -0
  353. package/src/utils/devices.ts +21 -3
  354. package/src/utils/patch.ts +182 -8
  355. package/src/utils/status/common.ts +8 -8
  356. package/src/utils/status/devices.ts +39 -8
  357. package/src/utils/status/fleet.ts +21 -6
  358. package/src/utils/tooltip.ts +2 -0
  359. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts +0 -8
  360. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.d.ts.map +0 -1
  361. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js +0 -23
  362. package/dist/src/components/DetailsPage/Tables/IntegrityDetails.js.map +0 -1
  363. package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts +0 -16
  364. package/dist/src/components/Device/DevicesPage/DeviceTableRow.d.ts.map +0 -1
  365. package/dist/src/components/Device/DevicesPage/DeviceTableRow.js.map +0 -1
  366. package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts +0 -9
  367. package/dist/src/components/Fleet/FleetDetails/FleetDevices.d.ts.map +0 -1
  368. package/dist/src/components/Fleet/FleetDetails/FleetDevices.js.map +0 -1
  369. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts +0 -7
  370. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.d.ts.map +0 -1
  371. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js +0 -13
  372. package/dist/src/components/Fleet/FleetDetails/FleetDevicesLink.js.map +0 -1
  373. package/dist/src/components/Status/IntegrityStatus.d.ts +0 -7
  374. package/dist/src/components/Status/IntegrityStatus.d.ts.map +0 -1
  375. package/dist/src/components/Status/IntegrityStatus.js +0 -17
  376. package/dist/src/components/Status/IntegrityStatus.js.map +0 -1
  377. package/dist/src/utils/status/integrity.d.ts +0 -5
  378. package/dist/src/utils/status/integrity.d.ts.map +0 -1
  379. package/dist/src/utils/status/integrity.js +0 -28
  380. package/dist/src/utils/status/integrity.js.map +0 -1
  381. package/src/components/DetailsPage/Tables/IntegrityDetails.tsx +0 -44
  382. package/src/components/Fleet/FleetDetails/FleetDevicesLink.tsx +0 -16
  383. package/src/components/Status/IntegrityStatus.tsx +0 -19
  384. package/src/utils/status/integrity.ts +0 -26
@@ -13,21 +13,22 @@ import {
13
13
  } from '@patternfly/react-core';
14
14
 
15
15
  import { Device } from '@flightctl/types';
16
+ import { isDeviceEnrolled } from '../../../utils/devices';
16
17
  import { timeSinceText } from '../../../utils/dates';
17
- import DeviceStatus from '../../Status/DeviceStatus';
18
+
18
19
  import { useTranslation } from '../../../hooks/useTranslation';
19
- import EditLabelsForm from '../../modals/EditLabelsModal/EditLabelsForm';
20
+ import EditLabelsForm, { ViewLabels } from '../../modals/EditLabelsModal/EditLabelsForm';
20
21
  import ResourceLink from '../../common/ResourceLink';
21
- import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
22
+ import WithHelperText from '../../common/WithHelperText';
22
23
  import FlightControlDescriptionList from '../../common/FlightCtlDescriptionList';
24
+ import DetailsPageCard, { DetailsPageCardBody } from '../../DetailsPage/DetailsPageCard';
23
25
  import RepositorySourceList from '../../Repository/RepositoryDetails/RepositorySourceList';
24
- import ApplicationSummaryStatus from '../../Status/ApplicationSummaryStatus';
25
- import WithHelperText from '../../common/WithHelperText';
26
- import SystemUpdateStatus from '../../Status/SystemUpdateStatus';
27
- import DeviceResourceStatus from '../../Status/DeviceResourceStatus';
26
+ import DeviceLifecycleStatus from '../../Status/DeviceLifecycleStatus';
28
27
  import DeviceFleet from './DeviceFleet';
29
28
  import DeviceOs from './DeviceOs';
30
29
  import DeviceApplications from './DeviceApplications';
30
+ import StatusContent from './DeviceDetailsTabContent/StatusContent';
31
+ import SystemResourcesContent from './DeviceDetailsTabContent/SystemResourcesContent';
31
32
 
32
33
  import './DeviceDetailsTab.css';
33
34
 
@@ -37,9 +38,13 @@ type DeviceDetailsTabProps = {
37
38
  canEdit: boolean;
38
39
  };
39
40
 
40
- const DeviceDetailsTab = ({ device, refetch, children, canEdit }: React.PropsWithChildren<DeviceDetailsTabProps>) => {
41
+ const EnrolledDeviceDetails = ({
42
+ device,
43
+ refetch,
44
+ children,
45
+ canEdit,
46
+ }: React.PropsWithChildren<DeviceDetailsTabProps>) => {
41
47
  const { t } = useTranslation();
42
-
43
48
  return (
44
49
  <Grid hasGutter>
45
50
  <GridItem md={12}>
@@ -68,91 +73,92 @@ const DeviceDetailsTab = ({ device, refetch, children, canEdit }: React.PropsWit
68
73
  <StackItem className="fctl-device-details-tab__label">{t('Labels')}</StackItem>
69
74
  </Stack>
70
75
  <StackItem>
71
- <EditLabelsForm device={device} onDeviceUpdate={refetch} canEdit={canEdit} />
76
+ {canEdit ? (
77
+ <EditLabelsForm device={device} onDeviceUpdate={refetch} />
78
+ ) : (
79
+ <ViewLabels device={device} />
80
+ )}
72
81
  </StackItem>
73
82
  </FlexItem>
74
83
  </Flex>
75
84
  </DetailsPageCardBody>
76
85
  </DetailsPageCard>
77
86
  </GridItem>
87
+ <GridItem md={12} lg={6}>
88
+ <StatusContent device={device} />
89
+ </GridItem>
90
+ <GridItem md={12} lg={6}>
91
+ <SystemResourcesContent device={device} />
92
+ </GridItem>
78
93
  <GridItem md={12} lg={6}>
79
94
  <DetailsPageCard>
80
- <CardTitle>{t('System status')}</CardTitle>
95
+ <CardTitle>{t('Configurations')}</CardTitle>
81
96
  <DetailsPageCardBody>
82
- <FlightControlDescriptionList columnModifier={{ default: '3Col' }}>
83
- <DescriptionListGroup>
84
- <DescriptionListTerm>
85
- <WithHelperText
86
- content={t('Indicates the overall status of application workloads on the device.')}
87
- ariaLabel={t('Application status')}
88
- showLabel
89
- />
90
- </DescriptionListTerm>
91
- <DescriptionListDescription>
92
- <ApplicationSummaryStatus statusSummary={device.status?.applicationsSummary} />
93
- </DescriptionListDescription>
94
- </DescriptionListGroup>
97
+ <FlightControlDescriptionList columnModifier={{ default: '2Col' }}>
95
98
  <DescriptionListGroup>
96
- <DescriptionListTerm>
97
- <WithHelperText
98
- content={t('Indicates the overall status of the device hardware and operating system.')}
99
- ariaLabel={t('Device status')}
100
- showLabel
101
- />{' '}
102
- </DescriptionListTerm>
99
+ <DescriptionListTerm>{t('System image (running)')}</DescriptionListTerm>
103
100
  <DescriptionListDescription>
104
- <DeviceStatus deviceStatus={device.status} />
101
+ <DeviceOs desiredOsImage={device.spec?.os?.image} renderedOsImage={device.status?.os?.image} />
105
102
  </DescriptionListDescription>
106
103
  </DescriptionListGroup>
107
104
  <DescriptionListGroup>
108
105
  <DescriptionListTerm>
109
- <WithHelperText
110
- content={t(
111
- 'Indicates whether a system is running the latest target configuration or is updating towards it.',
112
- )}
113
- ariaLabel={t('Update status')}
114
- showLabel
115
- />
106
+ {t('Sources ({{size}})', { size: device.spec?.config?.length || 0 })}
116
107
  </DescriptionListTerm>
117
108
  <DescriptionListDescription>
118
- <SystemUpdateStatus deviceStatus={device.status} />
109
+ <RepositorySourceList configs={device.spec.config || []} />
119
110
  </DescriptionListDescription>
120
111
  </DescriptionListGroup>
121
- <DescriptionListGroup>
122
- <DescriptionListTerm>{t('Last seen')}</DescriptionListTerm>
123
- <DescriptionListDescription>{timeSinceText(t, device.status.lastSeen)}</DescriptionListDescription>
124
- </DescriptionListGroup>
125
112
  </FlightControlDescriptionList>
126
113
  </DetailsPageCardBody>
127
114
  </DetailsPageCard>
128
115
  </GridItem>
129
116
  <GridItem md={12} lg={6}>
117
+ <DeviceApplications device={device} refetch={refetch} canEdit={canEdit} />
118
+ </GridItem>
119
+ </Grid>
120
+ );
121
+ };
122
+
123
+ const DecommissionedDeviceDetails = ({ device, children }: React.PropsWithChildren<{ device: Required<Device> }>) => {
124
+ const { t } = useTranslation();
125
+
126
+ return (
127
+ <Grid hasGutter>
128
+ <GridItem md={12}>
130
129
  <DetailsPageCard>
131
- <CardTitle>{t('Resource status')}</CardTitle>
132
130
  <DetailsPageCardBody>
133
131
  <FlightControlDescriptionList columnModifier={{ default: '3Col' }}>
134
132
  <DescriptionListGroup>
135
- <DescriptionListTerm>{t('CPU pressure')}</DescriptionListTerm>
133
+ <DescriptionListTerm>{t('Name')}</DescriptionListTerm>
136
134
  <DescriptionListDescription>
137
- <DeviceResourceStatus device={device} monitorType="cpu" />
135
+ <ResourceLink id={device.metadata.name || '-'} />
138
136
  </DescriptionListDescription>
139
137
  </DescriptionListGroup>
140
138
  <DescriptionListGroup>
141
- <DescriptionListTerm>{t('Disk pressure')}</DescriptionListTerm>
139
+ <DescriptionListTerm>
140
+ <WithHelperText
141
+ content={t(
142
+ '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
+ ariaLabel={t('Status')}
145
+ showLabel
146
+ />
147
+ </DescriptionListTerm>
142
148
  <DescriptionListDescription>
143
- <DeviceResourceStatus device={device} monitorType="disk" />
149
+ <DeviceLifecycleStatus device={device} />
144
150
  </DescriptionListDescription>
145
151
  </DescriptionListGroup>
146
152
  <DescriptionListGroup>
147
- <DescriptionListTerm>{t('Memory pressure')}</DescriptionListTerm>
148
- <DescriptionListDescription>
149
- <DeviceResourceStatus device={device} monitorType="memory" />
150
- </DescriptionListDescription>
153
+ <DescriptionListTerm>{t('Last seen')}</DescriptionListTerm>
154
+ <DescriptionListDescription>{timeSinceText(t, device.status.lastSeen)}</DescriptionListDescription>
151
155
  </DescriptionListGroup>
156
+ {children}
152
157
  </FlightControlDescriptionList>
153
158
  </DetailsPageCardBody>
154
159
  </DetailsPageCard>
155
160
  </GridItem>
161
+
156
162
  <GridItem md={12} lg={6}>
157
163
  <DetailsPageCard>
158
164
  <CardTitle>{t('Configurations')}</CardTitle>
@@ -177,10 +183,21 @@ const DeviceDetailsTab = ({ device, refetch, children, canEdit }: React.PropsWit
177
183
  </DetailsPageCard>
178
184
  </GridItem>
179
185
  <GridItem md={12} lg={6}>
180
- <DeviceApplications device={device} refetch={refetch} canEdit={canEdit} />
186
+ <DeviceApplications device={device} canEdit={false} />
181
187
  </GridItem>
182
188
  </Grid>
183
189
  );
184
190
  };
185
191
 
192
+ const DeviceDetailsTab = ({ device, refetch, children, canEdit }: React.PropsWithChildren<DeviceDetailsTabProps>) => {
193
+ const isEnrolled = isDeviceEnrolled(device);
194
+ return isEnrolled ? (
195
+ <EnrolledDeviceDetails device={device} refetch={refetch} canEdit={canEdit}>
196
+ {children}
197
+ </EnrolledDeviceDetails>
198
+ ) : (
199
+ <DecommissionedDeviceDetails device={device}>{children}</DecommissionedDeviceDetails>
200
+ );
201
+ };
202
+
186
203
  export default DeviceDetailsTab;
@@ -0,0 +1,75 @@
1
+ import * as React from 'react';
2
+ import {
3
+ CardTitle,
4
+ DescriptionListDescription,
5
+ DescriptionListGroup,
6
+ DescriptionListTerm,
7
+ } from '@patternfly/react-core';
8
+
9
+ import { Device } from '@flightctl/types';
10
+ import { timeSinceText } from '../../../../utils/dates';
11
+ import { useTranslation } from '../../../../hooks/useTranslation';
12
+ import DetailsPageCard, { DetailsPageCardBody } from '../../../DetailsPage/DetailsPageCard';
13
+ import FlightControlDescriptionList from '../../../common/FlightCtlDescriptionList';
14
+ import WithHelperText from '../../../common/WithHelperText';
15
+ import ApplicationSummaryStatus from '../../../Status/ApplicationSummaryStatus';
16
+ import DeviceStatus from '../../../Status/DeviceStatus';
17
+ import SystemUpdateStatus from '../../../Status/SystemUpdateStatus';
18
+
19
+ const StatusContent = ({ device }: { device: Required<Device> }) => {
20
+ const { t } = useTranslation();
21
+
22
+ return (
23
+ <DetailsPageCard>
24
+ <CardTitle>{t('System status')}</CardTitle>
25
+ <DetailsPageCardBody>
26
+ <FlightControlDescriptionList columnModifier={{ default: '3Col' }}>
27
+ <DescriptionListGroup>
28
+ <DescriptionListTerm>
29
+ <WithHelperText
30
+ content={t('Indicates the overall status of application workloads on the device.')}
31
+ ariaLabel={t('Application status')}
32
+ showLabel
33
+ />
34
+ </DescriptionListTerm>
35
+ <DescriptionListDescription>
36
+ <ApplicationSummaryStatus statusSummary={device.status.applicationsSummary} />
37
+ </DescriptionListDescription>
38
+ </DescriptionListGroup>
39
+ <DescriptionListGroup>
40
+ <DescriptionListTerm>
41
+ <WithHelperText
42
+ content={t('Indicates the overall status of the device hardware and operating system.')}
43
+ ariaLabel={t('Device status')}
44
+ showLabel
45
+ />{' '}
46
+ </DescriptionListTerm>
47
+ <DescriptionListDescription>
48
+ <DeviceStatus deviceStatus={device.status} />
49
+ </DescriptionListDescription>
50
+ </DescriptionListGroup>
51
+ <DescriptionListGroup>
52
+ <DescriptionListTerm>
53
+ <WithHelperText
54
+ content={t(
55
+ 'Indicates whether a system is running the latest target configuration or is updating towards it.',
56
+ )}
57
+ ariaLabel={t('Update status')}
58
+ showLabel
59
+ />
60
+ </DescriptionListTerm>
61
+ <DescriptionListDescription>
62
+ <SystemUpdateStatus deviceStatus={device.status} />
63
+ </DescriptionListDescription>
64
+ </DescriptionListGroup>
65
+ <DescriptionListGroup>
66
+ <DescriptionListTerm>{t('Last seen')}</DescriptionListTerm>
67
+ <DescriptionListDescription>{timeSinceText(t, device.status.lastSeen)}</DescriptionListDescription>
68
+ </DescriptionListGroup>
69
+ </FlightControlDescriptionList>
70
+ </DetailsPageCardBody>
71
+ </DetailsPageCard>
72
+ );
73
+ };
74
+
75
+ export default StatusContent;
@@ -0,0 +1,47 @@
1
+ import * as React from 'react';
2
+ import {
3
+ CardTitle,
4
+ DescriptionListDescription,
5
+ DescriptionListGroup,
6
+ DescriptionListTerm,
7
+ } from '@patternfly/react-core';
8
+
9
+ import { Device } from '@flightctl/types';
10
+ import { useTranslation } from '../../../../hooks/useTranslation';
11
+ import DetailsPageCard, { DetailsPageCardBody } from '../../../DetailsPage/DetailsPageCard';
12
+ import FlightControlDescriptionList from '../../../common/FlightCtlDescriptionList';
13
+ import DeviceResourceStatus from '../../../Status/DeviceResourceStatus';
14
+
15
+ const SystemResourcesContent = ({ device }: { device: Required<Device> }) => {
16
+ const { t } = useTranslation();
17
+
18
+ return (
19
+ <DetailsPageCard>
20
+ <CardTitle>{t('Resource status')}</CardTitle>
21
+ <DetailsPageCardBody>
22
+ <FlightControlDescriptionList columnModifier={{ default: '3Col' }}>
23
+ <DescriptionListGroup>
24
+ <DescriptionListTerm>{t('CPU pressure')}</DescriptionListTerm>
25
+ <DescriptionListDescription>
26
+ <DeviceResourceStatus device={device} monitorType="cpu" />
27
+ </DescriptionListDescription>
28
+ </DescriptionListGroup>
29
+ <DescriptionListGroup>
30
+ <DescriptionListTerm>{t('Disk pressure')}</DescriptionListTerm>
31
+ <DescriptionListDescription>
32
+ <DeviceResourceStatus device={device} monitorType="disk" />
33
+ </DescriptionListDescription>
34
+ </DescriptionListGroup>
35
+ <DescriptionListGroup>
36
+ <DescriptionListTerm>{t('Memory pressure')}</DescriptionListTerm>
37
+ <DescriptionListDescription>
38
+ <DeviceResourceStatus device={device} monitorType="memory" />
39
+ </DescriptionListDescription>
40
+ </DescriptionListGroup>
41
+ </FlightControlDescriptionList>
42
+ </DetailsPageCardBody>
43
+ </DetailsPageCard>
44
+ );
45
+ };
46
+
47
+ export default SystemResourcesContent;
@@ -23,10 +23,7 @@ const TerminalTab = ({ device }: TerminalTabProps) => {
23
23
  terminal.current?.onDataReceived(msg);
24
24
  }, []);
25
25
 
26
- const { sendMessage, isClosed, error, reconnect } = useWebSocket(
27
- `/api/terminal/${device.metadata.name}`,
28
- onMsgReceived,
29
- );
26
+ const { sendMessage, isClosed, error, reconnect } = useWebSocket(device.metadata.name || '', onMsgReceived);
30
27
 
31
28
  if (error) {
32
29
  return <ErrorAlert error={error} />;
@@ -0,0 +1,89 @@
1
+ import * as React from 'react';
2
+ import { ActionsColumn, OnSelect, Td, Tr } from '@patternfly/react-table';
3
+
4
+ import { Device } from '@flightctl/types';
5
+ import { timeSinceText } from '../../../utils/dates';
6
+ import { ListAction } from '../../ListPage/types';
7
+ import { useTranslation } from '../../../hooks/useTranslation';
8
+ import { ROUTE, useNavigate } from '../../../hooks/useNavigate';
9
+ import ResourceLink from '../../common/ResourceLink';
10
+ import DeviceLifecycleStatus from '../../Status/DeviceLifecycleStatus';
11
+
12
+ type DecommissionedDeviceTableRowProps = {
13
+ device: Device;
14
+ rowIndex: number;
15
+ onRowSelect: (device: Device) => OnSelect;
16
+ isRowSelected: (device: Device) => boolean;
17
+ canDelete: boolean;
18
+ canEdit: boolean;
19
+ deleteAction: ListAction;
20
+ };
21
+
22
+ const DecommissionedDeviceTableRow = ({
23
+ device,
24
+ deleteAction,
25
+ rowIndex,
26
+ onRowSelect,
27
+ isRowSelected,
28
+ canDelete,
29
+ canEdit,
30
+ }: DecommissionedDeviceTableRowProps) => {
31
+ const { t } = useTranslation();
32
+ const navigate = useNavigate();
33
+
34
+ const deviceName = device.metadata.name as string;
35
+ const deviceAlias = device.metadata.labels?.alias;
36
+
37
+ return (
38
+ <Tr>
39
+ <Td
40
+ select={{
41
+ rowIndex,
42
+ onSelect: onRowSelect(device),
43
+ isSelected: isRowSelected(device),
44
+ }}
45
+ />
46
+ <Td dataLabel={t('Name')}>
47
+ <ResourceLink id={deviceName} routeLink={ROUTE.DEVICE_DETAILS} />
48
+ </Td>
49
+ <Td dataLabel={t('Device status')}>
50
+ <DeviceLifecycleStatus device={device} />
51
+ </Td>
52
+ <Td dataLabel={t('Last seen')}>{timeSinceText(t, device.status?.lastSeen)}</Td>
53
+ {canDelete && (
54
+ <Td isActionCell>
55
+ <ActionsColumn
56
+ items={[
57
+ ...(canEdit
58
+ ? [
59
+ {
60
+ title: t('Edit device configurations'),
61
+ onClick: () => navigate({ route: ROUTE.DEVICE_EDIT, postfix: deviceName }),
62
+ isAriaDisabled: true,
63
+ tooltipProps: {
64
+ content: t('Device already started decommissioning and cannot be edited.'),
65
+ },
66
+ },
67
+ ]
68
+ : []),
69
+ {
70
+ title: t('View device details'),
71
+ onClick: () => navigate({ route: ROUTE.DEVICE_DETAILS, postfix: deviceName }),
72
+ },
73
+ ...(canDelete
74
+ ? [
75
+ deleteAction({
76
+ resourceId: deviceName,
77
+ resourceName: deviceAlias,
78
+ }),
79
+ ]
80
+ : []),
81
+ ]}
82
+ />
83
+ </Td>
84
+ )}
85
+ </Tr>
86
+ );
87
+ };
88
+
89
+ export default DecommissionedDeviceTableRow;
@@ -0,0 +1,156 @@
1
+ import * as React from 'react';
2
+ import { Button, Switch, Toolbar, ToolbarContent, ToolbarGroup, ToolbarItem } from '@patternfly/react-core';
3
+ import { Tbody } from '@patternfly/react-table';
4
+ import { TFunction } from 'react-i18next';
5
+
6
+ import { Device, DeviceList } from '@flightctl/types';
7
+
8
+ import { PaginationDetails } from '../../../hooks/useTablePagination';
9
+ import { useTranslation } from '../../../hooks/useTranslation';
10
+ import { useTableSelect } from '../../../hooks/useTableSelect';
11
+ import { useAccessReview } from '../../../hooks/useAccessReview';
12
+ import { useFetch } from '../../../hooks/useFetch';
13
+ import { RESOURCE, VERB } from '../../../types/rbac';
14
+
15
+ import Table, { ApiSortTableColumn } from '../../Table/Table';
16
+ import { useDeleteListAction } from '../../ListPage/ListPageActions';
17
+ import TablePagination from '../../Table/TablePagination';
18
+ import MassDeleteDeviceModal from '../../modals/massModals/MassDeleteDeviceModal/MassDeleteDeviceModal';
19
+ import AddDeviceModal from '../AddDeviceModal/AddDeviceModal';
20
+ import { DecommissionedDevicesEmptyState } from './DevicesEmptyStates';
21
+ import DecommissionedDeviceTableRow from './DecommissionedDeviceTableRow';
22
+ import DeviceNameOnlyToolbarFilter from './DeviceNameOnlyToolbarFilter';
23
+
24
+ interface DecommissionedDevicesTableProps {
25
+ devices: Array<Device>;
26
+ refetch: VoidFunction;
27
+ nameOrAlias: string | undefined;
28
+ setOnlyDecommissioned: (check: boolean) => void;
29
+ setNameOrAlias: (text: string) => void;
30
+ hasFiltersEnabled: boolean;
31
+ isFilterUpdating: boolean;
32
+ pagination: Pick<PaginationDetails<DeviceList>, 'currentPage' | 'setCurrentPage' | 'itemCount'>;
33
+ }
34
+
35
+ const getDeviceColumns = (t: TFunction): ApiSortTableColumn[] => [
36
+ {
37
+ name: t('Name'),
38
+ },
39
+ {
40
+ name: t('Status'),
41
+ },
42
+ {
43
+ name: t('Last seen'),
44
+ },
45
+ ];
46
+
47
+ const DecommissionedDevicesTable = ({
48
+ devices,
49
+ refetch,
50
+ nameOrAlias,
51
+ setNameOrAlias,
52
+ hasFiltersEnabled,
53
+ setOnlyDecommissioned,
54
+ isFilterUpdating,
55
+ pagination,
56
+ }: DecommissionedDevicesTableProps) => {
57
+ const { t } = useTranslation();
58
+ const [addDeviceModal, setAddDeviceModal] = React.useState(false);
59
+ const [isMassDeleteModalOpen, setIsMassDeleteModalOpen] = React.useState(false);
60
+ const { remove } = useFetch();
61
+ const deviceColumns = React.useMemo(() => getDeviceColumns(t), [t]);
62
+
63
+ const { onRowSelect, hasSelectedRows, isAllSelected, isRowSelected, setAllSelected } = useTableSelect();
64
+
65
+ const { action: deleteDeviceAction, modal: deleteDeviceModal } = useDeleteListAction({
66
+ resourceType: 'Device',
67
+ onConfirm: async (resourceId: string) => {
68
+ await remove(`devices/${resourceId}`);
69
+ refetch();
70
+ },
71
+ });
72
+
73
+ const [canDelete] = useAccessReview(RESOURCE.DEVICE, VERB.DELETE);
74
+ const [canEdit] = useAccessReview(RESOURCE.DEVICE, VERB.PATCH);
75
+
76
+ return (
77
+ <>
78
+ <Toolbar id="decommissioned-devices-toolbar" inset={{ default: 'insetNone' }}>
79
+ <ToolbarContent>
80
+ <ToolbarGroup>
81
+ <ToolbarItem variant="search-filter">
82
+ <DeviceNameOnlyToolbarFilter nameOrAlias={nameOrAlias} setNameOrAlias={setNameOrAlias} />
83
+ </ToolbarItem>
84
+ <ToolbarItem>
85
+ <Button aria-label={t('Add devices')} onClick={() => setAddDeviceModal(true)}>
86
+ {t('Add devices')}
87
+ </Button>
88
+ </ToolbarItem>
89
+ {canDelete && (
90
+ <ToolbarItem>
91
+ <Button
92
+ isDisabled={!hasSelectedRows}
93
+ onClick={() => setIsMassDeleteModalOpen(true)}
94
+ variant="secondary"
95
+ >
96
+ {t('Delete forever')}
97
+ </Button>
98
+ </ToolbarItem>
99
+ )}
100
+ <ToolbarItem alignSelf="center">
101
+ <Switch
102
+ id="decommissioned-devices-switch"
103
+ label={t('Show only decommissioned devices')}
104
+ isChecked
105
+ onChange={() => {
106
+ setOnlyDecommissioned(false);
107
+ }}
108
+ ouiaId={t('Show only decommissioned devices')}
109
+ />
110
+ </ToolbarItem>
111
+ </ToolbarGroup>
112
+ </ToolbarContent>
113
+ </Toolbar>
114
+ <Table
115
+ aria-label={t('Devices table')}
116
+ loading={isFilterUpdating}
117
+ columns={deviceColumns}
118
+ emptyFilters={!hasFiltersEnabled}
119
+ emptyData={devices.length === 0}
120
+ isAllSelected={isAllSelected}
121
+ onSelectAll={setAllSelected}
122
+ >
123
+ <Tbody>
124
+ {devices.map((device, index) => (
125
+ <DecommissionedDeviceTableRow
126
+ key={device.metadata.name || ''}
127
+ device={device}
128
+ deleteAction={deleteDeviceAction}
129
+ onRowSelect={onRowSelect}
130
+ isRowSelected={isRowSelected}
131
+ rowIndex={index}
132
+ canDelete={canDelete}
133
+ canEdit={canEdit}
134
+ />
135
+ ))}
136
+ </Tbody>
137
+ </Table>
138
+ <TablePagination isUpdating={isFilterUpdating} pagination={pagination} />
139
+ {!hasFiltersEnabled && devices.length === 0 && <DecommissionedDevicesEmptyState />}
140
+ {deleteDeviceModal}
141
+ {addDeviceModal && <AddDeviceModal onClose={() => setAddDeviceModal(false)} />}
142
+ {isMassDeleteModalOpen && (
143
+ <MassDeleteDeviceModal
144
+ onClose={() => setIsMassDeleteModalOpen(false)}
145
+ resources={devices.filter(isRowSelected)}
146
+ onDeleteSuccess={() => {
147
+ setIsMassDeleteModalOpen(false);
148
+ refetch();
149
+ }}
150
+ />
151
+ )}
152
+ </>
153
+ );
154
+ };
155
+
156
+ export default DecommissionedDevicesTable;
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import debounce from 'lodash/debounce';
3
+
4
+ import TableTextSearch, { TableTextSearchProps } from '../../Table/TableTextSearch';
5
+
6
+ import './DeviceToolbarFilters.css';
7
+
8
+ type DeviceNameOnlyToolbarFilterProps = {
9
+ nameOrAlias?: TableTextSearchProps['value'];
10
+ setNameOrAlias: TableTextSearchProps['setValue'];
11
+ };
12
+
13
+ const DeviceNameOnlyToolbarFilter = ({ setNameOrAlias }: DeviceNameOnlyToolbarFilterProps) => {
14
+ const [typingText, setTypingText] = React.useState<string>('');
15
+ const debouncedSetParam = React.useMemo(
16
+ () =>
17
+ debounce((setValue: TableTextSearchProps['setValue'], value: string) => {
18
+ setValue(value || '');
19
+ }, 500),
20
+ [],
21
+ );
22
+
23
+ React.useEffect(() => {
24
+ debouncedSetParam(setNameOrAlias, typingText);
25
+ }, [typingText, setNameOrAlias, debouncedSetParam]);
26
+
27
+ return <TableTextSearch value={typingText} setValue={setTypingText} />;
28
+ };
29
+
30
+ export default DeviceNameOnlyToolbarFilter;
@@ -0,0 +1,46 @@
1
+ import * as React from 'react';
2
+ import { Trans } from 'react-i18next';
3
+ import { Button, EmptyStateActions, EmptyStateBody, EmptyStateFooter } from '@patternfly/react-core';
4
+ import MicrochipIcon from '@patternfly/react-icons/dist/js/icons/microchip-icon';
5
+ import BanIcon from '@patternfly/react-icons/dist/js/icons/ban-icon';
6
+
7
+ import { useAccessReview } from '../../../hooks/useAccessReview';
8
+ import { useTranslation } from '../../../hooks/useTranslation';
9
+ import { Link, ROUTE } from '../../../hooks/useNavigate';
10
+ import { RESOURCE, VERB } from '../../../types/rbac';
11
+ import ResourceListEmptyState from '../../common/ResourceListEmptyState';
12
+
13
+ type DevicesEmptyStateProps = {
14
+ onAddDevice: VoidFunction;
15
+ };
16
+
17
+ export const EnrolledDevicesEmptyState = ({ onAddDevice }: DevicesEmptyStateProps) => {
18
+ const { t } = useTranslation();
19
+ const [canCreateFleet] = useAccessReview(RESOURCE.FLEET, VERB.CREATE);
20
+ return (
21
+ <ResourceListEmptyState icon={MicrochipIcon} titleText={t('No devices here!')}>
22
+ <EmptyStateBody>
23
+ {canCreateFleet ? (
24
+ <Trans t={t}>
25
+ You can add devices and label them to match fleets, or you can{' '}
26
+ <Link to={ROUTE.FLEET_CREATE}>start with a fleet</Link> and add devices into it.
27
+ </Trans>
28
+ ) : (
29
+ t('You can add devices and label them to match fleets')
30
+ )}
31
+ </EmptyStateBody>
32
+ <EmptyStateFooter>
33
+ <EmptyStateActions>
34
+ <Button aria-label={t('Add devices')} onClick={onAddDevice}>
35
+ {t('Add devices')}
36
+ </Button>
37
+ </EmptyStateActions>
38
+ </EmptyStateFooter>
39
+ </ResourceListEmptyState>
40
+ );
41
+ };
42
+
43
+ export const DecommissionedDevicesEmptyState = () => {
44
+ const { t } = useTranslation();
45
+ return <ResourceListEmptyState icon={BanIcon} titleText={t('No decommissioning or decommissioned devices here!')} />;
46
+ };