@prorobotech/openapi-k8s-toolkit 1.1.0-alpha.1 → 1.1.0-alpha.10

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 (209) hide show
  1. package/dist/openapi-k8s-toolkit.es.js +1323 -590
  2. package/dist/openapi-k8s-toolkit.es.js.map +1 -1
  3. package/dist/openapi-k8s-toolkit.umd.js +1327 -589
  4. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  5. package/dist/types/components/atoms/CursorDefaultDiv/CursorDefaultDiv.d.ts +2 -2
  6. package/dist/types/components/atoms/CursorDefaultDiv/index.d.ts +1 -1
  7. package/dist/types/components/atoms/CursorPointerTag/index.d.ts +1 -1
  8. package/dist/types/components/atoms/CursorPointerTagMinContent/index.d.ts +1 -1
  9. package/dist/types/components/atoms/CustomSelect/index.d.ts +1 -1
  10. package/dist/types/components/atoms/FlexGrow/index.d.ts +1 -1
  11. package/dist/types/components/atoms/PaddingContainer/index.d.ts +1 -1
  12. package/dist/types/components/atoms/ResourceLink/ResourceLink.d.ts +19 -0
  13. package/dist/types/components/atoms/ResourceLink/index.d.ts +1 -0
  14. package/dist/types/components/atoms/ResourceLink/styled.d.ts +8 -0
  15. package/dist/types/components/atoms/UncontrolledSelect/index.d.ts +1 -1
  16. package/dist/types/components/atoms/index.d.ts +19 -13
  17. package/dist/types/components/molecules/BlackholeForm/atoms/ArrayInsideContainer/ArrayInsideContainer.d.ts +2 -2
  18. package/dist/types/components/molecules/BlackholeForm/atoms/ArrayInsideContainer/index.d.ts +1 -1
  19. package/dist/types/components/molecules/BlackholeForm/atoms/CustomCollapse/index.d.ts +1 -1
  20. package/dist/types/components/molecules/BlackholeForm/atoms/CustomSizeTitle/index.d.ts +1 -1
  21. package/dist/types/components/molecules/BlackholeForm/atoms/DebugNameViewer/index.d.ts +1 -1
  22. package/dist/types/components/molecules/BlackholeForm/atoms/HeightContainer/index.d.ts +1 -1
  23. package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/HiddenContainer.d.ts +4 -2
  24. package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/index.d.ts +1 -1
  25. package/dist/types/components/molecules/BlackholeForm/atoms/PersistedCheckbox/index.d.ts +1 -1
  26. package/dist/types/components/molecules/BlackholeForm/atoms/PossibleHiddenContainer/index.d.ts +1 -1
  27. package/dist/types/components/molecules/BlackholeForm/atoms/ResetedFormItem/index.d.ts +1 -1
  28. package/dist/types/components/molecules/BlackholeForm/atoms/index.d.ts +9 -9
  29. package/dist/types/components/molecules/BlackholeForm/index.d.ts +2 -1
  30. package/dist/types/components/molecules/BlackholeForm/molecules/FormArrayHeader/index.d.ts +1 -1
  31. package/dist/types/components/molecules/BlackholeForm/molecules/FormBooleanInput/index.d.ts +1 -1
  32. package/dist/types/components/molecules/BlackholeForm/molecules/FormEnumStringInput/index.d.ts +1 -1
  33. package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/FormInlineYamlEditor.d.ts +4 -2
  34. package/dist/types/components/molecules/BlackholeForm/molecules/FormInlineYamlEditor/index.d.ts +1 -1
  35. package/dist/types/components/molecules/BlackholeForm/molecules/FormListInput/index.d.ts +1 -1
  36. package/dist/types/components/molecules/BlackholeForm/molecules/FormNamespaceInput/index.d.ts +1 -1
  37. package/dist/types/components/molecules/BlackholeForm/molecules/FormNumberInput/index.d.ts +1 -1
  38. package/dist/types/components/molecules/BlackholeForm/molecules/FormObjectFromSwagger/index.d.ts +1 -1
  39. package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/index.d.ts +1 -1
  40. package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/molecules/RangeInput/index.d.ts +1 -1
  41. package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/molecules/index.d.ts +1 -1
  42. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringInput/index.d.ts +1 -1
  43. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/index.d.ts +1 -1
  44. package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditor/index.d.ts +1 -1
  45. package/dist/types/components/molecules/BlackholeForm/molecules/YamlEditorSingleton/index.d.ts +1 -1
  46. package/dist/types/components/molecules/BlackholeForm/molecules/index.d.ts +13 -13
  47. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.d.ts +2 -3
  48. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/index.d.ts +1 -0
  49. package/dist/types/components/molecules/BlackholeForm/organisms/{BlackholeFormDataProvider/BlackholeFormDataProvider.d.ts → BlackholeFormProvider/BlackholeFormProvider.d.ts} +2 -2
  50. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/index.d.ts +2 -0
  51. package/dist/types/components/molecules/BlackholeForm/organisms/index.d.ts +4 -2
  52. package/dist/types/components/molecules/EnrichedTable/index.d.ts +2 -1
  53. package/dist/types/components/molecules/EnrichedTable/molecules/index.d.ts +1 -1
  54. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/FilterDropdown/index.d.ts +1 -1
  55. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/ShortenedTextWithTooltip/index.d.ts +1 -1
  56. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TableComponents/index.d.ts +1 -1
  57. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TextAlignContainer/index.d.ts +1 -1
  58. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TinyButton/index.d.ts +1 -1
  59. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/TrimmedTags/index.d.ts +1 -1
  60. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/atoms/index.d.ts +6 -6
  61. package/dist/types/components/molecules/EnrichedTable/organisms/index.d.ts +4 -2
  62. package/dist/types/components/molecules/Events/Events.d.ts +3 -2
  63. package/dist/types/components/molecules/Events/index.d.ts +1 -0
  64. package/dist/types/components/molecules/Events/molecules/EventRow/EventRow.d.ts +1 -0
  65. package/dist/types/components/molecules/Events/molecules/EventRow/utils.d.ts +0 -20
  66. package/dist/types/components/molecules/ManageableBreadcrumbs/index.d.ts +2 -3
  67. package/dist/types/components/molecules/ManageableBreadcrumbs/molecules/CollapsibleBreadcrumb/index.d.ts +1 -1
  68. package/dist/types/components/molecules/ManageableBreadcrumbs/molecules/index.d.ts +1 -1
  69. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbs/ManageableBreadcrumbs.d.ts +8 -0
  70. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbs/index.d.ts +2 -0
  71. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/ManageableBreadcrumbsProvider.d.ts +12 -0
  72. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/index.d.ts +3 -0
  73. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/styled.d.ts +276 -0
  74. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/index.d.ts +4 -0
  75. package/dist/types/components/molecules/ManageableSidebar/index.d.ts +2 -3
  76. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebar/ManageableSidebar.d.ts +10 -0
  77. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebar/index.d.ts +2 -0
  78. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/ManageableSidebarProvider.d.ts +15 -0
  79. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/index.d.ts +3 -0
  80. package/dist/types/components/molecules/ManageableSidebar/organisms/index.d.ts +4 -0
  81. package/dist/types/components/molecules/MarketPlace/atoms/AddCard/index.d.ts +1 -1
  82. package/dist/types/components/molecules/MarketPlace/atoms/index.d.ts +1 -1
  83. package/dist/types/components/molecules/MarketPlace/molecules/AddEditFormModal/index.d.ts +1 -1
  84. package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/index.d.ts +2 -1
  85. package/dist/types/components/molecules/MarketPlace/molecules/SearchTextInput/index.d.ts +1 -1
  86. package/dist/types/components/molecules/MarketPlace/molecules/index.d.ts +4 -3
  87. package/dist/types/components/molecules/ProjectInfoCard/molecules/DropdownAccessGroups/index.d.ts +1 -1
  88. package/dist/types/components/molecules/ProjectInfoCard/molecules/DropdownActions/index.d.ts +1 -1
  89. package/dist/types/components/molecules/ProjectInfoCard/molecules/index.d.ts +2 -2
  90. package/dist/types/components/molecules/Search/Search.d.ts +1 -2
  91. package/dist/types/components/molecules/Search/index.d.ts +1 -0
  92. package/dist/types/components/molecules/Terminals/NodeTerminal/molecules/XTerminal/index.d.ts +1 -1
  93. package/dist/types/components/molecules/Terminals/NodeTerminal/molecules/index.d.ts +1 -1
  94. package/dist/types/components/molecules/Terminals/PodLogs/molecules/XTerminal/index.d.ts +1 -1
  95. package/dist/types/components/molecules/Terminals/PodLogs/molecules/index.d.ts +1 -1
  96. package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/MonacoEditor/index.d.ts +1 -1
  97. package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/index.d.ts +1 -1
  98. package/dist/types/components/molecules/Terminals/PodTerminal/molecules/XTerminal/index.d.ts +1 -1
  99. package/dist/types/components/molecules/Terminals/PodTerminal/molecules/index.d.ts +1 -1
  100. package/dist/types/components/molecules/Terminals/index.d.ts +8 -4
  101. package/dist/types/components/molecules/index.d.ts +18 -9
  102. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/index.d.ts +1 -1
  103. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/EditModal/index.d.ts +1 -1
  104. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/index.d.ts +1 -1
  105. package/dist/types/components/organisms/DynamicComponents/molecules/AntdButton/index.d.ts +1 -1
  106. package/dist/types/components/organisms/DynamicComponents/molecules/AntdCard/index.d.ts +1 -1
  107. package/dist/types/components/organisms/DynamicComponents/molecules/AntdCol/index.d.ts +1 -1
  108. package/dist/types/components/organisms/DynamicComponents/molecules/AntdFlex/index.d.ts +1 -1
  109. package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/index.d.ts +1 -1
  110. package/dist/types/components/organisms/DynamicComponents/molecules/AntdRow/index.d.ts +1 -1
  111. package/dist/types/components/organisms/DynamicComponents/molecules/AntdTabs/index.d.ts +1 -1
  112. package/dist/types/components/organisms/DynamicComponents/molecules/AntdText/index.d.ts +1 -1
  113. package/dist/types/components/organisms/DynamicComponents/molecules/ArrayOfObjectsToKeyValues/index.d.ts +1 -1
  114. package/dist/types/components/organisms/DynamicComponents/molecules/ContentCard/index.d.ts +1 -1
  115. package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/index.d.ts +1 -1
  116. package/dist/types/components/organisms/DynamicComponents/molecules/DefaultDiv/index.d.ts +1 -1
  117. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/index.d.ts +1 -1
  118. package/dist/types/components/organisms/DynamicComponents/molecules/Events/index.d.ts +1 -1
  119. package/dist/types/components/organisms/DynamicComponents/molecules/ItemCounter/index.d.ts +1 -1
  120. package/dist/types/components/organisms/DynamicComponents/molecules/KeyCounter/index.d.ts +1 -1
  121. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/index.d.ts +1 -1
  122. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/EditModal/index.d.ts +1 -1
  123. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/index.d.ts +1 -1
  124. package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/index.d.ts +1 -1
  125. package/dist/types/components/organisms/DynamicComponents/molecules/MarketplaceCard/index.d.ts +1 -1
  126. package/dist/types/components/organisms/DynamicComponents/molecules/MultiQuery/index.d.ts +1 -1
  127. package/dist/types/components/organisms/DynamicComponents/molecules/NodeTerminal/index.d.ts +1 -1
  128. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/OwnerRefs.d.ts +6 -0
  129. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/guard.d.ts +2 -0
  130. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/index.d.ts +1 -0
  131. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/RefsList.d.ts +22 -0
  132. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/index.d.ts +1 -0
  133. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/RefElement.d.ts +21 -0
  134. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/index.d.ts +1 -0
  135. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/utils.d.ts +5 -0
  136. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/index.d.ts +1 -0
  137. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/types.d.ts +6 -0
  138. package/dist/types/components/organisms/DynamicComponents/molecules/ParsedText/index.d.ts +1 -1
  139. package/dist/types/components/organisms/DynamicComponents/molecules/PartsOfUrl/index.d.ts +1 -1
  140. package/dist/types/components/organisms/DynamicComponents/molecules/PodLogs/index.d.ts +1 -1
  141. package/dist/types/components/organisms/DynamicComponents/molecules/PodTerminal/index.d.ts +1 -1
  142. package/dist/types/components/organisms/DynamicComponents/molecules/ProjectInfoCard/index.d.ts +1 -1
  143. package/dist/types/components/organisms/DynamicComponents/molecules/ResourceBadge/index.d.ts +1 -1
  144. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/index.d.ts +1 -1
  145. package/dist/types/components/organisms/DynamicComponents/molecules/SidebarProvider/index.d.ts +1 -1
  146. package/dist/types/components/organisms/DynamicComponents/molecules/Spacer/index.d.ts +1 -1
  147. package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/index.d.ts +1 -1
  148. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/index.d.ts +1 -1
  149. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/EditModal/index.d.ts +1 -1
  150. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/index.d.ts +1 -1
  151. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/index.d.ts +1 -1
  152. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/EditModal/index.d.ts +1 -1
  153. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/index.d.ts +1 -1
  154. package/dist/types/components/organisms/DynamicComponents/molecules/VisibilityContainer/index.d.ts +1 -1
  155. package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/index.d.ts +1 -1
  156. package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/utils.d.ts +10 -0
  157. package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +37 -36
  158. package/dist/types/components/organisms/DynamicComponents/types.d.ts +37 -5
  159. package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +2 -1
  160. package/dist/types/components/organisms/DynamicRendererWithProviders/hybridDataProvider.d.ts +22 -0
  161. package/dist/types/components/organisms/DynamicRendererWithProviders/multiK8sProvider.d.ts +22 -0
  162. package/dist/types/components/organisms/index.d.ts +5 -3
  163. package/dist/types/hooks/useApiResource.d.ts +1 -0
  164. package/dist/types/hooks/useBuiltinResource.d.ts +1 -0
  165. package/dist/types/hooks/useCrdResource.d.ts +1 -0
  166. package/dist/types/hooks/useK8sSmartResource.d.ts +29 -0
  167. package/dist/types/hooks/useK8sVerbs.d.ts +13 -0
  168. package/dist/types/hooks/useListThenWatch/types.d.ts +10 -1
  169. package/dist/types/hooks/useListThenWatch/useListWatch.d.ts +1 -0
  170. package/dist/types/index.d.ts +3 -0
  171. package/dist/types/localTypes/bff/table.d.ts +1 -0
  172. package/dist/types/localTypes/dynamicRender.d.ts +2 -1
  173. package/dist/types/localTypes/k8s.d.ts +1 -0
  174. package/dist/types/localTypes/navigations.d.ts +24 -0
  175. package/dist/types/utils/createContextFactory/index.d.ts +1 -1
  176. package/dist/types/utils/deepMerge/index.d.ts +1 -1
  177. package/dist/types/utils/filterSelectOptions/index.d.ts +1 -1
  178. package/dist/types/utils/getAllPathsFromObj/index.d.ts +1 -1
  179. package/dist/types/utils/getGroupsByCategory/index.d.ts +1 -1
  180. package/dist/types/utils/getPrefixSubArrays/index.d.ts +1 -1
  181. package/dist/types/utils/getResourceLink/getResourceLink.d.ts +27 -0
  182. package/dist/types/utils/getResourceLink/index.d.ts +1 -0
  183. package/dist/types/utils/getSortedKinds/index.d.ts +1 -1
  184. package/dist/types/utils/getSortedKindsAll/index.d.ts +1 -1
  185. package/dist/types/utils/getStringByName/index.d.ts +1 -1
  186. package/dist/types/utils/getUppercase/index.d.ts +1 -1
  187. package/dist/types/utils/groupsToTreeData/index.d.ts +2 -1
  188. package/dist/types/utils/hslFromString/index.d.ts +1 -1
  189. package/dist/types/utils/index.d.ts +25 -22
  190. package/dist/types/utils/isFlatObject/index.d.ts +1 -1
  191. package/dist/types/utils/kindByGvr/index.d.ts +1 -1
  192. package/dist/types/utils/namespacedByGvr/index.d.ts +1 -1
  193. package/dist/types/utils/nestedStringsArrayInclude/index.d.ts +1 -1
  194. package/dist/types/utils/normalizeValuesForQuotas/index.d.ts +1 -1
  195. package/dist/types/utils/parseForQuotaValues/index.d.ts +1 -1
  196. package/dist/types/utils/pluralByKind/index.d.ts +1 -1
  197. package/dist/types/utils/prepareTemplate/index.d.ts +1 -1
  198. package/dist/types/utils/prepareUrlsToFetchForDynamicRenderer/index.d.ts +1 -1
  199. package/dist/types/utils/tableLocations/index.d.ts +1 -1
  200. package/package.json +1 -1
  201. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormDataProvider/index.d.ts +0 -2
  202. package/dist/types/components/molecules/ManageableBreadcrumbs/ManageableBreadcrumbs.d.ts +0 -19
  203. package/dist/types/components/molecules/ManageableSidebar/ManageableSidebar.d.ts +0 -24
  204. /package/dist/types/components/molecules/ManageableBreadcrumbs/{styled.d.ts → organisms/ManageableBreadcrumbs/styled.d.ts} +0 -0
  205. /package/dist/types/components/molecules/ManageableBreadcrumbs/{types.d.ts → organisms/ManageableBreadcrumbsProvider/types.d.ts} +0 -0
  206. /package/dist/types/components/molecules/ManageableBreadcrumbs/{utils.d.ts → organisms/ManageableBreadcrumbsProvider/utils.d.ts} +0 -0
  207. /package/dist/types/components/molecules/ManageableSidebar/{styled.d.ts → organisms/ManageableSidebar/styled.d.ts} +0 -0
  208. /package/dist/types/components/molecules/ManageableSidebar/{types.d.ts → organisms/ManageableSidebarProvider/types.d.ts} +0 -0
  209. /package/dist/types/components/molecules/ManageableSidebar/{utils.d.ts → organisms/ManageableSidebarProvider/utils.d.ts} +0 -0
@@ -1,9 +1,9 @@
1
1
  import styled, { createGlobalStyle } from 'styled-components';
2
- import K, { useState, useRef, useReducer, useEffect, useCallback, useLayoutEffect, Fragment, createContext, useContext, useMemo, createElement, isValidElement, cloneElement, useInsertionEffect, useSyncExternalStore, memo, Suspense } from 'react';
3
- import { Input, Tree, Modal, Alert, theme, Select, Tag, Breadcrumb, Spin, Menu, Tooltip, Space, Button, Flex, Typography, Card as Card$1, Row, Col, Tabs, Form, Popover, notification, Dropdown, Table, Slider, InputNumber, Switch, Result, Progress, Checkbox, Empty } from 'antd';
2
+ import K, { useState, useRef, useLayoutEffect, useReducer, useEffect, useCallback, useMemo, Fragment, createContext, useContext, createElement, isValidElement, cloneElement, useInsertionEffect, useSyncExternalStore, memo, Suspense } from 'react';
3
+ import { Input, Tree, Modal, Alert, theme, Select, Tag, Flex, Typography, Breadcrumb, Spin, Menu, Tooltip, Space, Button, Card as Card$1, Row, Col, Tabs, Form, Popover, notification, Dropdown, Table, Slider, InputNumber, Switch, Result, Progress, Checkbox, Empty } from 'antd';
4
4
  import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, PlusOutlined, ClearOutlined, MinusOutlined, CaretDownOutlined, CaretRightOutlined, InfoCircleOutlined, EyeOutlined, EyeInvisibleOutlined, SearchOutlined, MoreOutlined, CheckOutlined, CloseOutlined, BugOutlined, EllipsisOutlined } from '@ant-design/icons';
5
- import { Link, useNavigate, useLocation, useParams, useSearchParams } from 'react-router-dom';
6
- import { useQueries, useQuery, useQueryClient } from '@tanstack/react-query';
5
+ import { useNavigate, Link, useLocation, useParams, useSearchParams } from 'react-router-dom';
6
+ import { useQuery, useQueries, useQueryClient } from '@tanstack/react-query';
7
7
 
8
8
  const Spacer$1 = styled.div`
9
9
  height: ${({ $space, $spaceMob, $samespace }) => {
@@ -1574,7 +1574,7 @@ const CustomTreeProvider = styled.div`
1574
1574
  justify-content: center;
1575
1575
  }
1576
1576
  `;
1577
- const Styled$A = {
1577
+ const Styled$C = {
1578
1578
  CustomTreeProvider
1579
1579
  };
1580
1580
 
@@ -1639,7 +1639,7 @@ const TreeWithSearch = ({ treeData, onSelect }) => {
1639
1639
  });
1640
1640
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1641
1641
  /* @__PURE__ */ jsxRuntimeExports.jsx(Search$1, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
1642
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1642
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1643
1643
  Tree,
1644
1644
  {
1645
1645
  treeData: loop(treeData),
@@ -8168,14 +8168,14 @@ const ContentContainer = styled.div`
8168
8168
  display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
8169
8169
  flex-flow: ${({ $flexFlow }) => $flexFlow};
8170
8170
  `;
8171
- const Styled$z = {
8171
+ const Styled$B = {
8172
8172
  ContentContainer
8173
8173
  };
8174
8174
 
8175
8175
  const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
8176
8176
  const { token } = theme.useToken();
8177
8177
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8178
- Styled$z.ContentContainer,
8178
+ Styled$B.ContentContainer,
8179
8179
  {
8180
8180
  $flexGrow: flexGrow,
8181
8181
  $bgColor: token.colorBgContainer,
@@ -8236,13 +8236,13 @@ const UncontrolledSelect$1 = styled(Select)`
8236
8236
  padding-inline: 8px;
8237
8237
  }
8238
8238
  `;
8239
- const Styled$y = {
8239
+ const Styled$A = {
8240
8240
  UncontrolledSelect: UncontrolledSelect$1
8241
8241
  };
8242
8242
 
8243
8243
  const UncontrolledSelect = (props) => {
8244
8244
  const { isCursorPointer } = props;
8245
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8245
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8246
8246
  };
8247
8247
 
8248
8248
  const CustomSelect$5 = styled(Select)`
@@ -8290,13 +8290,13 @@ const CustomSelect$5 = styled(Select)`
8290
8290
  margin-block: 0 !important;
8291
8291
  }
8292
8292
  `;
8293
- const Styled$x = {
8293
+ const Styled$z = {
8294
8294
  CustomSelect: CustomSelect$5
8295
8295
  };
8296
8296
 
8297
8297
  const CustomSelect$4 = (props) => {
8298
8298
  const { paddingContainerEnd, ...rest } = props;
8299
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
8299
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
8300
8300
  };
8301
8301
 
8302
8302
  const CursorPointerTag = styled(Tag)`
@@ -8316,11 +8316,331 @@ const PaddingContainer = styled.div`
8316
8316
  padding: ${({ $padding }) => $padding};
8317
8317
  `;
8318
8318
 
8319
- const eventKey$1 = (e) => {
8320
- const n = e.metadata?.name ?? "";
8321
- const ns = e.metadata?.namespace ?? "";
8322
- return `${ns}/${n}`;
8319
+ const getUppercase = (s) => {
8320
+ const uppercases = [...s].filter((c) => c >= "A" && c <= "Z").join("");
8321
+ return uppercases.length > 0 ? uppercases : s[0].toUpperCase();
8322
+ };
8323
+
8324
+ const fnv1a32 = (str) => {
8325
+ let h = 2166136261;
8326
+ for (const ch of str) {
8327
+ h ^= ch.codePointAt(0);
8328
+ h = (h >>> 0) * 16777619;
8329
+ }
8330
+ return h >>> 0;
8331
+ };
8332
+ const pickInRange = (u32, min, max) => min + u32 % (max - min + 1);
8333
+ const hslFromString = (value, theme) => {
8334
+ const hash = fnv1a32(value);
8335
+ const hue = hash % 345;
8336
+ const [sMin, sMax] = theme === "light" ? [90, 100] : [78, 80];
8337
+ const [lMin, lMax] = theme === "light" ? [78, 80] : [25, 35];
8338
+ const s = pickInRange(hash >>> 8, sMin, sMax);
8339
+ const l = pickInRange(hash >>> 16, lMin, lMax);
8340
+ return `hsl(${hue}, ${s}%, ${l}%)`;
8341
+ };
8342
+
8343
+ const parseApiVersion$1 = (apiVersion) => {
8344
+ const parts = apiVersion.split("/");
8345
+ if (parts.length === 1) {
8346
+ return {
8347
+ apiGroup: void 0,
8348
+ apiVersion: parts[0]
8349
+ };
8350
+ }
8351
+ return {
8352
+ apiGroup: parts[0],
8353
+ apiVersion: parts[1]
8354
+ };
8355
+ };
8356
+ const getFactoryKey = ({
8357
+ apiGroup,
8358
+ apiVersion,
8359
+ resource,
8360
+ namespace,
8361
+ baseFactoriesMapping,
8362
+ baseFactoryNamespacedAPIKey,
8363
+ baseFactoryClusterSceopedAPIKey,
8364
+ baseFactoryNamespacedBuiltinKey,
8365
+ baseFactoryClusterSceopedBuiltinKey
8366
+ }) => {
8367
+ if (namespace) {
8368
+ if (apiGroup) {
8369
+ const forcedMapping3 = baseFactoriesMapping?.[`${baseFactoryNamespacedAPIKey}-${apiGroup}-${apiVersion}-${resource}`];
8370
+ return forcedMapping3 || baseFactoryNamespacedAPIKey || "";
8371
+ }
8372
+ const forcedMapping2 = baseFactoriesMapping?.[`${baseFactoryNamespacedBuiltinKey}-${apiVersion}-${resource}`];
8373
+ return forcedMapping2 || baseFactoryNamespacedBuiltinKey || "";
8374
+ }
8375
+ if (apiGroup) {
8376
+ const forcedMapping2 = baseFactoriesMapping?.[`${baseFactoryClusterSceopedAPIKey}-${apiGroup}-${apiVersion}-${resource}`];
8377
+ return forcedMapping2 || baseFactoryClusterSceopedAPIKey || "";
8378
+ }
8379
+ const forcedMapping = baseFactoriesMapping?.[`${baseFactoryClusterSceopedBuiltinKey}-${apiVersion}-${resource}`];
8380
+ return forcedMapping || baseFactoryClusterSceopedBuiltinKey || "";
8381
+ };
8382
+ const getResourceLink = ({
8383
+ baseprefix,
8384
+ cluster,
8385
+ namespace,
8386
+ apiGroupVersion,
8387
+ pluralName,
8388
+ name,
8389
+ baseFactoryNamespacedAPIKey,
8390
+ baseFactoryClusterSceopedAPIKey,
8391
+ baseFactoryNamespacedBuiltinKey,
8392
+ baseFactoryClusterSceopedBuiltinKey,
8393
+ baseFactoriesMapping
8394
+ }) => {
8395
+ if (!pluralName || !name) {
8396
+ return void 0;
8397
+ }
8398
+ const { apiGroup, apiVersion } = parseApiVersion$1(apiGroupVersion);
8399
+ if (apiGroupVersion === "v1") {
8400
+ return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${getFactoryKey({
8401
+ apiGroup,
8402
+ apiVersion,
8403
+ resource: pluralName,
8404
+ namespace,
8405
+ baseFactoriesMapping,
8406
+ baseFactoryNamespacedAPIKey,
8407
+ baseFactoryClusterSceopedAPIKey,
8408
+ baseFactoryNamespacedBuiltinKey,
8409
+ baseFactoryClusterSceopedBuiltinKey
8410
+ })}/${apiGroupVersion}/${pluralName}/${name}`;
8411
+ }
8412
+ return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${getFactoryKey({
8413
+ apiGroup,
8414
+ apiVersion,
8415
+ resource: pluralName,
8416
+ namespace,
8417
+ baseFactoriesMapping,
8418
+ baseFactoryNamespacedAPIKey,
8419
+ baseFactoryClusterSceopedAPIKey,
8420
+ baseFactoryNamespacedBuiltinKey,
8421
+ baseFactoryClusterSceopedBuiltinKey
8422
+ })}/${apiGroupVersion}/${pluralName}/${name}`;
8423
+ };
8424
+ const getNamespaceLink = ({
8425
+ baseprefix,
8426
+ cluster,
8427
+ apiGroupVersion,
8428
+ pluralName,
8429
+ namespace,
8430
+ baseNamespaceFactoryKey
8431
+ }) => {
8432
+ if (!namespace) {
8433
+ return void 0;
8434
+ }
8435
+ return `${baseprefix}/${cluster}/factory/${baseNamespaceFactoryKey}/${apiGroupVersion}/${pluralName}/${namespace}`;
8436
+ };
8437
+
8438
+ const Abbr$2 = styled.span`
8439
+ background-color: ${({ $bgColor }) => $bgColor};
8440
+ border-radius: 13px;
8441
+ padding: 1px 5px;
8442
+ font-size: 13px;
8443
+ height: min-content;
8444
+ margin-right: 4px;
8445
+ `;
8446
+ const Styled$y = {
8447
+ Abbr: Abbr$2
8448
+ };
8449
+
8450
+ const ResourceLink = ({
8451
+ kind,
8452
+ apiVersion,
8453
+ namespace,
8454
+ name,
8455
+ forcedName,
8456
+ theme,
8457
+ baseprefix,
8458
+ cluster,
8459
+ getPlural,
8460
+ baseFactoryNamespacedAPIKey,
8461
+ baseFactoryClusterSceopedAPIKey,
8462
+ baseFactoryNamespacedBuiltinKey,
8463
+ baseFactoryClusterSceopedBuiltinKey,
8464
+ baseFactoriesMapping
8465
+ }) => {
8466
+ const navigate = useNavigate();
8467
+ const abbr = kind ? getUppercase(kind) : void 0;
8468
+ const bgColor = kind && abbr ? hslFromString(kind, theme) : "initial";
8469
+ const parsedKind = kind;
8470
+ const parsedApiVersion = apiVersion;
8471
+ const pluralName = parsedKind && parsedApiVersion ? getPlural?.(parsedKind, parsedApiVersion) : void 0;
8472
+ const resourceLink = getResourceLink({
8473
+ baseprefix,
8474
+ cluster,
8475
+ namespace,
8476
+ apiGroupVersion: parsedApiVersion,
8477
+ pluralName,
8478
+ name,
8479
+ baseFactoryNamespacedAPIKey,
8480
+ baseFactoryClusterSceopedAPIKey,
8481
+ baseFactoryNamespacedBuiltinKey,
8482
+ baseFactoryClusterSceopedBuiltinKey,
8483
+ baseFactoriesMapping
8484
+ });
8485
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
8486
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.Abbr, { $bgColor: bgColor, children: abbr }),
8487
+ resourceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
8488
+ Typography.Link,
8489
+ {
8490
+ onClick: (e) => {
8491
+ e.preventDefault();
8492
+ navigate(resourceLink);
8493
+ },
8494
+ children: forcedName || name
8495
+ }
8496
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: forcedName || name })
8497
+ ] });
8323
8498
  };
8499
+
8500
+ const PositionRelativeContainer = styled.div`
8501
+ position: relative;
8502
+ `;
8503
+ const FullWidthContainer = styled.div`
8504
+ width: 100%;
8505
+
8506
+ .ant-dropdown-trigger svg {
8507
+ display: none;
8508
+ }
8509
+ `;
8510
+ const NoWrapContainer = styled.div`
8511
+ position: absolute;
8512
+ visibility: hidden;
8513
+ pointer-events: none;
8514
+
8515
+ /* stylelint-disable declaration-no-important */
8516
+
8517
+ * {
8518
+ white-space: nowrap !important;
8519
+ }
8520
+
8521
+ ol {
8522
+ flex-wrap: nowrap !important;
8523
+ }
8524
+ `;
8525
+ const Styled$x = {
8526
+ PositionRelativeContainer,
8527
+ FullWidthContainer,
8528
+ NoWrapContainer
8529
+ };
8530
+
8531
+ const CollapsibleBreadcrumb = ({ items }) => {
8532
+ const [isCollapsed, setIsCollapsed] = useState(false);
8533
+ const containerRef = useRef(null);
8534
+ const breadcrumbRef = useRef(null);
8535
+ useLayoutEffect(() => {
8536
+ const checkWidth = () => {
8537
+ if (containerRef.current && breadcrumbRef.current) {
8538
+ const containerWidth = containerRef.current.clientWidth;
8539
+ const breadcrumbWidth = breadcrumbRef.current.scrollWidth;
8540
+ setIsCollapsed(breadcrumbWidth > containerWidth);
8541
+ }
8542
+ };
8543
+ checkWidth();
8544
+ window.addEventListener("resize", checkWidth);
8545
+ return () => window.removeEventListener("resize", checkWidth);
8546
+ }, [items]);
8547
+ const renderItems = () => {
8548
+ if (!isCollapsed) {
8549
+ return items;
8550
+ }
8551
+ if (items.length <= 2) {
8552
+ return items;
8553
+ }
8554
+ const firstItem = items[0];
8555
+ const lastItem = items[items.length - 1];
8556
+ const hiddenItems = items.slice(1, -1);
8557
+ const menuItems = hiddenItems.map((item, index) => ({
8558
+ key: String(index),
8559
+ label: item.href ? /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: item.href, children: item.title }) : item.title
8560
+ }));
8561
+ const ellipsisItem = {
8562
+ title: "...",
8563
+ menu: { items: menuItems },
8564
+ dropdownProps: { arrow: false }
8565
+ };
8566
+ return [firstItem, ellipsisItem, lastItem];
8567
+ };
8568
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$x.PositionRelativeContainer, { children: [
8569
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items: renderItems() }) }),
8570
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8571
+ ] });
8572
+ };
8573
+
8574
+ const HeightDiv$1 = styled.div`
8575
+ min-height: 22px;
8576
+ width: 100%;
8577
+ `;
8578
+ const Styled$w = {
8579
+ HeightDiv: HeightDiv$1
8580
+ };
8581
+
8582
+ const ManageableBreadcrumbs = ({ data }) => {
8583
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8584
+ };
8585
+
8586
+ const getDirectUnknownResource = async ({ uri }) => {
8587
+ return axios.get(uri);
8588
+ };
8589
+
8590
+ const useDirectUnknownResource = ({
8591
+ uri,
8592
+ queryKey,
8593
+ refetchInterval,
8594
+ isEnabled
8595
+ }) => {
8596
+ return useQuery({
8597
+ queryKey,
8598
+ queryFn: async () => {
8599
+ const response = await getDirectUnknownResource({
8600
+ uri
8601
+ });
8602
+ const data = JSON.parse(JSON.stringify(response.data));
8603
+ if (data.metadata?.resourceVersion) {
8604
+ delete data.metadata.resourceVersion;
8605
+ }
8606
+ return data;
8607
+ },
8608
+ refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
8609
+ enabled: isEnabled
8610
+ });
8611
+ };
8612
+
8613
+ const useK8sVerbs = ({
8614
+ cluster,
8615
+ group,
8616
+ version,
8617
+ plural,
8618
+ isEnabled = true
8619
+ }) => {
8620
+ const uri = `/api/clusters/${cluster}/openapi-bff/verbs/getResourceVerbs?${new URLSearchParams({
8621
+ ...group ? { group } : {},
8622
+ version,
8623
+ plural
8624
+ }).toString()}`;
8625
+ const { data, isError, isLoading, error } = useDirectUnknownResource({
8626
+ uri,
8627
+ queryKey: ["k8s-verbs", cluster, group || "", version, plural],
8628
+ refetchInterval: false,
8629
+ isEnabled: Boolean(isEnabled && cluster && version && plural)
8630
+ });
8631
+ const verbs = data?.verbs || [];
8632
+ const canList = verbs.includes("list");
8633
+ const canWatch = verbs.includes("watch");
8634
+ return {
8635
+ canList,
8636
+ canWatch,
8637
+ isError,
8638
+ isLoading,
8639
+ error
8640
+ };
8641
+ };
8642
+
8643
+ const eventKey$1 = (e) => e.metadata?.uid ?? `${e.metadata?.namespace ?? ""}/${e.metadata?.name ?? ""}`;
8324
8644
  const compareRV$1 = (a, b) => {
8325
8645
  if (a.length !== b.length) return a.length > b.length ? 1 : -1;
8326
8646
  return a > b ? 1 : a < b ? -1 : 0;
@@ -8404,6 +8724,7 @@ const useListWatch = ({
8404
8724
  const [lastError, setLastError] = useState(void 0);
8405
8725
  const [isPaused, setIsPaused] = useState(paused);
8406
8726
  const [isRemoveIgnored, setIsRemoveIgnored] = useState(ignoreRemove);
8727
+ const [hasInitial, setHasInitial] = useState(false);
8407
8728
  const queryRef = useRef(query);
8408
8729
  const wsRef = useRef(null);
8409
8730
  const connectingRef = useRef(false);
@@ -8575,19 +8896,6 @@ const useListWatch = ({
8575
8896
  wsRef.current = null;
8576
8897
  connect();
8577
8898
  }, [closeWS, connect, setStatusSafe]);
8578
- useEffect(() => {
8579
- if (!mountedRef.current) return;
8580
- if (isEnabled) {
8581
- connect();
8582
- } else {
8583
- if (reconnectTimerRef.current) {
8584
- window.clearTimeout(reconnectTimerRef.current);
8585
- reconnectTimerRef.current = null;
8586
- }
8587
- closeWS();
8588
- setStatusSafe("closed");
8589
- }
8590
- }, [isEnabled, closeWS, connect, setStatusSafe]);
8591
8899
  const setUrl = useCallback(
8592
8900
  (next) => {
8593
8901
  const changed = next !== urlRef.current;
@@ -8601,6 +8909,7 @@ const useListWatch = ({
8601
8909
  setHasMore(false);
8602
8910
  anchorRVRef.current = void 0;
8603
8911
  haveAnchorRef.current = false;
8912
+ setHasInitial(false);
8604
8913
  }
8605
8914
  if (enabledRef.current) reconnect();
8606
8915
  }
@@ -8619,6 +8928,7 @@ const useListWatch = ({
8619
8928
  dispatch({ type: "RESET", items: [] });
8620
8929
  setContToken(void 0);
8621
8930
  setHasMore(false);
8931
+ setHasInitial(false);
8622
8932
  }
8623
8933
  if (prevId !== nextId) {
8624
8934
  anchorRVRef.current = void 0;
@@ -8641,6 +8951,17 @@ const useListWatch = ({
8641
8951
  return;
8642
8952
  }
8643
8953
  if (!frame) return;
8954
+ if (frame.type === "SERVER_LOG") {
8955
+ const level = frame.level || "info";
8956
+ const msg = frame.message;
8957
+ (console[level] || console.log).call(console, "[useListWatch][server]", msg);
8958
+ return;
8959
+ }
8960
+ if (frame.type === "INITIAL_ERROR") {
8961
+ const msg = frame.message;
8962
+ setErrorSafe(msg);
8963
+ return;
8964
+ }
8644
8965
  if (frame.type === "INITIAL") {
8645
8966
  dispatch({ type: "RESET", items: frame.items });
8646
8967
  setContToken(frame.continue);
@@ -8653,6 +8974,7 @@ const useListWatch = ({
8653
8974
  anchorRVRef.current = snapshotRV;
8654
8975
  haveAnchorRef.current = true;
8655
8976
  }
8977
+ setHasInitial(true);
8656
8978
  return;
8657
8979
  }
8658
8980
  if (frame.type === "PAGE") {
@@ -8711,12 +9033,26 @@ const useListWatch = ({
8711
9033
  useEffect(() => {
8712
9034
  if (wsUrl !== urlRef.current) setUrl(wsUrl);
8713
9035
  }, [wsUrl, setUrl]);
9036
+ useEffect(() => {
9037
+ if (!mountedRef.current) return;
9038
+ if (isEnabled) {
9039
+ connect();
9040
+ } else {
9041
+ if (reconnectTimerRef.current) {
9042
+ window.clearTimeout(reconnectTimerRef.current);
9043
+ reconnectTimerRef.current = null;
9044
+ }
9045
+ closeWS();
9046
+ setStatusSafe("closed");
9047
+ }
9048
+ }, [isEnabled, closeWS, connect, setStatusSafe]);
8714
9049
  useEffect(() => {
8715
9050
  if (resIdRef.current !== resId) {
8716
9051
  clearErrorSafe();
8717
9052
  suppressErrorsRef.current = true;
8718
9053
  anchorRVRef.current = void 0;
8719
9054
  haveAnchorRef.current = false;
9055
+ setHasInitial(false);
8720
9056
  resIdRef.current = resId;
8721
9057
  queryRef.current = query;
8722
9058
  if (enabledRef.current) reconnect();
@@ -8801,6 +9137,7 @@ const useListWatch = ({
8801
9137
  continueToken,
8802
9138
  status,
8803
9139
  lastError,
9140
+ hasInitial,
8804
9141
  setPaused: setIsPaused,
8805
9142
  setIgnoreRemove: setIsRemoveIgnored,
8806
9143
  sendScroll,
@@ -8811,17 +9148,126 @@ const useListWatch = ({
8811
9148
  };
8812
9149
  };
8813
9150
 
8814
- const useInfiniteSentinel = (sentinelRef, hasMore, onNeedMore) => {
8815
- useEffect(() => {
8816
- const el = sentinelRef.current;
8817
- if (!el) return void 0;
8818
- const io = new IntersectionObserver((entries) => {
8819
- const visible = entries.some((e) => e.isIntersecting);
8820
- if (visible && hasMore) onNeedMore();
8821
- });
8822
- io.observe(el);
8823
- return () => io.disconnect();
8824
- }, [sentinelRef, hasMore, onNeedMore]);
9151
+ const buildApiPrefix = (group, version) => {
9152
+ const g = (group ?? "").trim();
9153
+ const v = (version ?? "").trim();
9154
+ const isCore = !g || g === "core" || g === "v1";
9155
+ return isCore ? `/api/${v}` : `/apis/${g}/${v}`;
9156
+ };
9157
+ const buildListUri = ({
9158
+ cluster,
9159
+ group,
9160
+ version,
9161
+ plural,
9162
+ namespace,
9163
+ fieldSelector,
9164
+ labelSelector,
9165
+ limit
9166
+ }) => {
9167
+ const prefix = buildApiPrefix(group, version);
9168
+ const ns = namespace ? `/namespaces/${namespace}` : "";
9169
+ const base = `/api/clusters/${cluster}/k8s${prefix}${ns}/${plural}/`;
9170
+ const params = new URLSearchParams();
9171
+ if (fieldSelector) params.append("fieldSelector", fieldSelector);
9172
+ if (labelSelector) params.append("labelSelector", labelSelector);
9173
+ if (limit) params.append("limit", String(limit));
9174
+ return params.toString() ? `${base}?${params.toString()}` : base;
9175
+ };
9176
+ const useK8sSmartResource = ({
9177
+ cluster,
9178
+ group,
9179
+ version,
9180
+ plural,
9181
+ namespace,
9182
+ fieldSelector,
9183
+ labelSelector,
9184
+ isEnabled = true,
9185
+ listRefetchInterval = 5e3,
9186
+ limit,
9187
+ mapListWatchState
9188
+ }) => {
9189
+ const {
9190
+ canList,
9191
+ canWatch,
9192
+ isLoading: verbsLoading,
9193
+ isError: verbsIsError,
9194
+ error: verbsErrorObj
9195
+ } = useK8sVerbs({
9196
+ cluster,
9197
+ group,
9198
+ version,
9199
+ plural,
9200
+ isEnabled: Boolean(isEnabled && cluster && cluster.length > 0)
9201
+ });
9202
+ const listUri = buildListUri({
9203
+ cluster,
9204
+ group,
9205
+ version,
9206
+ plural,
9207
+ namespace,
9208
+ fieldSelector,
9209
+ labelSelector,
9210
+ limit
9211
+ });
9212
+ const restEnabled = Boolean(
9213
+ cluster && cluster.length > 0 && isEnabled && canList && !canWatch && !verbsLoading && !verbsIsError
9214
+ );
9215
+ const {
9216
+ data: restData,
9217
+ isLoading: restLoading,
9218
+ isError: restIsError,
9219
+ error: restError
9220
+ } = useDirectUnknownResource({
9221
+ uri: listUri,
9222
+ queryKey: [
9223
+ "k8s-list",
9224
+ cluster,
9225
+ group || "",
9226
+ version,
9227
+ namespace || "",
9228
+ plural,
9229
+ fieldSelector || "",
9230
+ labelSelector || ""
9231
+ ],
9232
+ refetchInterval: listRefetchInterval,
9233
+ isEnabled: restEnabled
9234
+ });
9235
+ const watchEnabled = Boolean(
9236
+ cluster && cluster.length > 0 && isEnabled && canList && canWatch && !verbsLoading && !verbsIsError
9237
+ );
9238
+ const { state, status, hasInitial, lastError } = useListWatch({
9239
+ wsUrl: `/api/clusters/${cluster}/openapi-bff-ws/listThenWatch/listWatchWs`,
9240
+ paused: false,
9241
+ ignoreRemove: false,
9242
+ autoDrain: true,
9243
+ preserveStateOnUrlChange: true,
9244
+ isEnabled: watchEnabled,
9245
+ pageSize: limit,
9246
+ query: {
9247
+ apiGroup: group,
9248
+ apiVersion: version,
9249
+ plural,
9250
+ namespace,
9251
+ fieldSelector,
9252
+ labelSelector
9253
+ }
9254
+ });
9255
+ const defaultMap = (s) => ({ items: s.order.map((k) => s.byKey[k]) });
9256
+ const watchData = useMemo(
9257
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9258
+ () => watchEnabled ? (mapListWatchState ?? defaultMap)(state) : void 0,
9259
+ // eslint-disable-next-line react-hooks/exhaustive-deps
9260
+ [watchEnabled, state, mapListWatchState]
9261
+ );
9262
+ const used = !isEnabled ? "disabled" : verbsLoading ? "verbs-loading" : verbsIsError ? "verbs-error" : watchEnabled ? "watch" : restEnabled ? "list" : "disabled";
9263
+ const isLoading = isEnabled && verbsLoading || used === "watch" && status === "connecting" || used === "watch" && status === "open" && !hasInitial || used === "list" && restLoading;
9264
+ let error;
9265
+ if (verbsIsError) error = verbsErrorObj;
9266
+ else if (used === "watch" && status === "closed" && lastError) error = lastError;
9267
+ else if (used === "list" && restIsError) error = restError;
9268
+ const isError = Boolean(error);
9269
+ const data = used === "watch" ? watchData : used === "list" ? restData : void 0;
9270
+ return { data, isLoading, isError, error, _meta: { used } };
8825
9271
  };
8826
9272
 
8827
9273
  const prepareTemplate = ({
@@ -8875,80 +9321,6 @@ const prepareDataForManageableBreadcrumbs = ({
8875
9321
  return result;
8876
9322
  };
8877
9323
 
8878
- const PositionRelativeContainer = styled.div`
8879
- position: relative;
8880
- `;
8881
- const FullWidthContainer = styled.div`
8882
- width: 100%;
8883
-
8884
- .ant-dropdown-trigger svg {
8885
- display: none;
8886
- }
8887
- `;
8888
- const NoWrapContainer = styled.div`
8889
- position: absolute;
8890
- visibility: hidden;
8891
- pointer-events: none;
8892
-
8893
- /* stylelint-disable declaration-no-important */
8894
-
8895
- * {
8896
- white-space: nowrap !important;
8897
- }
8898
-
8899
- ol {
8900
- flex-wrap: nowrap !important;
8901
- }
8902
- `;
8903
- const Styled$w = {
8904
- PositionRelativeContainer,
8905
- FullWidthContainer,
8906
- NoWrapContainer
8907
- };
8908
-
8909
- const CollapsibleBreadcrumb = ({ items }) => {
8910
- const [isCollapsed, setIsCollapsed] = useState(false);
8911
- const containerRef = useRef(null);
8912
- const breadcrumbRef = useRef(null);
8913
- useLayoutEffect(() => {
8914
- const checkWidth = () => {
8915
- if (containerRef.current && breadcrumbRef.current) {
8916
- const containerWidth = containerRef.current.clientWidth;
8917
- const breadcrumbWidth = breadcrumbRef.current.scrollWidth;
8918
- setIsCollapsed(breadcrumbWidth > containerWidth);
8919
- }
8920
- };
8921
- checkWidth();
8922
- window.addEventListener("resize", checkWidth);
8923
- return () => window.removeEventListener("resize", checkWidth);
8924
- }, [items]);
8925
- const renderItems = () => {
8926
- if (!isCollapsed) {
8927
- return items;
8928
- }
8929
- if (items.length <= 2) {
8930
- return items;
8931
- }
8932
- const firstItem = items[0];
8933
- const lastItem = items[items.length - 1];
8934
- const hiddenItems = items.slice(1, -1);
8935
- const menuItems = hiddenItems.map((item, index) => ({
8936
- key: String(index),
8937
- label: item.href ? /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: item.href, children: item.title }) : item.title
8938
- }));
8939
- const ellipsisItem = {
8940
- title: "...",
8941
- menu: { items: menuItems },
8942
- dropdownProps: { arrow: false }
8943
- };
8944
- return [firstItem, ellipsisItem, lastItem];
8945
- };
8946
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$w.PositionRelativeContainer, { children: [
8947
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items: renderItems() }) }),
8948
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8949
- ] });
8950
- };
8951
-
8952
9324
  const HeightDiv = styled.div`
8953
9325
  min-height: 22px;
8954
9326
  width: 100%;
@@ -8957,11 +9329,8 @@ const Styled$v = {
8957
9329
  HeightDiv
8958
9330
  };
8959
9331
 
8960
- const ManageableBreadcrumbs = ({ data }) => {
8961
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$v.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8962
- };
8963
- const ManageableBreadcrumbsWithDataProvider = ({
8964
- wsUrl,
9332
+ const ManageableBreadcrumbsProvider = ({
9333
+ cluster,
8965
9334
  apiGroup,
8966
9335
  apiVersion,
8967
9336
  plural,
@@ -8970,28 +9339,17 @@ const ManageableBreadcrumbsWithDataProvider = ({
8970
9339
  pathname,
8971
9340
  idToCompare
8972
9341
  }) => {
8973
- const { state, status, lastError } = useListWatch({
8974
- wsUrl,
8975
- paused: false,
8976
- ignoreRemove: false,
8977
- autoDrain: true,
8978
- preserveStateOnUrlChange: true,
8979
- query: {
8980
- apiVersion,
8981
- apiGroup,
8982
- plural
8983
- },
9342
+ const {
9343
+ data: rawData,
9344
+ isError: rawDataError,
9345
+ isLoading: rawDataLoading
9346
+ } = useK8sSmartResource({
9347
+ cluster: cluster || "",
9348
+ group: apiGroup,
9349
+ version: apiVersion,
9350
+ plural,
8984
9351
  isEnabled
8985
9352
  });
8986
- const rawDataLoading = status === "connecting";
8987
- const rawDataError = status === "closed" && lastError ? lastError : void 0;
8988
- const rawData = {
8989
- items: state.order.map((key) => {
8990
- const res = state.byKey[key];
8991
- return res;
8992
- })
8993
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8994
- };
8995
9353
  if (rawDataError) {
8996
9354
  return null;
8997
9355
  }
@@ -9016,6 +9374,73 @@ const ManageableBreadcrumbsWithDataProvider = ({
9016
9374
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result });
9017
9375
  };
9018
9376
 
9377
+ const CustomMenu = styled(Menu)`
9378
+ margin-top: ${({ $noMarginTop }) => $noMarginTop ? "0" : "16px"};
9379
+ font-size: 14px;
9380
+ line-height: 24px;
9381
+ border: 0;
9382
+ /* stylelint-disable declaration-no-important */
9383
+ border-inline-end: 0 !important;
9384
+ /* stylelint-enable declaration-no-important */
9385
+
9386
+ .ant-menu-submenu-expand-icon {
9387
+ width: 16px;
9388
+ }
9389
+
9390
+ && .ant-menu-item-only-child {
9391
+ /* stylelint-disable declaration-no-important */
9392
+
9393
+ /* padding-left: 24px !important; */
9394
+ }
9395
+
9396
+ && .ant-menu-sub .ant-menu-item {
9397
+ margin: 0 !important;
9398
+ }
9399
+ `;
9400
+ const Styled$u = {
9401
+ CustomMenu
9402
+ };
9403
+
9404
+ const ManageableSidebar = ({ data, noMarginTop }) => {
9405
+ const [selectedKeys, setSelectedKeys] = useState([]);
9406
+ const [openKeys, setOpenKeys] = useState(() => {
9407
+ try {
9408
+ const saved = localStorage.getItem("menuOpenKeys");
9409
+ return saved ? JSON.parse(saved) : [];
9410
+ } catch (error) {
9411
+ console.error("Failed to parse stored menu keys", error);
9412
+ return [];
9413
+ }
9414
+ });
9415
+ const handleOpenChange = (keys) => {
9416
+ setOpenKeys(keys);
9417
+ try {
9418
+ localStorage.setItem("menuOpenKeys", JSON.stringify(keys));
9419
+ } catch (error) {
9420
+ console.error("Failed to save menu keys to localStorage", error);
9421
+ }
9422
+ };
9423
+ useEffect(() => {
9424
+ setSelectedKeys(data.selectedKeys);
9425
+ }, [data.selectedKeys]);
9426
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
9427
+ Styled$u.CustomMenu,
9428
+ {
9429
+ selectedKeys,
9430
+ onSelect: () => {
9431
+ },
9432
+ onDeselect: () => {
9433
+ },
9434
+ defaultOpenKeys: data.selectedKeys,
9435
+ openKeys,
9436
+ onOpenChange: handleOpenChange,
9437
+ mode: "inline",
9438
+ items: data.menuItems,
9439
+ $noMarginTop: noMarginTop
9440
+ }
9441
+ );
9442
+ };
9443
+
9019
9444
  const getLabel = ({
9020
9445
  preparedLink,
9021
9446
  label,
@@ -9110,74 +9535,8 @@ const prepareDataForManageableSidebar = ({
9110
9535
  return { ...result, selectedKeys: stringedOpenedKeys };
9111
9536
  };
9112
9537
 
9113
- const CustomMenu = styled(Menu)`
9114
- margin-top: ${({ $noMarginTop }) => $noMarginTop ? "0" : "16px"};
9115
- font-size: 14px;
9116
- line-height: 24px;
9117
- border: 0;
9118
- /* stylelint-disable declaration-no-important */
9119
- border-inline-end: 0 !important;
9120
- /* stylelint-enable declaration-no-important */
9121
-
9122
- .ant-menu-submenu-expand-icon {
9123
- width: 16px;
9124
- }
9125
-
9126
- && .ant-menu-item-only-child {
9127
- /* stylelint-disable declaration-no-important */
9128
-
9129
- /* padding-left: 24px !important; */
9130
- }
9131
-
9132
- && .ant-menu-sub .ant-menu-item {
9133
- margin: 0 !important;
9134
- }
9135
- `;
9136
- const Styled$u = {
9137
- CustomMenu
9138
- };
9139
-
9140
- const ManageableSidebar = ({ data, noMarginTop }) => {
9141
- const [selectedKeys, setSelectedKeys] = useState([]);
9142
- const [openKeys, setOpenKeys] = useState(() => {
9143
- try {
9144
- const saved = localStorage.getItem("menuOpenKeys");
9145
- return saved ? JSON.parse(saved) : [];
9146
- } catch (error) {
9147
- console.error("Failed to parse stored menu keys", error);
9148
- return [];
9149
- }
9150
- });
9151
- const handleOpenChange = (keys) => {
9152
- setOpenKeys(keys);
9153
- try {
9154
- localStorage.setItem("menuOpenKeys", JSON.stringify(keys));
9155
- } catch (error) {
9156
- console.error("Failed to save menu keys to localStorage", error);
9157
- }
9158
- };
9159
- useEffect(() => {
9160
- setSelectedKeys(data.selectedKeys);
9161
- }, [data.selectedKeys]);
9162
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
9163
- Styled$u.CustomMenu,
9164
- {
9165
- selectedKeys,
9166
- onSelect: () => {
9167
- },
9168
- onDeselect: () => {
9169
- },
9170
- defaultOpenKeys: data.selectedKeys,
9171
- openKeys,
9172
- onOpenChange: handleOpenChange,
9173
- mode: "inline",
9174
- items: data.menuItems,
9175
- $noMarginTop: noMarginTop
9176
- }
9177
- );
9178
- };
9179
- const ManageableSidebarWithDataProvider = ({
9180
- wsUrl,
9538
+ const ManageableSidebarProvider = ({
9539
+ cluster,
9181
9540
  apiGroup,
9182
9541
  apiVersion,
9183
9542
  plural,
@@ -9189,28 +9548,17 @@ const ManageableSidebarWithDataProvider = ({
9189
9548
  hidden,
9190
9549
  noMarginTop
9191
9550
  }) => {
9192
- const { state, status, lastError } = useListWatch({
9193
- wsUrl,
9194
- paused: false,
9195
- ignoreRemove: false,
9196
- autoDrain: true,
9197
- preserveStateOnUrlChange: true,
9198
- query: {
9199
- apiVersion,
9200
- apiGroup,
9201
- plural
9202
- },
9551
+ const {
9552
+ data: rawData,
9553
+ isError: rawDataError,
9554
+ isLoading: rawDataLoading
9555
+ } = useK8sSmartResource({
9556
+ cluster,
9557
+ group: apiGroup,
9558
+ version: apiVersion,
9559
+ plural,
9203
9560
  isEnabled
9204
9561
  });
9205
- const rawDataLoading = status === "connecting";
9206
- const rawDataError = status === "closed" && lastError ? lastError : void 0;
9207
- const rawData = {
9208
- items: state.order.map((key) => {
9209
- const res = state.byKey[key];
9210
- return res;
9211
- })
9212
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
9213
- };
9214
9562
  if (rawDataError) {
9215
9563
  return null;
9216
9564
  }
@@ -33469,49 +33817,97 @@ const AntdText = ({
33469
33817
  };
33470
33818
 
33471
33819
  const MultiQueryContext = createContext(void 0);
33472
- const MultiQueryProvider = ({ urls, dataToApplyToContext, children }) => {
33473
- const queries = useQueries({
33474
- queries: urls.map((url, index) => ({
33475
- queryKey: ["multi", index, url],
33476
- queryFn: async () => {
33477
- const response = await axios.get(url);
33478
- return response.data;
33820
+ const makeEmptyEntry = () => ({
33821
+ data: void 0,
33822
+ isLoading: false,
33823
+ isError: false,
33824
+ error: null
33825
+ });
33826
+ const aggReducer = (state, action) => {
33827
+ switch (action.type) {
33828
+ case "RESET":
33829
+ return { entries: Array.from({ length: action.total }, makeEmptyEntry) };
33830
+ case "SET_ENTRY": {
33831
+ const entries = state.entries.slice();
33832
+ entries[action.index] = action.entry;
33833
+ return { entries };
33834
+ }
33835
+ default:
33836
+ return state;
33837
+ }
33838
+ };
33839
+ const K8sFetcher = ({ index, params, dispatch }) => {
33840
+ const res = useK8sSmartResource(params);
33841
+ useEffect(() => {
33842
+ dispatch({
33843
+ type: "SET_ENTRY",
33844
+ index,
33845
+ entry: {
33846
+ data: res.data,
33847
+ isLoading: res.isLoading,
33848
+ isError: res.isError,
33849
+ error: res.error ?? null
33479
33850
  }
33480
- }))
33481
- });
33482
- const data = {};
33483
- const errors = [];
33484
- let isLoading;
33485
- let isError;
33486
- if (!dataToApplyToContext) {
33487
- queries.forEach((q, i) => {
33488
- data[`req${i}`] = q.data;
33489
- errors[i] = q.error ?? null;
33490
33851
  });
33491
- isLoading = queries.some((q) => q.isLoading);
33492
- isError = queries.some((q) => q.isError);
33493
- } else {
33494
- data.req0 = dataToApplyToContext;
33495
- isLoading = false;
33496
- isError = false;
33497
- }
33498
- const value = useMemo(
33499
- () => ({ data, isLoading, isError, errors }),
33500
- /*
33501
- We use JSON.stringify(data) and JSON.stringify(errors) as dependencies to safely memoize when values deeply change (since data is a new object every render).
33502
- Alternatively, you could use a deep comparison hook or lodash.isEqual if needed.
33503
- */
33504
- // eslint-disable-next-line react-hooks/exhaustive-deps
33505
- [JSON.stringify(data), isLoading, isError, JSON.stringify(errors)]
33852
+ }, [index, res.data, res.isLoading, res.isError, res.error, dispatch]);
33853
+ return null;
33854
+ };
33855
+ const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
33856
+ const k8sItems = useMemo(
33857
+ () => items.filter((x) => typeof x !== "string"),
33858
+ [items]
33506
33859
  );
33507
- return /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryContext.Provider, { value, children });
33860
+ const urlItems = useMemo(() => items.filter((x) => typeof x === "string"), [items]);
33861
+ const k8sCount = k8sItems.length;
33862
+ const urlCount = urlItems.length;
33863
+ const [state, dispatch] = useReducer(aggReducer, { entries: Array.from({ length: k8sCount }, makeEmptyEntry) });
33864
+ useEffect(() => {
33865
+ dispatch({ type: "RESET", total: k8sCount });
33866
+ }, [k8sCount]);
33867
+ const urlQueries = useQueries({
33868
+ queries: urlItems.map((url, i) => ({
33869
+ queryKey: ["multi-url", i, url],
33870
+ queryFn: async () => {
33871
+ const res = await axios.get(url);
33872
+ return structuredClone(res.data);
33873
+ },
33874
+ structuralSharing: false,
33875
+ refetchInterval: 5e3
33876
+ }))
33877
+ });
33878
+ const value = (() => {
33879
+ if (typeof dataToApplyToContext !== "undefined") {
33880
+ return { data: { req0: dataToApplyToContext }, isLoading: false, isError: false, errors: [] };
33881
+ }
33882
+ const data = {};
33883
+ const errors = [];
33884
+ for (let i = 0; i < k8sCount; i++) {
33885
+ const e = state.entries[i] ?? makeEmptyEntry();
33886
+ data[`req${i}`] = e.data;
33887
+ errors[i] = e.isError ? e.error : null;
33888
+ }
33889
+ for (let i = 0; i < urlCount; i++) {
33890
+ const q = urlQueries[i];
33891
+ const idx = k8sCount + i;
33892
+ data[`req${idx}`] = q?.data;
33893
+ errors[idx] = q?.isError ? q.error ?? null : null;
33894
+ }
33895
+ const isLoading = state.entries.some((e) => e.isLoading) || urlQueries.some((q) => q.isLoading);
33896
+ const isError = state.entries.some((e) => e.isError) || urlQueries.some((q) => q.isError);
33897
+ return { data, isLoading, isError, errors };
33898
+ })();
33899
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(MultiQueryContext.Provider, { value, children: [
33900
+ k8sItems.map((params, i) => (
33901
+ // eslint-disable-next-line react/no-array-index-key
33902
+ /* @__PURE__ */ jsxRuntimeExports.jsx(K8sFetcher, { index: i, params, dispatch }, i)
33903
+ )),
33904
+ children
33905
+ ] });
33508
33906
  };
33509
33907
  const useMultiQuery = () => {
33510
- const context = useContext(MultiQueryContext);
33511
- if (!context) {
33512
- throw new Error("useMultiQuery must be used within a MultiQueryProvider");
33513
- }
33514
- return context;
33908
+ const ctx = useContext(MultiQueryContext);
33909
+ if (!ctx) throw new Error("useMultiQuery must be used within a MultiQueryProvider");
33910
+ return ctx;
33515
33911
  };
33516
33912
 
33517
33913
  const createContextFactory = () => {
@@ -33739,7 +34135,7 @@ const MultiQuery = ({ data }) => {
33739
34135
  if (isError) {
33740
34136
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33741
34137
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
33742
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
34138
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33743
34139
  ] });
33744
34140
  }
33745
34141
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: preparedText });
@@ -33769,7 +34165,7 @@ const ParsedText = ({ data }) => {
33769
34165
  if (isError) {
33770
34166
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33771
34167
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
33772
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
34168
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33773
34169
  ] });
33774
34170
  }
33775
34171
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -33806,7 +34202,7 @@ const ProjectInfoCard$1 = ({
33806
34202
  if (isError) {
33807
34203
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33808
34204
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
33809
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
34205
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33810
34206
  ] });
33811
34207
  }
33812
34208
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, { clusterName, namespace, accessGroups: parsedAccessGroups, ...props, children });
@@ -33923,7 +34319,7 @@ const StatusText$1 = ({
33923
34319
  if (isError) {
33924
34320
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33925
34321
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
33926
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
34322
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33927
34323
  ] });
33928
34324
  }
33929
34325
  const { type, text } = getResult({
@@ -33955,7 +34351,7 @@ const SidebarProvider = ({
33955
34351
  acc[index.toString()] = value;
33956
34352
  return acc;
33957
34353
  }, {});
33958
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarWithDataProvider, { replaceValues, ...props });
34354
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarProvider, { replaceValues, ...props });
33959
34355
  };
33960
34356
 
33961
34357
  const checkPermission = async ({
@@ -34009,33 +34405,6 @@ const usePermissions = ({
34009
34405
  });
34010
34406
  };
34011
34407
 
34012
- const getDirectUnknownResource = async ({ uri }) => {
34013
- return axios.get(uri);
34014
- };
34015
-
34016
- const useDirectUnknownResource = ({
34017
- uri,
34018
- queryKey,
34019
- refetchInterval,
34020
- isEnabled
34021
- }) => {
34022
- return useQuery({
34023
- queryKey,
34024
- queryFn: async () => {
34025
- const response = await getDirectUnknownResource({
34026
- uri
34027
- });
34028
- const data = JSON.parse(JSON.stringify(response.data));
34029
- if (data.metadata?.resourceVersion) {
34030
- delete data.metadata.resourceVersion;
34031
- }
34032
- return data;
34033
- },
34034
- refetchInterval: refetchInterval !== void 0 ? refetchInterval : 5e3,
34035
- enabled: isEnabled
34036
- });
34037
- };
34038
-
34039
34408
  const getBackLinkToTable = ({ fullPath }) => {
34040
34409
  return encodeURIComponent(fullPath);
34041
34410
  };
@@ -34116,6 +34485,7 @@ const EnrichedTable$1 = ({
34116
34485
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
34117
34486
  id,
34118
34487
  fetchUrl,
34488
+ k8sResourceToFetch,
34119
34489
  pathToItems,
34120
34490
  clusterNamePartOfUrl,
34121
34491
  labelSelector,
@@ -34159,7 +34529,13 @@ const EnrichedTable$1 = ({
34159
34529
  verb: "create",
34160
34530
  refetchInterval: false
34161
34531
  });
34162
- const fetchUrlPrepared = parseAll({ text: fetchUrl, replaceValues, multiQueryData });
34532
+ const fetchUrlPrepared = fetchUrl ? parseAll({ text: fetchUrl, replaceValues, multiQueryData }) : void 0;
34533
+ const k8sResourceToFetchPrepared = k8sResourceToFetch ? {
34534
+ group: k8sResourceToFetch.group ? parseAll({ text: k8sResourceToFetch.group, replaceValues, multiQueryData }) : void 0,
34535
+ version: parseAll({ text: k8sResourceToFetch.version, replaceValues, multiQueryData }),
34536
+ plural: parseAll({ text: k8sResourceToFetch.plural, replaceValues, multiQueryData }),
34537
+ namespace: k8sResourceToFetch.namespace ? parseAll({ text: k8sResourceToFetch.namespace, replaceValues, multiQueryData }) : void 0
34538
+ } : void 0;
34163
34539
  const sParams = new URLSearchParams();
34164
34540
  if (labelSelector && Object.keys(labelSelector).length > 0) {
34165
34541
  const parsedObject = Object.fromEntries(
@@ -34196,21 +34572,48 @@ const EnrichedTable$1 = ({
34196
34572
  } = useDirectUnknownResource({
34197
34573
  uri: `${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`,
34198
34574
  queryKey: [`${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`],
34199
- isEnabled: !isMultiqueryLoading
34575
+ isEnabled: Boolean(!isMultiqueryLoading && fetchUrlPrepared)
34200
34576
  });
34201
- if (isMultiqueryLoading) {
34577
+ const {
34578
+ data: fetchedDataSocket,
34579
+ isLoading: isFetchedDataSocketLoading,
34580
+ error: fetchedDataSocketError
34581
+ } = useK8sSmartResource({
34582
+ cluster: clusterName || "",
34583
+ namespace: k8sResourceToFetchPrepared?.namespace,
34584
+ group: k8sResourceToFetchPrepared?.group,
34585
+ version: k8sResourceToFetchPrepared?.version || "",
34586
+ plural: k8sResourceToFetchPrepared?.plural || "",
34587
+ fieldSelector: sParams.get("fieldSelector") || void 0,
34588
+ labelSelector: sParams.get("labelSelector") || void 0,
34589
+ isEnabled: Boolean(!isMultiqueryLoading && k8sResourceToFetchPrepared)
34590
+ });
34591
+ if (fetchUrlPrepared && isMultiqueryLoading) {
34592
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34593
+ }
34594
+ if (k8sResourceToFetchPrepared && isMultiqueryLoading) {
34202
34595
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34203
34596
  }
34204
- if (isFetchedDataLoading) {
34597
+ if (fetchUrlPrepared && isFetchedDataLoading) {
34598
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) });
34599
+ }
34600
+ if (k8sResourceToFetchPrepared && isFetchedDataSocketLoading) {
34205
34601
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) });
34206
34602
  }
34207
- if (fetchedDataError) {
34603
+ if (fetchUrlPrepared && fetchedDataError) {
34208
34604
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34209
34605
  "Error: ",
34210
34606
  JSON.stringify(fetchedDataError)
34211
34607
  ] });
34212
34608
  }
34213
- const items = Array.isArray(pathToItems) ? _$1.get(fetchedData, pathToItems) : jp.query(fetchedData, `$${pathToItems}`)[0];
34609
+ if (k8sResourceToFetchPrepared && fetchedDataSocketError) {
34610
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34611
+ "Error: ",
34612
+ JSON.stringify(fetchedDataError)
34613
+ ] });
34614
+ }
34615
+ const dataFromOneOfHooks = fetchedData || fetchedDataSocket;
34616
+ const items = Array.isArray(pathToItems) ? _$1.get(dataFromOneOfHooks, pathToItems) : jp.query(dataFromOneOfHooks, `$${pathToItems}`)[0];
34214
34617
  if (!items) {
34215
34618
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34216
34619
  "No data on this path ",
@@ -34345,15 +34748,18 @@ const PodTerminal$1 = ({
34345
34748
  const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
34346
34749
  const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
34347
34750
  const {
34348
- data: podInfo,
34751
+ data: podInfoList,
34349
34752
  isError: isPodInfoError,
34350
34753
  isLoading: isLoadingPodInfo
34351
- } = useDirectUnknownResource({
34352
- uri: `/api/clusters/${clusterPrepared}/k8s/api/v1/namespaces/${namespacePrepared}/pods/${podNamePrepared}`,
34353
- refetchInterval: 5e3,
34354
- queryKey: [clusterPrepared || "no-cluster", "pods", podNamePrepared],
34754
+ } = useK8sSmartResource({
34755
+ cluster: clusterPrepared,
34756
+ namespace: namespacePrepared,
34757
+ version: "v1",
34758
+ plural: "pods",
34759
+ fieldSelector: `metadata.name=${podNamePrepared}`,
34355
34760
  isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
34356
34761
  });
34762
+ const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
34357
34763
  if (isMultiqueryLoading) {
34358
34764
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34359
34765
  }
@@ -34461,15 +34867,18 @@ const PodLogs$1 = ({
34461
34867
  const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
34462
34868
  const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
34463
34869
  const {
34464
- data: podInfo,
34870
+ data: podInfoList,
34465
34871
  isError: isPodInfoError,
34466
34872
  isLoading: isLoadingPodInfo
34467
- } = useDirectUnknownResource({
34468
- uri: `/api/clusters/${clusterPrepared}/k8s/api/v1/namespaces/${namespacePrepared}/pods/${podNamePrepared}`,
34469
- refetchInterval: 5e3,
34470
- queryKey: [clusterPrepared || "no-cluster", "pods", podNamePrepared],
34873
+ } = useK8sSmartResource({
34874
+ cluster: clusterPrepared,
34875
+ namespace: namespacePrepared,
34876
+ version: "v1",
34877
+ plural: "pods",
34878
+ fieldSelector: `metadata.name=${podNamePrepared}`,
34471
34879
  isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
34472
34880
  });
34881
+ const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
34473
34882
  if (isMultiqueryLoading) {
34474
34883
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34475
34884
  }
@@ -34505,6 +34914,37 @@ const PodLogs$1 = ({
34505
34914
  ] });
34506
34915
  };
34507
34916
 
34917
+ const getDataByPath = ({
34918
+ prefillValuesRaw,
34919
+ pathToData
34920
+ }) => {
34921
+ return Array.isArray(pathToData) ? _$1.get(prefillValuesRaw, pathToData) : jp.query(prefillValuesRaw, `$${pathToData}`)[0];
34922
+ };
34923
+ const getPrefillValuesWithForces = ({
34924
+ prefillValues,
34925
+ forcedKind,
34926
+ apiGroup,
34927
+ apiVersion
34928
+ }) => {
34929
+ if (!forcedKind) {
34930
+ return prefillValues;
34931
+ }
34932
+ const newValues = { ...prefillValues };
34933
+ if (typeof newValues === "object" && newValues !== null) {
34934
+ if ("kind" in newValues) {
34935
+ delete newValues.kind;
34936
+ }
34937
+ if ("apiVersion" in newValues) {
34938
+ delete newValues.apiVersion;
34939
+ }
34940
+ }
34941
+ return {
34942
+ kind: forcedKind,
34943
+ apiVersion: `${apiGroup ? `${apiGroup}/` : ""}${apiVersion}`,
34944
+ ...newValues
34945
+ };
34946
+ };
34947
+
34508
34948
  const YamlEditorSingleton$1 = ({
34509
34949
  data,
34510
34950
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -34520,7 +34960,9 @@ const YamlEditorSingleton$1 = ({
34520
34960
  apiGroup,
34521
34961
  apiVersion,
34522
34962
  typeName,
34963
+ forcedKind,
34523
34964
  prefillValuesRequestIndex,
34965
+ pathToData,
34524
34966
  substractHeight,
34525
34967
  ...props
34526
34968
  } = data;
@@ -34546,7 +34988,9 @@ const YamlEditorSingleton$1 = ({
34546
34988
  const apiGroupPrepared = apiGroup ? parseAll({ text: apiGroup, replaceValues, multiQueryData }) : "no-api-group";
34547
34989
  const apiVersionPrepared = apiVersion ? parseAll({ text: apiVersion, replaceValues, multiQueryData }) : "no-api-version";
34548
34990
  const typeNamePrepared = parseAll({ text: typeName, replaceValues, multiQueryData });
34549
- const prefillValues = multiQueryData[`req${prefillValuesRequestIndex}`];
34991
+ const prefillValuesRaw = multiQueryData[`req${prefillValuesRequestIndex}`];
34992
+ const prefillValues = pathToData ? getDataByPath({ prefillValuesRaw, pathToData }) : prefillValuesRaw;
34993
+ const prefillValuesWithForces = getPrefillValuesWithForces({ prefillValues, forcedKind, apiGroup, apiVersion });
34550
34994
  if (isMultiqueryLoading) {
34551
34995
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34552
34996
  }
@@ -34556,7 +35000,7 @@ const YamlEditorSingleton$1 = ({
34556
35000
  {
34557
35001
  cluster: clusterPrepared,
34558
35002
  theme,
34559
- prefillValuesSchema: prefillValues,
35003
+ prefillValuesSchema: prefillValuesWithForces,
34560
35004
  isNameSpaced,
34561
35005
  isCreate: false,
34562
35006
  type,
@@ -34655,7 +35099,7 @@ const ArrayOfObjectsToKeyValues = ({ data, children }) => {
34655
35099
  if (isMultiQueryErrors) {
34656
35100
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34657
35101
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
34658
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
35102
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
34659
35103
  ] });
34660
35104
  }
34661
35105
  const jsonRoot = multiQueryData[`req${reqIndex}`];
@@ -34722,7 +35166,7 @@ const ItemCounter = ({
34722
35166
  if (isMultiQueryErrors) {
34723
35167
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34724
35168
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
34725
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
35169
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
34726
35170
  ] });
34727
35171
  }
34728
35172
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -34779,7 +35223,7 @@ const KeyCounter = ({
34779
35223
  if (isMultiQueryErrors) {
34780
35224
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34781
35225
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
34782
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
35226
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
34783
35227
  ] });
34784
35228
  }
34785
35229
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -34957,11 +35401,7 @@ const toArray = (p) => (
34957
35401
  p === void 0 ? void 0 : Array.isArray(p) ? p : [p]
34958
35402
  );
34959
35403
 
34960
- const HiddenContainer = ({
34961
- name,
34962
- secondName,
34963
- children
34964
- }) => {
35404
+ const HiddenContainer = ({ name, secondName, children }) => {
34965
35405
  const hiddenPaths = useHiddenPathsLayout();
34966
35406
  const nameArr = toArray(name);
34967
35407
  const secondArr = toArray(secondName);
@@ -35164,7 +35604,7 @@ const Labels = ({ data, children }) => {
35164
35604
  if (isMultiQueryErrors) {
35165
35605
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35166
35606
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35167
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
35607
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35168
35608
  ] });
35169
35609
  }
35170
35610
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -35439,7 +35879,7 @@ const LabelsToSearchParams = ({ data, children }) => {
35439
35879
  if (isMultiQueryErrors) {
35440
35880
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35441
35881
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35442
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
35882
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35443
35883
  ] });
35444
35884
  }
35445
35885
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -35708,7 +36148,7 @@ const Taints = ({ data, children }) => {
35708
36148
  if (isMultiQueryErrors) {
35709
36149
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35710
36150
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
35711
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
36151
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35712
36152
  ] });
35713
36153
  }
35714
36154
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -35952,10 +36392,15 @@ const EditModal$1 = ({
35952
36392
  ...restField,
35953
36393
  name: [name, "operator"],
35954
36394
  rules: [
35955
- { required: true, message: "Operator is required." },
35956
- {
35957
- validator: (_, v) => v && operatorOptions.includes(v) ? Promise.resolve() : Promise.reject(new Error("Select a valid operator."))
35958
- }
36395
+ ({ getFieldValue }) => ({
36396
+ validator(_, v) {
36397
+ const nameV = getFieldValue(["tolerations", name, "key"]);
36398
+ if ((nameV === "nameV" || !nameV) && (!v || v !== "Exists")) {
36399
+ return Promise.reject(new Error("Operator must be Exists when `key` is empty"));
36400
+ }
36401
+ return Promise.resolve();
36402
+ }
36403
+ })
35959
36404
  ],
35960
36405
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35961
36406
  Select,
@@ -36081,7 +36526,7 @@ const Tolerations = ({
36081
36526
  if (isMultiQueryErrors) {
36082
36527
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36083
36528
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
36084
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
36529
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
36085
36530
  ] });
36086
36531
  }
36087
36532
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -36362,7 +36807,7 @@ const Annotations = ({
36362
36807
  if (isMultiQueryErrors) {
36363
36808
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36364
36809
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
36365
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
36810
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
36366
36811
  ] });
36367
36812
  }
36368
36813
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -36580,7 +37025,7 @@ const ConverterBytes = ({ data }) => {
36580
37025
  if (isError) {
36581
37026
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36582
37027
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
36583
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
37028
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
36584
37029
  ] });
36585
37030
  }
36586
37031
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -37397,7 +37842,7 @@ const SecretBase64Plain = ({ data }) => {
37397
37842
  if (isError) {
37398
37843
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
37399
37844
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
37400
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
37845
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
37401
37846
  ] });
37402
37847
  }
37403
37848
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -37471,30 +37916,6 @@ const SecretBase64Plain = ({ data }) => {
37471
37916
  ] });
37472
37917
  };
37473
37918
 
37474
- const fnv1a32 = (str) => {
37475
- let h = 2166136261;
37476
- for (const ch of str) {
37477
- h ^= ch.codePointAt(0);
37478
- h = (h >>> 0) * 16777619;
37479
- }
37480
- return h >>> 0;
37481
- };
37482
- const pickInRange = (u32, min, max) => min + u32 % (max - min + 1);
37483
- const hslFromString = (value, theme) => {
37484
- const hash = fnv1a32(value);
37485
- const hue = hash % 345;
37486
- const [sMin, sMax] = theme === "light" ? [90, 100] : [78, 80];
37487
- const [lMin, lMax] = theme === "light" ? [78, 80] : [25, 35];
37488
- const s = pickInRange(hash >>> 8, sMin, sMax);
37489
- const l = pickInRange(hash >>> 16, lMin, lMax);
37490
- return `hsl(${hue}, ${s}%, ${l}%)`;
37491
- };
37492
-
37493
- const getUppercase = (s) => {
37494
- const uppercases = [...s].filter((c) => c >= "A" && c <= "Z").join("");
37495
- return uppercases.length > 0 ? uppercases : s[0].toUpperCase();
37496
- };
37497
-
37498
37919
  const RoundSpan = styled.span`
37499
37920
  background-color: ${({ $bgColor }) => $bgColor || "none"};
37500
37921
  border-radius: 13px;
@@ -37529,7 +37950,7 @@ const ResourceBadge = ({ data }) => {
37529
37950
  if (isError) {
37530
37951
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
37531
37952
  /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { children: "Errors:" }),
37532
- /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e.message }, i)) })
37953
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
37533
37954
  ] });
37534
37955
  }
37535
37956
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
@@ -37584,6 +38005,8 @@ const Events$1 = ({
37584
38005
  baseFactoryNamespacedBuiltinKey,
37585
38006
  baseFactoryClusterSceopedBuiltinKey,
37586
38007
  baseNamespaceFactoryKey,
38008
+ baseNavigationPluralName,
38009
+ baseNavigationSpecificName,
37587
38010
  ...props
37588
38011
  } = data;
37589
38012
  const theme = useTheme();
@@ -37648,6 +38071,354 @@ const Events$1 = ({
37648
38071
  baseFactoryNamespacedBuiltinKey,
37649
38072
  baseFactoryClusterSceopedBuiltinKey,
37650
38073
  baseNamespaceFactoryKey,
38074
+ baseNavigationPluralName,
38075
+ baseNavigationSpecificName,
38076
+ ...props
38077
+ }
38078
+ ),
38079
+ children
38080
+ ] });
38081
+ };
38082
+
38083
+ const getKinds = async ({ clusterName }) => {
38084
+ const result = await axios.get(`/api/clusters/${clusterName}/openapi-bff/search/kinds/getKinds`);
38085
+ return result.data;
38086
+ };
38087
+
38088
+ const parseK8sVersion$1 = (raw) => {
38089
+ const m = /^v(?<major>\d+)(?:(?<stage>alpha|beta)(?<stageNum>\d+)?)?$/i.exec(raw ?? "");
38090
+ if (!m?.groups) return { rank: 0, major: -1, stageNum: -1 };
38091
+ const stage = (m.groups.stage ?? "").toLowerCase();
38092
+ const major = Number(m.groups.major);
38093
+ const stageNum = m.groups.stageNum ? Number(m.groups.stageNum) : 0;
38094
+ const rank = stage === "" ? 3 : stage === "beta" ? 2 : 1;
38095
+ return { rank, major, stageNum };
38096
+ };
38097
+ const versionToken$1 = (e) => e.version || (e.groupVersion?.split("/").pop() ?? "");
38098
+ const compareK8sVersionDesc$1 = (a, b) => {
38099
+ const pa = parseK8sVersion$1(versionToken$1(a));
38100
+ const pb = parseK8sVersion$1(versionToken$1(b));
38101
+ return pb.rank - pa.rank || pb.major - pa.major || pb.stageNum - pa.stageNum;
38102
+ };
38103
+ const orderVersions = (versions) => {
38104
+ const preferredIdx = versions.findIndex((v) => v.preferred === true);
38105
+ if (preferredIdx >= 0) {
38106
+ const preferred = versions[preferredIdx];
38107
+ const rest = versions.filter((_, i) => i !== preferredIdx).slice().sort(compareK8sVersionDesc$1);
38108
+ return [preferred, ...rest];
38109
+ }
38110
+ return versions.slice().sort(compareK8sVersionDesc$1);
38111
+ };
38112
+ const getSortedKindsAll = (index) => {
38113
+ const counts = index.items.reduce(
38114
+ (acc, item) => ({ ...acc, [item.kind]: (acc[item.kind] ?? 0) + 1 }),
38115
+ {}
38116
+ );
38117
+ const rows = index.items.flatMap((item) => {
38118
+ const ordered = orderVersions(item.versions);
38119
+ return ordered.map((v) => ({
38120
+ group: item.group,
38121
+ kind: item.kind,
38122
+ // clone to drop Readonly<> without changing fields (incl. preferred)
38123
+ version: { ...v },
38124
+ ...counts[item.kind] > 1 ? { notUnique: true } : {}
38125
+ }));
38126
+ });
38127
+ return rows.sort(
38128
+ (a, b) => a.kind.localeCompare(b.kind, void 0, { sensitivity: "base" }) || a.group.localeCompare(b.group, void 0, { sensitivity: "base" })
38129
+ );
38130
+ };
38131
+
38132
+ const parseApiVersion = (apiVersion) => {
38133
+ const parts = apiVersion.trim().split("/");
38134
+ return parts.length === 1 ? { group: "", version: parts[0] } : { group: parts[0], version: parts[1] };
38135
+ };
38136
+ const pluralByKind = (entries) => (kind, apiVersion) => {
38137
+ const norm = (s) => s.trim();
38138
+ const kindNorm = norm(kind);
38139
+ const gv = apiVersion ? parseApiVersion(apiVersion) : void 0;
38140
+ const candidates = entries.filter((e) => norm(e.kind) === kindNorm);
38141
+ if (candidates.length === 0) return void 0;
38142
+ const filtered = gv ? candidates.filter((e) => norm(e.group) === norm(gv.group) && e.version.version === gv.version) : candidates;
38143
+ if (filtered.length === 0) return void 0;
38144
+ const preferredFirst = gv ? filtered : [...filtered.filter((e) => e.version.preferred), ...filtered.filter((e) => !e.version.preferred)];
38145
+ const resources = preferredFirst.map((e) => e.version.resource).filter(Boolean);
38146
+ const uniq = Array.from(new Set(resources));
38147
+ if (!gv && uniq.length > 1) {
38148
+ const first = preferredFirst[0]?.version.resource;
38149
+ return first ?? void 0;
38150
+ }
38151
+ return uniq.length === 1 ? uniq[0] : void 0;
38152
+ };
38153
+
38154
+ const findOwnerReferencePath = (rawObject, jsonPathToArrayOfRefs, reference) => {
38155
+ if (!rawObject || !jsonPathToArrayOfRefs) return void 0;
38156
+ let arrayJsonPath = jsonPathToArrayOfRefs.trim();
38157
+ if (arrayJsonPath.startsWith(".")) {
38158
+ arrayJsonPath = `$${arrayJsonPath}`;
38159
+ }
38160
+ if (!arrayJsonPath.startsWith("$")) {
38161
+ arrayJsonPath = `$${arrayJsonPath}`;
38162
+ }
38163
+ arrayJsonPath = arrayJsonPath.replace(/\[\*\]$/, "");
38164
+ const nodes = jp.nodes(rawObject, arrayJsonPath);
38165
+ if (!nodes.length) return void 0;
38166
+ const arrayNode = nodes[0];
38167
+ const arr = arrayNode.value;
38168
+ if (!Array.isArray(arr)) return void 0;
38169
+ const index = arr.findIndex((item) => {
38170
+ if (!item) return false;
38171
+ return item.name === reference.name && item.kind === reference.kind && item.apiVersion === reference.apiVersion;
38172
+ });
38173
+ if (index === -1) return void 0;
38174
+ const basePathSegs = arrayNode.path.slice(1);
38175
+ return [...basePathSegs, index];
38176
+ };
38177
+ const parseDotPath$1 = (dotPath) => dotPath.split(".").filter(Boolean).map((seg) => seg.match(/^\d+$/) ? Number(seg) : seg);
38178
+ const resolveFormPath$1 = (pathInput, basePathForRelative) => {
38179
+ if (!pathInput) return [];
38180
+ if (Array.isArray(pathInput)) return pathInput;
38181
+ const pathStr = String(pathInput);
38182
+ const isRelative = pathStr.startsWith("./") || pathStr.startsWith("../");
38183
+ if (!isRelative) {
38184
+ return parseDotPath$1(pathStr);
38185
+ }
38186
+ let resolved = [...basePathForRelative];
38187
+ const parts = pathStr.split("/").filter(Boolean);
38188
+ for (const part of parts) {
38189
+ if (part === ".") {
38190
+ continue;
38191
+ }
38192
+ if (part === "..") {
38193
+ resolved = resolved.slice(0, -1);
38194
+ continue;
38195
+ }
38196
+ resolved.push(...parseDotPath$1(part));
38197
+ }
38198
+ return resolved;
38199
+ };
38200
+
38201
+ const RefElement = ({
38202
+ reference,
38203
+ keysToForcedLabel,
38204
+ forcedRelatedValuePath,
38205
+ rawObjectToFindLabel,
38206
+ jsonPathToArrayOfRefs,
38207
+ forcedNamespace,
38208
+ theme,
38209
+ baseprefix,
38210
+ cluster,
38211
+ getPlural,
38212
+ baseFactoryNamespacedAPIKey,
38213
+ baseFactoryClusterSceopedAPIKey,
38214
+ baseFactoryNamespacedBuiltinKey,
38215
+ baseFactoryClusterSceopedBuiltinKey,
38216
+ baseFactoriesMapping
38217
+ }) => {
38218
+ let forcedName;
38219
+ let objectNamespace;
38220
+ if (keysToForcedLabel && rawObjectToFindLabel) {
38221
+ forcedName = Array.isArray(keysToForcedLabel) ? _$1.get(rawObjectToFindLabel, keysToForcedLabel) : jp.query(rawObjectToFindLabel, `$${keysToForcedLabel}`)[0];
38222
+ }
38223
+ if (forcedRelatedValuePath && rawObjectToFindLabel) {
38224
+ try {
38225
+ const ownerRefPathSegs = findOwnerReferencePath(
38226
+ rawObjectToFindLabel,
38227
+ jsonPathToArrayOfRefs,
38228
+ // ".spec.customRef"
38229
+ reference
38230
+ );
38231
+ const relatedPath = forcedRelatedValuePath && ownerRefPathSegs ? resolveFormPath$1(forcedRelatedValuePath, ownerRefPathSegs) : void 0;
38232
+ if (relatedPath) {
38233
+ forcedName = _$1.get(rawObjectToFindLabel, relatedPath);
38234
+ }
38235
+ } catch {
38236
+ }
38237
+ }
38238
+ if (rawObjectToFindLabel) {
38239
+ try {
38240
+ const defaultFetched = _$1.get(rawObjectToFindLabel, ["metadata", "namespace"]);
38241
+ const socketFetched = _$1.get(rawObjectToFindLabel, ["items", 0, "metadata", "namespace"]);
38242
+ objectNamespace = socketFetched || defaultFetched;
38243
+ } catch {
38244
+ }
38245
+ }
38246
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
38247
+ ResourceLink,
38248
+ {
38249
+ kind: reference.kind,
38250
+ apiVersion: reference.apiVersion,
38251
+ namespace: forcedNamespace || reference.namespace || objectNamespace,
38252
+ forcedName,
38253
+ name: reference.name,
38254
+ theme,
38255
+ baseprefix,
38256
+ cluster,
38257
+ getPlural,
38258
+ baseFactoryNamespacedAPIKey,
38259
+ baseFactoryClusterSceopedAPIKey,
38260
+ baseFactoryNamespacedBuiltinKey,
38261
+ baseFactoryClusterSceopedBuiltinKey,
38262
+ baseFactoriesMapping
38263
+ }
38264
+ );
38265
+ };
38266
+
38267
+ const RefsList = ({
38268
+ theme,
38269
+ baseprefix,
38270
+ cluster,
38271
+ refsArr,
38272
+ keysToForcedLabel,
38273
+ forcedRelatedValuePath,
38274
+ rawObjectToFindLabel,
38275
+ jsonPathToArrayOfRefs,
38276
+ forcedNamespace,
38277
+ baseFactoryNamespacedAPIKey,
38278
+ baseFactoryClusterSceopedAPIKey,
38279
+ baseFactoryNamespacedBuiltinKey,
38280
+ baseFactoryClusterSceopedBuiltinKey,
38281
+ baseNavigationPluralName,
38282
+ baseNavigationSpecificName,
38283
+ listFlexProps
38284
+ }) => {
38285
+ const [kindIndex, setKindIndex] = useState();
38286
+ const [kindsWithVersion, setKindWithVersion] = useState();
38287
+ useEffect(() => {
38288
+ getKinds({ clusterName: cluster }).then((data) => {
38289
+ setKindIndex(data);
38290
+ setKindWithVersion(getSortedKindsAll(data));
38291
+ }).catch((error) => {
38292
+ console.error(error);
38293
+ });
38294
+ }, [cluster]);
38295
+ const { data: navigationDataArr } = useK8sSmartResource({
38296
+ cluster,
38297
+ group: "front.in-cloud.io",
38298
+ version: "v1alpha1",
38299
+ plural: baseNavigationPluralName,
38300
+ fieldSelector: `metadata.name=${baseNavigationSpecificName}`
38301
+ });
38302
+ const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
38303
+ const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
38304
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { vertical: true, gap: 8, ...listFlexProps, children: refsArr.map((ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
38305
+ RefElement,
38306
+ {
38307
+ reference: ref,
38308
+ keysToForcedLabel,
38309
+ forcedRelatedValuePath,
38310
+ rawObjectToFindLabel,
38311
+ jsonPathToArrayOfRefs,
38312
+ forcedNamespace,
38313
+ theme,
38314
+ baseprefix,
38315
+ cluster,
38316
+ getPlural,
38317
+ baseFactoryNamespacedAPIKey,
38318
+ baseFactoryClusterSceopedAPIKey,
38319
+ baseFactoryNamespacedBuiltinKey,
38320
+ baseFactoryClusterSceopedBuiltinKey,
38321
+ baseFactoriesMapping
38322
+ },
38323
+ JSON.stringify(ref)
38324
+ )) });
38325
+ };
38326
+
38327
+ const isOwnerReference = (value) => {
38328
+ if (!value || typeof value !== "object") {
38329
+ return false;
38330
+ }
38331
+ if (value === null) {
38332
+ return false;
38333
+ }
38334
+ if (!("apiVersion" in value) || typeof value.apiVersion !== "string" || !("kind" in value) || typeof value.kind !== "string" || !("name" in value) || typeof value.name !== "string") {
38335
+ return false;
38336
+ }
38337
+ return true;
38338
+ };
38339
+
38340
+ const OwnerRefs = ({
38341
+ data,
38342
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
38343
+ children
38344
+ }) => {
38345
+ const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
38346
+ const {
38347
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
38348
+ id,
38349
+ baseprefix,
38350
+ clusterNamePartOfUrl,
38351
+ reqIndex,
38352
+ errorText,
38353
+ notArrayErrorText,
38354
+ emptyArrayErrorText,
38355
+ isNotRefsArrayErrorText,
38356
+ containerStyle,
38357
+ listFlexProps,
38358
+ keysToForcedLabel,
38359
+ forcedRelatedValuePath,
38360
+ jsonPathToArrayOfRefs,
38361
+ forcedNamespace,
38362
+ baseFactoryNamespacedAPIKey,
38363
+ baseFactoryClusterSceopedAPIKey,
38364
+ baseFactoryNamespacedBuiltinKey,
38365
+ baseFactoryClusterSceopedBuiltinKey,
38366
+ baseNavigationPluralName,
38367
+ baseNavigationSpecificName,
38368
+ ...props
38369
+ } = data;
38370
+ const theme = useTheme();
38371
+ const partsOfUrl = usePartsOfUrl();
38372
+ const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
38373
+ acc[index.toString()] = value;
38374
+ return acc;
38375
+ }, {});
38376
+ const clusterName = prepareTemplate({
38377
+ template: clusterNamePartOfUrl,
38378
+ replaceValues
38379
+ });
38380
+ const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
38381
+ template: forcedNamespace,
38382
+ replaceValues
38383
+ }) : void 0;
38384
+ const jsonRoot = multiQueryData[`req${reqIndex}`];
38385
+ if (jsonRoot === void 0) {
38386
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
38387
+ }
38388
+ const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)[0];
38389
+ if (!Array.isArray(refsArr)) {
38390
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
38391
+ }
38392
+ if (refsArr.length === 0) {
38393
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
38394
+ }
38395
+ if (refsArr.some((el) => !isOwnerReference(el))) {
38396
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
38397
+ }
38398
+ const guardedRefsArr = refsArr;
38399
+ if (isMultiqueryLoading) {
38400
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
38401
+ }
38402
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
38403
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38404
+ RefsList,
38405
+ {
38406
+ theme,
38407
+ baseprefix,
38408
+ cluster: clusterName,
38409
+ refsArr: guardedRefsArr,
38410
+ keysToForcedLabel,
38411
+ forcedRelatedValuePath,
38412
+ jsonPathToArrayOfRefs,
38413
+ forcedNamespace: preparedForcedNamespace,
38414
+ rawObjectToFindLabel: jsonRoot,
38415
+ baseFactoryNamespacedAPIKey,
38416
+ baseFactoryClusterSceopedAPIKey,
38417
+ baseFactoryNamespacedBuiltinKey,
38418
+ baseFactoryClusterSceopedBuiltinKey,
38419
+ baseNavigationPluralName,
38420
+ baseNavigationSpecificName,
38421
+ listFlexProps,
37651
38422
  ...props
37652
38423
  }
37653
38424
  ),
@@ -37691,7 +38462,8 @@ const DynamicComponents = {
37691
38462
  ConverterBytes,
37692
38463
  SecretBase64Plain,
37693
38464
  ResourceBadge,
37694
- Events: Events$1
38465
+ Events: Events$1,
38466
+ OwnerRefs
37695
38467
  };
37696
38468
 
37697
38469
  const prepareUrlsToFetchForDynamicRenderer = ({
@@ -37710,13 +38482,30 @@ const prepareUrlsToFetchForDynamicRenderer = ({
37710
38482
  );
37711
38483
  };
37712
38484
 
38485
+ const STRING_KEYS = ["cluster", "group", "version", "plural", "namespace", "fieldSelector", "labelSelector"];
37713
38486
  const DynamicRendererWithProviders = (props) => {
37714
38487
  const location = useLocation();
37715
38488
  const { urlsToFetch, dataToApplyToContext, theme, nodeTerminalDefaultProfile, disableEventBubbling } = props;
38489
+ const directUrls = urlsToFetch.filter((el) => typeof el === "string");
38490
+ const k8sResourcesUrls = urlsToFetch.filter((el) => typeof el !== "string");
37716
38491
  const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
37717
- urls: urlsToFetch,
38492
+ urls: directUrls,
37718
38493
  locationPathname: location.pathname
37719
38494
  });
38495
+ const preparedK8sResoucesUrls = k8sResourcesUrls.map((res) => {
38496
+ let next = { ...res };
38497
+ for (const key of STRING_KEYS) {
38498
+ const val = next[key];
38499
+ if (typeof val === "string" && val.length > 0) {
38500
+ const prepared = prepareUrlsToFetchForDynamicRenderer({
38501
+ urls: [val],
38502
+ locationPathname: location.pathname
38503
+ });
38504
+ next = { ...next, [key]: prepared[0] ?? val };
38505
+ }
38506
+ }
38507
+ return next;
38508
+ });
37720
38509
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
37721
38510
  CursorDefaultDiv,
37722
38511
  {
@@ -37726,7 +38515,14 @@ const DynamicRendererWithProviders = (props) => {
37726
38515
  e.stopPropagation();
37727
38516
  }
37728
38517
  },
37729
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FactoryConfigContextProvider, { value: { nodeTerminalDefaultProfile }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, dataToApplyToContext, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) }) }) })
38518
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FactoryConfigContextProvider, { value: { nodeTerminalDefaultProfile }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
38519
+ MultiQueryProvider,
38520
+ {
38521
+ items: [...preparedK8sResoucesUrls, ...preparedUrlsToFetch],
38522
+ dataToApplyToContext,
38523
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props })
38524
+ }
38525
+ ) }) }) })
37730
38526
  }
37731
38527
  );
37732
38528
  };
@@ -38335,6 +39131,7 @@ const EnrichedTableProvider = ({
38335
39131
  setIsError(void 0);
38336
39132
  setIsLoading(true);
38337
39133
  const payload = {
39134
+ clusterName: cluster,
38338
39135
  customizationId,
38339
39136
  tableMappingsReplaceValues,
38340
39137
  forceDefaultAdditionalPrinterColumns,
@@ -46652,9 +47449,56 @@ const YamlEditorSingleton = ({
46652
47449
  const [yamlData, setYamlData] = useState("");
46653
47450
  const [isLoading, setIsLoading] = useState(false);
46654
47451
  const [error, setError] = useState();
47452
+ const initialPrefillYamlRef = useRef(null);
47453
+ const latestPrefillYamlRef = useRef(null);
47454
+ const firstLoadRef = useRef(true);
47455
+ const handleReload = () => {
47456
+ const nextYaml = latestPrefillYamlRef.current ?? initialPrefillYamlRef.current;
47457
+ if (nextYaml !== null) {
47458
+ setYamlData(nextYaml);
47459
+ }
47460
+ };
47461
+ const openNotificationYamlChanged = useCallback(() => {
47462
+ const key = `open${Date.now()}`;
47463
+ const btn = /* @__PURE__ */ jsxRuntimeExports.jsx(
47464
+ Button,
47465
+ {
47466
+ type: "primary",
47467
+ size: "small",
47468
+ onClick: () => {
47469
+ handleReload();
47470
+ api.destroy(key);
47471
+ },
47472
+ children: "Reload"
47473
+ }
47474
+ );
47475
+ api.info({
47476
+ message: "Data changed",
47477
+ description: "Reload will flush changes and reload data to latest",
47478
+ btn,
47479
+ key,
47480
+ onClose: () => console.log("Notification closed"),
47481
+ placement: "bottomRight",
47482
+ duration: 30
47483
+ // keep it open until user closes
47484
+ });
47485
+ }, [api]);
46655
47486
  useEffect(() => {
46656
- setYamlData(stringify(prefillValuesSchema));
46657
- }, [prefillValuesSchema]);
47487
+ if (prefillValuesSchema === void 0) return;
47488
+ console.log(prefillValuesSchema);
47489
+ const nextYaml = stringify(prefillValuesSchema);
47490
+ if (firstLoadRef.current) {
47491
+ initialPrefillYamlRef.current = nextYaml;
47492
+ latestPrefillYamlRef.current = nextYaml;
47493
+ setYamlData(nextYaml);
47494
+ firstLoadRef.current = false;
47495
+ return;
47496
+ }
47497
+ if (nextYaml !== latestPrefillYamlRef.current) {
47498
+ openNotificationYamlChanged();
47499
+ }
47500
+ latestPrefillYamlRef.current = nextYaml;
47501
+ }, [prefillValuesSchema, openNotificationYamlChanged]);
46658
47502
  const onSubmit = () => {
46659
47503
  setIsLoading(true);
46660
47504
  setError(void 0);
@@ -46726,7 +47570,8 @@ const YamlEditorSingleton = ({
46726
47570
  ) }),
46727
47571
  !readOnly && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
46728
47572
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
46729
- backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => navigate(backlink), children: "Cancel" })
47573
+ backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: () => navigate(backlink), children: "Cancel" }),
47574
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onClick: handleReload, children: "Reload" })
46730
47575
  ] }) }),
46731
47576
  error && /* @__PURE__ */ jsxRuntimeExports.jsxs(
46732
47577
  Modal,
@@ -49819,7 +50664,7 @@ const BlackholeForm = ({
49819
50664
  ] });
49820
50665
  };
49821
50666
 
49822
- const BlackholeFormDataProvider = ({
50667
+ const BlackholeFormProvider = ({
49823
50668
  theme,
49824
50669
  cluster,
49825
50670
  urlParams,
@@ -50309,28 +51154,14 @@ const MarketplaceCard = ({
50309
51154
  apiVersion,
50310
51155
  baseprefix
50311
51156
  });
50312
- const { state, status, lastError } = useListWatch({
50313
- wsUrl: `/api/clusters/${clusterName}/openapi-bff-ws/listThenWatch/listWatchWs`,
50314
- paused: false,
50315
- ignoreRemove: false,
50316
- autoDrain: true,
50317
- preserveStateOnUrlChange: true,
50318
- query: {
50319
- namespace,
50320
- apiVersion: apiVersion || "",
50321
- apiGroup,
50322
- plural: type
50323
- },
51157
+ const { data: k8sList, error: k8sListError } = useK8sSmartResource({
51158
+ cluster: clusterName || "",
51159
+ namespace,
51160
+ group: apiGroup,
51161
+ version: apiVersion || "",
51162
+ plural: type,
50324
51163
  isEnabled: Boolean(apiVersion && addedMode && type !== "direct")
50325
51164
  });
50326
- const k8sListError = status === "closed" && lastError ? lastError : void 0;
50327
- const k8sList = {
50328
- items: state.order.map((key) => {
50329
- const res = state.byKey[key];
50330
- return res;
50331
- })
50332
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50333
- };
50334
51165
  if (addedMode && (k8sListError || type === "direct") && !showZeroResources) {
50335
51166
  return null;
50336
51167
  }
@@ -50459,30 +51290,17 @@ const MarketPlace = ({
50459
51290
  const [filteredAndSortedData, setFilterAndSortedData] = useState([]);
50460
51291
  const [uniqueTags, setUniqueTags] = useState([]);
50461
51292
  const [selectedTags, setSelectedTags] = useState([]);
50462
- const { state, status, lastError } = useListWatch({
50463
- wsUrl: `/api/clusters/${clusterName}/openapi-bff-ws/listThenWatch/listWatchWs`,
50464
- paused: false,
50465
- ignoreRemove: false,
50466
- autoDrain: true,
50467
- preserveStateOnUrlChange: true,
50468
- query: {
50469
- apiVersion: baseApiVersion,
50470
- apiGroup: baseApiGroup,
50471
- plural: mpResourceName
50472
- },
50473
- isEnabled: clusterName !== void 0
51293
+ const {
51294
+ data: marketplacePanels,
51295
+ isLoading,
51296
+ error
51297
+ } = useK8sSmartResource({
51298
+ cluster: clusterName || "",
51299
+ group: baseApiGroup,
51300
+ version: baseApiVersion,
51301
+ plural: mpResourceName,
51302
+ isEnabled: Boolean(clusterName !== void 0)
50474
51303
  });
50475
- const isLoading = status === "connecting";
50476
- const error = status === "closed" && lastError ? lastError : void 0;
50477
- const marketplacePanels = useMemo(() => {
50478
- return {
50479
- items: state.order.map((key) => {
50480
- const res = state.byKey[key];
50481
- return res;
50482
- })
50483
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50484
- };
50485
- }, [state]);
50486
51304
  const createPermission = usePermissions({
50487
51305
  group: baseApiGroup,
50488
51306
  resource: mpResourceName,
@@ -50781,52 +51599,30 @@ const ProjectInfoCard = ({
50781
51599
  children
50782
51600
  }) => {
50783
51601
  const navigate = useNavigate();
50784
- const { state, status } = useListWatch({
50785
- wsUrl: `/api/clusters/${clusterName}/openapi-bff-ws/listThenWatch/listWatchWs`,
50786
- paused: false,
50787
- ignoreRemove: false,
50788
- autoDrain: true,
50789
- preserveStateOnUrlChange: true,
50790
- query: {
50791
- apiVersion: baseApiVersion,
50792
- apiGroup: baseApiGroup,
50793
- plural: mpResourceName
50794
- },
50795
- isEnabled: clusterName !== void 0
50796
- });
50797
- const marketplaceIsLoading = status === "connecting";
50798
- const marketplacePanels = {
50799
- items: state.order.map((key) => {
50800
- const res = state.byKey[key];
50801
- return res;
50802
- })
50803
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
50804
- };
50805
51602
  const {
50806
- state: stateProject,
50807
- status: statusProject,
50808
- lastError: lastErrorProject
50809
- } = useListWatch({
50810
- wsUrl: `/api/clusters/${clusterName}/openapi-bff-ws/listThenWatch/listWatchWs`,
50811
- paused: false,
50812
- ignoreRemove: false,
50813
- autoDrain: true,
50814
- preserveStateOnUrlChange: true,
50815
- query: {
50816
- apiVersion: baseProjectVersion,
50817
- apiGroup: baseProjectApiGroup,
50818
- plural: projectResourceName,
50819
- fieldSelector: `metadata.name=${namespace}`
50820
- },
50821
- isEnabled: clusterName !== void 0
51603
+ data: marketplacePanels,
51604
+ isLoading: marketplaceIsLoading
51605
+ // error: marketplaceError,
51606
+ } = useK8sSmartResource({
51607
+ cluster: clusterName || "",
51608
+ group: baseApiGroup,
51609
+ version: baseApiVersion,
51610
+ plural: mpResourceName,
51611
+ isEnabled: Boolean(clusterName !== void 0)
50822
51612
  });
50823
- const isLoading = statusProject === "connecting";
50824
- const error = statusProject === "closed" && lastErrorProject ? lastErrorProject : void 0;
50825
- const projectArr = stateProject.order.map((key) => {
50826
- const res = stateProject.byKey[key];
50827
- return res;
51613
+ const {
51614
+ data: projectArr,
51615
+ isLoading,
51616
+ error
51617
+ } = useK8sSmartResource({
51618
+ cluster: clusterName || "",
51619
+ group: baseProjectApiGroup,
51620
+ version: baseProjectVersion,
51621
+ plural: projectResourceName,
51622
+ fieldSelector: `metadata.name=${namespace}`,
51623
+ isEnabled: Boolean(clusterName !== void 0)
50828
51624
  });
50829
- const project = projectArr.length > 0 ? projectArr[0] : void 0;
51625
+ const project = projectArr && projectArr.items && projectArr.items.length > 0 ? projectArr.items[0] : void 0;
50830
51626
  const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
50831
51627
  const updatePermission = usePermissions({
50832
51628
  group: baseProjectApiGroup,
@@ -52132,77 +52928,6 @@ const Search = ({ theme: theme$1, form, constants, kindsWithVersion }) => {
52132
52928
  );
52133
52929
  };
52134
52930
 
52135
- const getKinds = async ({ clusterName }) => {
52136
- const result = await axios.get(`/api/clusters/${clusterName}/openapi-bff/search/kinds/getKinds`);
52137
- return result.data;
52138
- };
52139
-
52140
- const parseK8sVersion$1 = (raw) => {
52141
- const m = /^v(?<major>\d+)(?:(?<stage>alpha|beta)(?<stageNum>\d+)?)?$/i.exec(raw ?? "");
52142
- if (!m?.groups) return { rank: 0, major: -1, stageNum: -1 };
52143
- const stage = (m.groups.stage ?? "").toLowerCase();
52144
- const major = Number(m.groups.major);
52145
- const stageNum = m.groups.stageNum ? Number(m.groups.stageNum) : 0;
52146
- const rank = stage === "" ? 3 : stage === "beta" ? 2 : 1;
52147
- return { rank, major, stageNum };
52148
- };
52149
- const versionToken$1 = (e) => e.version || (e.groupVersion?.split("/").pop() ?? "");
52150
- const compareK8sVersionDesc$1 = (a, b) => {
52151
- const pa = parseK8sVersion$1(versionToken$1(a));
52152
- const pb = parseK8sVersion$1(versionToken$1(b));
52153
- return pb.rank - pa.rank || pb.major - pa.major || pb.stageNum - pa.stageNum;
52154
- };
52155
- const orderVersions = (versions) => {
52156
- const preferredIdx = versions.findIndex((v) => v.preferred === true);
52157
- if (preferredIdx >= 0) {
52158
- const preferred = versions[preferredIdx];
52159
- const rest = versions.filter((_, i) => i !== preferredIdx).slice().sort(compareK8sVersionDesc$1);
52160
- return [preferred, ...rest];
52161
- }
52162
- return versions.slice().sort(compareK8sVersionDesc$1);
52163
- };
52164
- const getSortedKindsAll = (index) => {
52165
- const counts = index.items.reduce(
52166
- (acc, item) => ({ ...acc, [item.kind]: (acc[item.kind] ?? 0) + 1 }),
52167
- {}
52168
- );
52169
- const rows = index.items.flatMap((item) => {
52170
- const ordered = orderVersions(item.versions);
52171
- return ordered.map((v) => ({
52172
- group: item.group,
52173
- kind: item.kind,
52174
- // clone to drop Readonly<> without changing fields (incl. preferred)
52175
- version: { ...v },
52176
- ...counts[item.kind] > 1 ? { notUnique: true } : {}
52177
- }));
52178
- });
52179
- return rows.sort(
52180
- (a, b) => a.kind.localeCompare(b.kind, void 0, { sensitivity: "base" }) || a.group.localeCompare(b.group, void 0, { sensitivity: "base" })
52181
- );
52182
- };
52183
-
52184
- const parseApiVersion = (apiVersion) => {
52185
- const parts = apiVersion.trim().split("/");
52186
- return parts.length === 1 ? { group: "", version: parts[0] } : { group: parts[0], version: parts[1] };
52187
- };
52188
- const pluralByKind = (entries) => (kind, apiVersion) => {
52189
- const norm = (s) => s.trim();
52190
- const kindNorm = norm(kind);
52191
- const gv = apiVersion ? parseApiVersion(apiVersion) : void 0;
52192
- const candidates = entries.filter((e) => norm(e.kind) === kindNorm);
52193
- if (candidates.length === 0) return void 0;
52194
- const filtered = gv ? candidates.filter((e) => norm(e.group) === norm(gv.group) && e.version.version === gv.version) : candidates;
52195
- if (filtered.length === 0) return void 0;
52196
- const preferredFirst = gv ? filtered : [...filtered.filter((e) => e.version.preferred), ...filtered.filter((e) => !e.version.preferred)];
52197
- const resources = preferredFirst.map((e) => e.version.resource).filter(Boolean);
52198
- const uniq = Array.from(new Set(resources));
52199
- if (!gv && uniq.length > 1) {
52200
- const first = preferredFirst[0]?.version.resource;
52201
- return first ?? void 0;
52202
- }
52203
- return uniq.length === 1 ? uniq[0] : void 0;
52204
- };
52205
-
52206
52931
  const eventKey = (e) => {
52207
52932
  const n = e.metadata?.name ?? "";
52208
52933
  const ns = e.metadata?.namespace ?? "";
@@ -52272,39 +52997,6 @@ const timeAgo = (iso) => {
52272
52997
  }
52273
52998
  return new Date(iso).toLocaleString();
52274
52999
  };
52275
- const getResourceLink = ({
52276
- baseprefix,
52277
- cluster,
52278
- namespace,
52279
- apiGroupVersion,
52280
- pluralName,
52281
- name,
52282
- baseFactoryNamespacedAPIKey,
52283
- baseFactoryClusterSceopedAPIKey,
52284
- baseFactoryNamespacedBuiltinKey,
52285
- baseFactoryClusterSceopedBuiltinKey
52286
- }) => {
52287
- if (!pluralName || !name) {
52288
- return void 0;
52289
- }
52290
- if (apiGroupVersion === "v1") {
52291
- return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${namespace ? baseFactoryNamespacedBuiltinKey : baseFactoryClusterSceopedBuiltinKey}/${apiGroupVersion}/${pluralName}/${name}`;
52292
- }
52293
- return `${baseprefix}/${cluster}${namespace ? `/${namespace}` : ""}/factory/${namespace ? baseFactoryNamespacedAPIKey : baseFactoryClusterSceopedAPIKey}/${apiGroupVersion}/${pluralName}/${name}`;
52294
- };
52295
- const getNamespaceLink = ({
52296
- baseprefix,
52297
- cluster,
52298
- apiGroupVersion,
52299
- pluralName,
52300
- namespace,
52301
- baseNamespaceFactoryKey
52302
- }) => {
52303
- if (!namespace) {
52304
- return void 0;
52305
- }
52306
- return `${baseprefix}/${cluster}/factory/${baseNamespaceFactoryKey}/${apiGroupVersion}/${pluralName}/${namespace}`;
52307
- };
52308
53000
  const formatEventSummary = (event) => {
52309
53001
  if (!event.deprecatedCount || !event.deprecatedFirstTimestamp) {
52310
53002
  return void 0;
@@ -52383,28 +53075,12 @@ const EventRow = ({
52383
53075
  baseFactoryClusterSceopedAPIKey,
52384
53076
  baseFactoryNamespacedBuiltinKey,
52385
53077
  baseFactoryClusterSceopedBuiltinKey,
52386
- baseNamespaceFactoryKey
53078
+ baseNamespaceFactoryKey,
53079
+ baseFactoriesMapping
52387
53080
  }) => {
52388
53081
  const { token } = theme.useToken();
52389
53082
  const navigate = useNavigate();
52390
- const abbr = e.regarding?.kind ? getUppercase(e.regarding.kind) : void 0;
52391
- const bgColor = e.regarding?.kind && abbr ? hslFromString(e.regarding?.kind, theme$1) : "initial";
52392
53083
  const bgColorNamespace = hslFromString("Namespace", theme$1);
52393
- const regardingKind = e.regarding?.kind;
52394
- const regardingApiVersion = e.regarding?.apiVersion || "v1";
52395
- const pluralName = regardingKind && regardingApiVersion ? getPlural?.(regardingKind, regardingApiVersion) : void 0;
52396
- const resourceLink = getResourceLink({
52397
- baseprefix,
52398
- cluster,
52399
- namespace: e.regarding?.namespace,
52400
- apiGroupVersion: regardingApiVersion,
52401
- pluralName,
52402
- name: e.regarding?.name,
52403
- baseFactoryNamespacedAPIKey,
52404
- baseFactoryClusterSceopedAPIKey,
52405
- baseFactoryNamespacedBuiltinKey,
52406
- baseFactoryClusterSceopedBuiltinKey
52407
- });
52408
53084
  const namespaceLink = getNamespaceLink({
52409
53085
  baseprefix,
52410
53086
  cluster,
@@ -52421,19 +53097,24 @@ const EventRow = ({
52421
53097
  children: [
52422
53098
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "space-between", align: "center", children: [
52423
53099
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 16, children: [
52424
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
52425
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.Abbr, { $bgColor: bgColor, children: abbr }),
52426
- resourceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
52427
- Typography.Link,
52428
- {
52429
- onClick: (e2) => {
52430
- e2.preventDefault();
52431
- navigate(resourceLink);
52432
- },
52433
- children: e.regarding?.name
52434
- }
52435
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography.Text, { children: e.regarding?.name })
52436
- ] }),
53100
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
53101
+ ResourceLink,
53102
+ {
53103
+ kind: e.regarding?.kind,
53104
+ apiVersion: e.regarding?.apiVersion || "v1",
53105
+ namespace: e.regarding?.namespace,
53106
+ name: e.regarding?.name,
53107
+ theme: theme$1,
53108
+ baseprefix,
53109
+ cluster,
53110
+ getPlural,
53111
+ baseFactoryNamespacedAPIKey,
53112
+ baseFactoryClusterSceopedAPIKey,
53113
+ baseFactoryNamespacedBuiltinKey,
53114
+ baseFactoryClusterSceopedBuiltinKey,
53115
+ baseFactoriesMapping
53116
+ }
53117
+ ),
52437
53118
  e.regarding?.namespace && /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { align: "center", gap: 8, children: [
52438
53119
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.Abbr, { $bgColor: bgColorNamespace, children: "NS" }),
52439
53120
  namespaceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -52563,7 +53244,9 @@ const Events = ({
52563
53244
  baseFactoryClusterSceopedAPIKey,
52564
53245
  baseFactoryNamespacedBuiltinKey,
52565
53246
  baseFactoryClusterSceopedBuiltinKey,
52566
- baseNamespaceFactoryKey
53247
+ baseNamespaceFactoryKey,
53248
+ baseNavigationPluralName,
53249
+ baseNavigationSpecificName
52567
53250
  }) => {
52568
53251
  const { token } = theme.useToken();
52569
53252
  const [kindIndex, setKindIndex] = useState();
@@ -52576,6 +53259,13 @@ const Events = ({
52576
53259
  console.error(error);
52577
53260
  });
52578
53261
  }, [cluster]);
53262
+ const { data: navigationDataArr } = useK8sSmartResource({
53263
+ cluster,
53264
+ group: "front.in-cloud.io",
53265
+ version: "v1alpha1",
53266
+ plural: baseNavigationPluralName,
53267
+ fieldSelector: `metadata.name=${baseNavigationSpecificName}`
53268
+ });
52579
53269
  const [isPaused, setIsPaused] = useState(false);
52580
53270
  const pausedRef = useRef(isPaused);
52581
53271
  useEffect(() => {
@@ -52788,6 +53478,7 @@ const Events = ({
52788
53478
  }, [hasMore, sendScroll]);
52789
53479
  const total = state.order.length;
52790
53480
  const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
53481
+ const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
52791
53482
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.Root, { $substractHeight: substractHeight || 340, children: [
52792
53483
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled.Header, { children: [
52793
53484
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.HeaderLeftSide, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "start", align: "center", gap: 10, children: [
@@ -52848,7 +53539,8 @@ const Events = ({
52848
53539
  baseFactoryClusterSceopedAPIKey,
52849
53540
  baseFactoryNamespacedBuiltinKey,
52850
53541
  baseFactoryClusterSceopedBuiltinKey,
52851
- baseNamespaceFactoryKey
53542
+ baseNamespaceFactoryKey,
53543
+ baseFactoriesMapping
52852
53544
  },
52853
53545
  k
52854
53546
  )) : /* @__PURE__ */ jsxRuntimeExports.jsx(Empty, { description: "No events" }),
@@ -53047,6 +53739,34 @@ const isMultilineFromYaml = (yamlContent, fieldPath) => {
53047
53739
  }
53048
53740
  };
53049
53741
 
53742
+ const arraysEqual = (arr1, arr2) => {
53743
+ if (arr1.length !== arr2.length) {
53744
+ return false;
53745
+ }
53746
+ for (let i = 0; i < arr1.length; i++) {
53747
+ if (typeof arr2[i] === "number") {
53748
+ if (arr1[i] !== String(arr2[i])) {
53749
+ return false;
53750
+ }
53751
+ }
53752
+ if (arr1[i] !== arr2[i]) {
53753
+ return false;
53754
+ }
53755
+ }
53756
+ return true;
53757
+ };
53758
+ const includesArray = (matrix, target) => {
53759
+ if (!matrix) {
53760
+ return false;
53761
+ }
53762
+ for (const row of matrix) {
53763
+ if (arraysEqual(row, target)) {
53764
+ return true;
53765
+ }
53766
+ }
53767
+ return false;
53768
+ };
53769
+
53050
53770
  const getClusterList = async () => {
53051
53771
  return axios.get("/clusterlist");
53052
53772
  };
@@ -53468,5 +54188,18 @@ const useCrdData = ({
53468
54188
  });
53469
54189
  };
53470
54190
 
53471
- export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, CursorDefaultDiv, CursorPointerTag, CursorPointerTagMinContent, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EarthIcon, EditIcon, EnrichedTable, EnrichedTableProvider, Events, FlexGrow, LockedIcon, LookingGlassIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard, MinusIcon, NodeTerminal, PaddingContainer, PauseCircleIcon, PlusIcon, PodLogs, PodLogsMonaco, PodTerminal, ProjectInfoCard, ResumeCircleIcon, Search, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deepMerge, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBackLinkToTable, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getKinds, getLinkToApiForm, getLinkToBuiltinForm, getLinkToForm, getObjectFormItemsDraft, getPrefixSubarrays, getSortedKinds, getSortedKindsAll, getStringByName, getSwagger, getUppercase, groupsToTreeData, hslFromString, isFlatObject, isMultilineFromYaml, isMultilineString, kindByGvr, namespacedByGvr, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, pluralByKind, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, useInfiniteSentinel, useListWatch, usePermissions };
54191
+ const useInfiniteSentinel = (sentinelRef, hasMore, onNeedMore) => {
54192
+ useEffect(() => {
54193
+ const el = sentinelRef.current;
54194
+ if (!el) return void 0;
54195
+ const io = new IntersectionObserver((entries) => {
54196
+ const visible = entries.some((e) => e.isIntersecting);
54197
+ if (visible && hasMore) onNeedMore();
54198
+ });
54199
+ io.observe(el);
54200
+ return () => io.disconnect();
54201
+ }, [sentinelRef, hasMore, onNeedMore]);
54202
+ };
54203
+
54204
+ export { BackToDefaultIcon, BlackholeForm, BlackholeFormProvider, ContentCard$1 as ContentCard, CursorDefaultDiv, CursorPointerTag, CursorPointerTagMinContent, CustomSelect$4 as CustomSelect, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EarthIcon, EditIcon, EnrichedTable, EnrichedTableProvider, Events, FlexGrow, LockedIcon, LookingGlassIcon, ManageableBreadcrumbs, ManageableBreadcrumbsProvider, ManageableSidebar, ManageableSidebarProvider, MarketPlace, MarketplaceCard, MinusIcon, NodeTerminal, PaddingContainer, PauseCircleIcon, PlusIcon, PodLogs, PodLogsMonaco, PodTerminal, ProjectInfoCard, ResourceLink, ResumeCircleIcon, Search, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UncontrolledSelect, UnlockedIcon, UpIcon, YamlEditorSingleton, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deepMerge, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getKinds, getLinkToApiForm, getLinkToBuiltinForm, getLinkToForm, getNamespaceLink, getObjectFormItemsDraft, getPrefixSubarrays, getResourceLink, getSortedKinds, getSortedKindsAll, getStringByName, getSwagger, getUppercase, groupsToTreeData, hslFromString, includesArray, isFlatObject, isMultilineFromYaml, isMultilineString, kindByGvr, namespacedByGvr, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, pluralByKind, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, useInfiniteSentinel, useK8sSmartResource, useK8sVerbs, useListWatch, usePermissions };
53472
54205
  //# sourceMappingURL=openapi-k8s-toolkit.es.js.map