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

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 +1324 -591
  2. package/dist/openapi-k8s-toolkit.es.js.map +1 -1
  3. package/dist/openapi-k8s-toolkit.umd.js +1328 -590
  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 +16 -0
  79. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/index.d.ts +3 -0
  80. package/dist/types/components/molecules/ManageableSidebar/{utils.d.ts → organisms/ManageableSidebarProvider/utils.d.ts} +2 -1
  81. package/dist/types/components/molecules/ManageableSidebar/organisms/index.d.ts +4 -0
  82. package/dist/types/components/molecules/MarketPlace/atoms/AddCard/index.d.ts +1 -1
  83. package/dist/types/components/molecules/MarketPlace/atoms/index.d.ts +1 -1
  84. package/dist/types/components/molecules/MarketPlace/molecules/AddEditFormModal/index.d.ts +1 -1
  85. package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/index.d.ts +2 -1
  86. package/dist/types/components/molecules/MarketPlace/molecules/SearchTextInput/index.d.ts +1 -1
  87. package/dist/types/components/molecules/MarketPlace/molecules/index.d.ts +4 -3
  88. package/dist/types/components/molecules/ProjectInfoCard/molecules/DropdownAccessGroups/index.d.ts +1 -1
  89. package/dist/types/components/molecules/ProjectInfoCard/molecules/DropdownActions/index.d.ts +1 -1
  90. package/dist/types/components/molecules/ProjectInfoCard/molecules/index.d.ts +2 -2
  91. package/dist/types/components/molecules/Search/Search.d.ts +1 -2
  92. package/dist/types/components/molecules/Search/index.d.ts +1 -0
  93. package/dist/types/components/molecules/Terminals/NodeTerminal/molecules/XTerminal/index.d.ts +1 -1
  94. package/dist/types/components/molecules/Terminals/NodeTerminal/molecules/index.d.ts +1 -1
  95. package/dist/types/components/molecules/Terminals/PodLogs/molecules/XTerminal/index.d.ts +1 -1
  96. package/dist/types/components/molecules/Terminals/PodLogs/molecules/index.d.ts +1 -1
  97. package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/MonacoEditor/index.d.ts +1 -1
  98. package/dist/types/components/molecules/Terminals/PodLogsMonaco/molecules/index.d.ts +1 -1
  99. package/dist/types/components/molecules/Terminals/PodTerminal/molecules/XTerminal/index.d.ts +1 -1
  100. package/dist/types/components/molecules/Terminals/PodTerminal/molecules/index.d.ts +1 -1
  101. package/dist/types/components/molecules/Terminals/index.d.ts +8 -4
  102. package/dist/types/components/molecules/index.d.ts +18 -9
  103. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/index.d.ts +1 -1
  104. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/EditModal/index.d.ts +1 -1
  105. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/molecules/index.d.ts +1 -1
  106. package/dist/types/components/organisms/DynamicComponents/molecules/AntdButton/index.d.ts +1 -1
  107. package/dist/types/components/organisms/DynamicComponents/molecules/AntdCard/index.d.ts +1 -1
  108. package/dist/types/components/organisms/DynamicComponents/molecules/AntdCol/index.d.ts +1 -1
  109. package/dist/types/components/organisms/DynamicComponents/molecules/AntdFlex/index.d.ts +1 -1
  110. package/dist/types/components/organisms/DynamicComponents/molecules/AntdLink/index.d.ts +1 -1
  111. package/dist/types/components/organisms/DynamicComponents/molecules/AntdRow/index.d.ts +1 -1
  112. package/dist/types/components/organisms/DynamicComponents/molecules/AntdTabs/index.d.ts +1 -1
  113. package/dist/types/components/organisms/DynamicComponents/molecules/AntdText/index.d.ts +1 -1
  114. package/dist/types/components/organisms/DynamicComponents/molecules/ArrayOfObjectsToKeyValues/index.d.ts +1 -1
  115. package/dist/types/components/organisms/DynamicComponents/molecules/ContentCard/index.d.ts +1 -1
  116. package/dist/types/components/organisms/DynamicComponents/molecules/ConverterBytes/index.d.ts +1 -1
  117. package/dist/types/components/organisms/DynamicComponents/molecules/DefaultDiv/index.d.ts +1 -1
  118. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/index.d.ts +1 -1
  119. package/dist/types/components/organisms/DynamicComponents/molecules/Events/index.d.ts +1 -1
  120. package/dist/types/components/organisms/DynamicComponents/molecules/ItemCounter/index.d.ts +1 -1
  121. package/dist/types/components/organisms/DynamicComponents/molecules/KeyCounter/index.d.ts +1 -1
  122. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/index.d.ts +1 -1
  123. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/EditModal/index.d.ts +1 -1
  124. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/molecules/index.d.ts +1 -1
  125. package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/index.d.ts +1 -1
  126. package/dist/types/components/organisms/DynamicComponents/molecules/MarketplaceCard/index.d.ts +1 -1
  127. package/dist/types/components/organisms/DynamicComponents/molecules/MultiQuery/index.d.ts +1 -1
  128. package/dist/types/components/organisms/DynamicComponents/molecules/NodeTerminal/index.d.ts +1 -1
  129. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/OwnerRefs.d.ts +6 -0
  130. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/guard.d.ts +2 -0
  131. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/index.d.ts +1 -0
  132. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/RefsList.d.ts +22 -0
  133. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/index.d.ts +1 -0
  134. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/RefElement.d.ts +21 -0
  135. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/index.d.ts +1 -0
  136. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/utils.d.ts +5 -0
  137. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/index.d.ts +1 -0
  138. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/types.d.ts +6 -0
  139. package/dist/types/components/organisms/DynamicComponents/molecules/ParsedText/index.d.ts +1 -1
  140. package/dist/types/components/organisms/DynamicComponents/molecules/PartsOfUrl/index.d.ts +1 -1
  141. package/dist/types/components/organisms/DynamicComponents/molecules/PodLogs/index.d.ts +1 -1
  142. package/dist/types/components/organisms/DynamicComponents/molecules/PodTerminal/index.d.ts +1 -1
  143. package/dist/types/components/organisms/DynamicComponents/molecules/ProjectInfoCard/index.d.ts +1 -1
  144. package/dist/types/components/organisms/DynamicComponents/molecules/ResourceBadge/index.d.ts +1 -1
  145. package/dist/types/components/organisms/DynamicComponents/molecules/SecretBase64Plain/index.d.ts +1 -1
  146. package/dist/types/components/organisms/DynamicComponents/molecules/SidebarProvider/index.d.ts +1 -1
  147. package/dist/types/components/organisms/DynamicComponents/molecules/Spacer/index.d.ts +1 -1
  148. package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/index.d.ts +1 -1
  149. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/index.d.ts +1 -1
  150. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/EditModal/index.d.ts +1 -1
  151. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/molecules/index.d.ts +1 -1
  152. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/index.d.ts +1 -1
  153. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/EditModal/index.d.ts +1 -1
  154. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/molecules/index.d.ts +1 -1
  155. package/dist/types/components/organisms/DynamicComponents/molecules/VisibilityContainer/index.d.ts +1 -1
  156. package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/index.d.ts +1 -1
  157. package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/utils.d.ts +10 -0
  158. package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +37 -36
  159. package/dist/types/components/organisms/DynamicComponents/types.d.ts +37 -5
  160. package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.d.ts +2 -1
  161. package/dist/types/components/organisms/DynamicRendererWithProviders/hybridDataProvider.d.ts +22 -0
  162. package/dist/types/components/organisms/DynamicRendererWithProviders/multiK8sProvider.d.ts +22 -0
  163. package/dist/types/components/organisms/index.d.ts +5 -3
  164. package/dist/types/hooks/useApiResource.d.ts +1 -0
  165. package/dist/types/hooks/useBuiltinResource.d.ts +1 -0
  166. package/dist/types/hooks/useCrdResource.d.ts +1 -0
  167. package/dist/types/hooks/useK8sSmartResource.d.ts +29 -0
  168. package/dist/types/hooks/useK8sVerbs.d.ts +13 -0
  169. package/dist/types/hooks/useListThenWatch/types.d.ts +10 -1
  170. package/dist/types/hooks/useListThenWatch/useListWatch.d.ts +1 -0
  171. package/dist/types/index.d.ts +3 -0
  172. package/dist/types/localTypes/bff/table.d.ts +1 -0
  173. package/dist/types/localTypes/dynamicRender.d.ts +2 -1
  174. package/dist/types/localTypes/k8s.d.ts +1 -0
  175. package/dist/types/localTypes/navigations.d.ts +24 -0
  176. package/dist/types/utils/createContextFactory/index.d.ts +1 -1
  177. package/dist/types/utils/deepMerge/index.d.ts +1 -1
  178. package/dist/types/utils/filterSelectOptions/index.d.ts +1 -1
  179. package/dist/types/utils/getAllPathsFromObj/index.d.ts +1 -1
  180. package/dist/types/utils/getGroupsByCategory/index.d.ts +1 -1
  181. package/dist/types/utils/getPrefixSubArrays/index.d.ts +1 -1
  182. package/dist/types/utils/getResourceLink/getResourceLink.d.ts +27 -0
  183. package/dist/types/utils/getResourceLink/index.d.ts +1 -0
  184. package/dist/types/utils/getSortedKinds/index.d.ts +1 -1
  185. package/dist/types/utils/getSortedKindsAll/index.d.ts +1 -1
  186. package/dist/types/utils/getStringByName/index.d.ts +1 -1
  187. package/dist/types/utils/getUppercase/index.d.ts +1 -1
  188. package/dist/types/utils/groupsToTreeData/index.d.ts +2 -1
  189. package/dist/types/utils/hslFromString/index.d.ts +1 -1
  190. package/dist/types/utils/index.d.ts +25 -22
  191. package/dist/types/utils/isFlatObject/index.d.ts +1 -1
  192. package/dist/types/utils/kindByGvr/index.d.ts +1 -1
  193. package/dist/types/utils/namespacedByGvr/index.d.ts +1 -1
  194. package/dist/types/utils/nestedStringsArrayInclude/index.d.ts +1 -1
  195. package/dist/types/utils/normalizeValuesForQuotas/index.d.ts +1 -1
  196. package/dist/types/utils/parseForQuotaValues/index.d.ts +1 -1
  197. package/dist/types/utils/pluralByKind/index.d.ts +1 -1
  198. package/dist/types/utils/prepareTemplate/index.d.ts +1 -1
  199. package/dist/types/utils/prepareUrlsToFetchForDynamicRenderer/index.d.ts +1 -1
  200. package/dist/types/utils/tableLocations/index.d.ts +1 -1
  201. package/package.json +1 -1
  202. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormDataProvider/index.d.ts +0 -2
  203. package/dist/types/components/molecules/ManageableBreadcrumbs/ManageableBreadcrumbs.d.ts +0 -19
  204. package/dist/types/components/molecules/ManageableSidebar/ManageableSidebar.d.ts +0 -24
  205. /package/dist/types/components/molecules/ManageableBreadcrumbs/{styled.d.ts → organisms/ManageableBreadcrumbs/styled.d.ts} +0 -0
  206. /package/dist/types/components/molecules/ManageableBreadcrumbs/{types.d.ts → organisms/ManageableBreadcrumbsProvider/types.d.ts} +0 -0
  207. /package/dist/types/components/molecules/ManageableBreadcrumbs/{utils.d.ts → organisms/ManageableBreadcrumbsProvider/utils.d.ts} +0 -0
  208. /package/dist/types/components/molecules/ManageableSidebar/{styled.d.ts → organisms/ManageableSidebar/styled.d.ts} +0 -0
  209. /package/dist/types/components/molecules/ManageableSidebar/{types.d.ts → organisms/ManageableSidebarProvider/types.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,
@@ -9087,9 +9512,10 @@ const prepareDataForManageableSidebar = ({
9087
9512
  replaceValues,
9088
9513
  pathname,
9089
9514
  idToCompare,
9515
+ fallbackIdToCompare,
9090
9516
  currentTags
9091
9517
  }) => {
9092
- const foundData = data.find((el) => el.id === idToCompare);
9518
+ const foundData = data.find((el) => el.id === idToCompare) || (fallbackIdToCompare ? data.find((el) => el.id === fallbackIdToCompare) : void 0);
9093
9519
  if (!foundData) {
9094
9520
  return void 0;
9095
9521
  }
@@ -9110,74 +9536,8 @@ const prepareDataForManageableSidebar = ({
9110
9536
  return { ...result, selectedKeys: stringedOpenedKeys };
9111
9537
  };
9112
9538
 
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,
9539
+ const ManageableSidebarProvider = ({
9540
+ cluster,
9181
9541
  apiGroup,
9182
9542
  apiVersion,
9183
9543
  plural,
@@ -9185,32 +9545,22 @@ const ManageableSidebarWithDataProvider = ({
9185
9545
  replaceValues,
9186
9546
  pathname,
9187
9547
  idToCompare,
9548
+ fallbackIdToCompare,
9188
9549
  currentTags,
9189
9550
  hidden,
9190
9551
  noMarginTop
9191
9552
  }) => {
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
- },
9553
+ const {
9554
+ data: rawData,
9555
+ isError: rawDataError,
9556
+ isLoading: rawDataLoading
9557
+ } = useK8sSmartResource({
9558
+ cluster,
9559
+ group: apiGroup,
9560
+ version: apiVersion,
9561
+ plural,
9203
9562
  isEnabled
9204
9563
  });
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
9564
  if (rawDataError) {
9215
9565
  return null;
9216
9566
  }
@@ -9232,6 +9582,7 @@ const ManageableSidebarWithDataProvider = ({
9232
9582
  replaceValues,
9233
9583
  pathname,
9234
9584
  idToCompare,
9585
+ fallbackIdToCompare,
9235
9586
  currentTags
9236
9587
  });
9237
9588
  if (!result) {
@@ -33469,49 +33820,97 @@ const AntdText = ({
33469
33820
  };
33470
33821
 
33471
33822
  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;
33823
+ const makeEmptyEntry = () => ({
33824
+ data: void 0,
33825
+ isLoading: false,
33826
+ isError: false,
33827
+ error: null
33828
+ });
33829
+ const aggReducer = (state, action) => {
33830
+ switch (action.type) {
33831
+ case "RESET":
33832
+ return { entries: Array.from({ length: action.total }, makeEmptyEntry) };
33833
+ case "SET_ENTRY": {
33834
+ const entries = state.entries.slice();
33835
+ entries[action.index] = action.entry;
33836
+ return { entries };
33837
+ }
33838
+ default:
33839
+ return state;
33840
+ }
33841
+ };
33842
+ const K8sFetcher = ({ index, params, dispatch }) => {
33843
+ const res = useK8sSmartResource(params);
33844
+ useEffect(() => {
33845
+ dispatch({
33846
+ type: "SET_ENTRY",
33847
+ index,
33848
+ entry: {
33849
+ data: res.data,
33850
+ isLoading: res.isLoading,
33851
+ isError: res.isError,
33852
+ error: res.error ?? null
33479
33853
  }
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
33854
  });
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)]
33855
+ }, [index, res.data, res.isLoading, res.isError, res.error, dispatch]);
33856
+ return null;
33857
+ };
33858
+ const MultiQueryProvider = ({ items, dataToApplyToContext, children }) => {
33859
+ const k8sItems = useMemo(
33860
+ () => items.filter((x) => typeof x !== "string"),
33861
+ [items]
33506
33862
  );
33507
- return /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryContext.Provider, { value, children });
33863
+ const urlItems = useMemo(() => items.filter((x) => typeof x === "string"), [items]);
33864
+ const k8sCount = k8sItems.length;
33865
+ const urlCount = urlItems.length;
33866
+ const [state, dispatch] = useReducer(aggReducer, { entries: Array.from({ length: k8sCount }, makeEmptyEntry) });
33867
+ useEffect(() => {
33868
+ dispatch({ type: "RESET", total: k8sCount });
33869
+ }, [k8sCount]);
33870
+ const urlQueries = useQueries({
33871
+ queries: urlItems.map((url, i) => ({
33872
+ queryKey: ["multi-url", i, url],
33873
+ queryFn: async () => {
33874
+ const res = await axios.get(url);
33875
+ return structuredClone(res.data);
33876
+ },
33877
+ structuralSharing: false,
33878
+ refetchInterval: 5e3
33879
+ }))
33880
+ });
33881
+ const value = (() => {
33882
+ if (typeof dataToApplyToContext !== "undefined") {
33883
+ return { data: { req0: dataToApplyToContext }, isLoading: false, isError: false, errors: [] };
33884
+ }
33885
+ const data = {};
33886
+ const errors = [];
33887
+ for (let i = 0; i < k8sCount; i++) {
33888
+ const e = state.entries[i] ?? makeEmptyEntry();
33889
+ data[`req${i}`] = e.data;
33890
+ errors[i] = e.isError ? e.error : null;
33891
+ }
33892
+ for (let i = 0; i < urlCount; i++) {
33893
+ const q = urlQueries[i];
33894
+ const idx = k8sCount + i;
33895
+ data[`req${idx}`] = q?.data;
33896
+ errors[idx] = q?.isError ? q.error ?? null : null;
33897
+ }
33898
+ const isLoading = state.entries.some((e) => e.isLoading) || urlQueries.some((q) => q.isLoading);
33899
+ const isError = state.entries.some((e) => e.isError) || urlQueries.some((q) => q.isError);
33900
+ return { data, isLoading, isError, errors };
33901
+ })();
33902
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(MultiQueryContext.Provider, { value, children: [
33903
+ k8sItems.map((params, i) => (
33904
+ // eslint-disable-next-line react/no-array-index-key
33905
+ /* @__PURE__ */ jsxRuntimeExports.jsx(K8sFetcher, { index: i, params, dispatch }, i)
33906
+ )),
33907
+ children
33908
+ ] });
33508
33909
  };
33509
33910
  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;
33911
+ const ctx = useContext(MultiQueryContext);
33912
+ if (!ctx) throw new Error("useMultiQuery must be used within a MultiQueryProvider");
33913
+ return ctx;
33515
33914
  };
33516
33915
 
33517
33916
  const createContextFactory = () => {
@@ -33739,7 +34138,7 @@ const MultiQuery = ({ data }) => {
33739
34138
  if (isError) {
33740
34139
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33741
34140
  /* @__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)) })
34141
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33743
34142
  ] });
33744
34143
  }
33745
34144
  return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: preparedText });
@@ -33769,7 +34168,7 @@ const ParsedText = ({ data }) => {
33769
34168
  if (isError) {
33770
34169
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33771
34170
  /* @__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)) })
34171
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33773
34172
  ] });
33774
34173
  }
33775
34174
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -33806,7 +34205,7 @@ const ProjectInfoCard$1 = ({
33806
34205
  if (isError) {
33807
34206
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33808
34207
  /* @__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)) })
34208
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33810
34209
  ] });
33811
34210
  }
33812
34211
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ProjectInfoCard, { clusterName, namespace, accessGroups: parsedAccessGroups, ...props, children });
@@ -33923,7 +34322,7 @@ const StatusText$1 = ({
33923
34322
  if (isError) {
33924
34323
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
33925
34324
  /* @__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)) })
34325
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
33927
34326
  ] });
33928
34327
  }
33929
34328
  const { type, text } = getResult({
@@ -33955,7 +34354,7 @@ const SidebarProvider = ({
33955
34354
  acc[index.toString()] = value;
33956
34355
  return acc;
33957
34356
  }, {});
33958
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarWithDataProvider, { replaceValues, ...props });
34357
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableSidebarProvider, { replaceValues, ...props });
33959
34358
  };
33960
34359
 
33961
34360
  const checkPermission = async ({
@@ -34009,33 +34408,6 @@ const usePermissions = ({
34009
34408
  });
34010
34409
  };
34011
34410
 
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
34411
  const getBackLinkToTable = ({ fullPath }) => {
34040
34412
  return encodeURIComponent(fullPath);
34041
34413
  };
@@ -34116,6 +34488,7 @@ const EnrichedTable$1 = ({
34116
34488
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
34117
34489
  id,
34118
34490
  fetchUrl,
34491
+ k8sResourceToFetch,
34119
34492
  pathToItems,
34120
34493
  clusterNamePartOfUrl,
34121
34494
  labelSelector,
@@ -34159,7 +34532,13 @@ const EnrichedTable$1 = ({
34159
34532
  verb: "create",
34160
34533
  refetchInterval: false
34161
34534
  });
34162
- const fetchUrlPrepared = parseAll({ text: fetchUrl, replaceValues, multiQueryData });
34535
+ const fetchUrlPrepared = fetchUrl ? parseAll({ text: fetchUrl, replaceValues, multiQueryData }) : void 0;
34536
+ const k8sResourceToFetchPrepared = k8sResourceToFetch ? {
34537
+ group: k8sResourceToFetch.group ? parseAll({ text: k8sResourceToFetch.group, replaceValues, multiQueryData }) : void 0,
34538
+ version: parseAll({ text: k8sResourceToFetch.version, replaceValues, multiQueryData }),
34539
+ plural: parseAll({ text: k8sResourceToFetch.plural, replaceValues, multiQueryData }),
34540
+ namespace: k8sResourceToFetch.namespace ? parseAll({ text: k8sResourceToFetch.namespace, replaceValues, multiQueryData }) : void 0
34541
+ } : void 0;
34163
34542
  const sParams = new URLSearchParams();
34164
34543
  if (labelSelector && Object.keys(labelSelector).length > 0) {
34165
34544
  const parsedObject = Object.fromEntries(
@@ -34196,21 +34575,48 @@ const EnrichedTable$1 = ({
34196
34575
  } = useDirectUnknownResource({
34197
34576
  uri: `${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`,
34198
34577
  queryKey: [`${fetchUrlPrepared}${searchParams ? `?${searchParams}` : ""}`],
34199
- isEnabled: !isMultiqueryLoading
34578
+ isEnabled: Boolean(!isMultiqueryLoading && fetchUrlPrepared)
34200
34579
  });
34201
- if (isMultiqueryLoading) {
34580
+ const {
34581
+ data: fetchedDataSocket,
34582
+ isLoading: isFetchedDataSocketLoading,
34583
+ error: fetchedDataSocketError
34584
+ } = useK8sSmartResource({
34585
+ cluster: clusterName || "",
34586
+ namespace: k8sResourceToFetchPrepared?.namespace,
34587
+ group: k8sResourceToFetchPrepared?.group,
34588
+ version: k8sResourceToFetchPrepared?.version || "",
34589
+ plural: k8sResourceToFetchPrepared?.plural || "",
34590
+ fieldSelector: sParams.get("fieldSelector") || void 0,
34591
+ labelSelector: sParams.get("labelSelector") || void 0,
34592
+ isEnabled: Boolean(!isMultiqueryLoading && k8sResourceToFetchPrepared)
34593
+ });
34594
+ if (fetchUrlPrepared && isMultiqueryLoading) {
34202
34595
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34203
34596
  }
34204
- if (isFetchedDataLoading) {
34597
+ if (k8sResourceToFetchPrepared && isMultiqueryLoading) {
34598
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34599
+ }
34600
+ if (fetchUrlPrepared && isFetchedDataLoading) {
34205
34601
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) });
34206
34602
  }
34207
- if (fetchedDataError) {
34603
+ if (k8sResourceToFetchPrepared && isFetchedDataSocketLoading) {
34604
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { justify: "center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}) });
34605
+ }
34606
+ if (fetchUrlPrepared && fetchedDataError) {
34208
34607
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34209
34608
  "Error: ",
34210
34609
  JSON.stringify(fetchedDataError)
34211
34610
  ] });
34212
34611
  }
34213
- const items = Array.isArray(pathToItems) ? _$1.get(fetchedData, pathToItems) : jp.query(fetchedData, `$${pathToItems}`)[0];
34612
+ if (k8sResourceToFetchPrepared && fetchedDataSocketError) {
34613
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34614
+ "Error: ",
34615
+ JSON.stringify(fetchedDataError)
34616
+ ] });
34617
+ }
34618
+ const dataFromOneOfHooks = fetchedData || fetchedDataSocket;
34619
+ const items = Array.isArray(pathToItems) ? _$1.get(dataFromOneOfHooks, pathToItems) : jp.query(dataFromOneOfHooks, `$${pathToItems}`)[0];
34214
34620
  if (!items) {
34215
34621
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34216
34622
  "No data on this path ",
@@ -34345,15 +34751,18 @@ const PodTerminal$1 = ({
34345
34751
  const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
34346
34752
  const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
34347
34753
  const {
34348
- data: podInfo,
34754
+ data: podInfoList,
34349
34755
  isError: isPodInfoError,
34350
34756
  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],
34757
+ } = useK8sSmartResource({
34758
+ cluster: clusterPrepared,
34759
+ namespace: namespacePrepared,
34760
+ version: "v1",
34761
+ plural: "pods",
34762
+ fieldSelector: `metadata.name=${podNamePrepared}`,
34355
34763
  isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
34356
34764
  });
34765
+ const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
34357
34766
  if (isMultiqueryLoading) {
34358
34767
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34359
34768
  }
@@ -34461,15 +34870,18 @@ const PodLogs$1 = ({
34461
34870
  const namespacePrepared = parseAll({ text: namespace, replaceValues, multiQueryData });
34462
34871
  const podNamePrepared = parseAll({ text: podName, replaceValues, multiQueryData });
34463
34872
  const {
34464
- data: podInfo,
34873
+ data: podInfoList,
34465
34874
  isError: isPodInfoError,
34466
34875
  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],
34876
+ } = useK8sSmartResource({
34877
+ cluster: clusterPrepared,
34878
+ namespace: namespacePrepared,
34879
+ version: "v1",
34880
+ plural: "pods",
34881
+ fieldSelector: `metadata.name=${podNamePrepared}`,
34471
34882
  isEnabled: clusterPrepared !== void 0 && namespacePrepared !== void 0 && podNamePrepared !== void 0
34472
34883
  });
34884
+ const podInfo = podInfoList?.items && podInfoList.items.length > 0 ? podInfoList.items[0] : void 0;
34473
34885
  if (isMultiqueryLoading) {
34474
34886
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34475
34887
  }
@@ -34505,6 +34917,37 @@ const PodLogs$1 = ({
34505
34917
  ] });
34506
34918
  };
34507
34919
 
34920
+ const getDataByPath = ({
34921
+ prefillValuesRaw,
34922
+ pathToData
34923
+ }) => {
34924
+ return Array.isArray(pathToData) ? _$1.get(prefillValuesRaw, pathToData) : jp.query(prefillValuesRaw, `$${pathToData}`)[0];
34925
+ };
34926
+ const getPrefillValuesWithForces = ({
34927
+ prefillValues,
34928
+ forcedKind,
34929
+ apiGroup,
34930
+ apiVersion
34931
+ }) => {
34932
+ if (!forcedKind) {
34933
+ return prefillValues;
34934
+ }
34935
+ const newValues = { ...prefillValues };
34936
+ if (typeof newValues === "object" && newValues !== null) {
34937
+ if ("kind" in newValues) {
34938
+ delete newValues.kind;
34939
+ }
34940
+ if ("apiVersion" in newValues) {
34941
+ delete newValues.apiVersion;
34942
+ }
34943
+ }
34944
+ return {
34945
+ kind: forcedKind,
34946
+ apiVersion: `${apiGroup ? `${apiGroup}/` : ""}${apiVersion}`,
34947
+ ...newValues
34948
+ };
34949
+ };
34950
+
34508
34951
  const YamlEditorSingleton$1 = ({
34509
34952
  data,
34510
34953
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -34520,7 +34963,9 @@ const YamlEditorSingleton$1 = ({
34520
34963
  apiGroup,
34521
34964
  apiVersion,
34522
34965
  typeName,
34966
+ forcedKind,
34523
34967
  prefillValuesRequestIndex,
34968
+ pathToData,
34524
34969
  substractHeight,
34525
34970
  ...props
34526
34971
  } = data;
@@ -34546,7 +34991,9 @@ const YamlEditorSingleton$1 = ({
34546
34991
  const apiGroupPrepared = apiGroup ? parseAll({ text: apiGroup, replaceValues, multiQueryData }) : "no-api-group";
34547
34992
  const apiVersionPrepared = apiVersion ? parseAll({ text: apiVersion, replaceValues, multiQueryData }) : "no-api-version";
34548
34993
  const typeNamePrepared = parseAll({ text: typeName, replaceValues, multiQueryData });
34549
- const prefillValues = multiQueryData[`req${prefillValuesRequestIndex}`];
34994
+ const prefillValuesRaw = multiQueryData[`req${prefillValuesRequestIndex}`];
34995
+ const prefillValues = pathToData ? getDataByPath({ prefillValuesRaw, pathToData }) : prefillValuesRaw;
34996
+ const prefillValuesWithForces = getPrefillValuesWithForces({ prefillValues, forcedKind, apiGroup, apiVersion });
34550
34997
  if (isMultiqueryLoading) {
34551
34998
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
34552
34999
  }
@@ -34556,7 +35003,7 @@ const YamlEditorSingleton$1 = ({
34556
35003
  {
34557
35004
  cluster: clusterPrepared,
34558
35005
  theme,
34559
- prefillValuesSchema: prefillValues,
35006
+ prefillValuesSchema: prefillValuesWithForces,
34560
35007
  isNameSpaced,
34561
35008
  isCreate: false,
34562
35009
  type,
@@ -34655,7 +35102,7 @@ const ArrayOfObjectsToKeyValues = ({ data, children }) => {
34655
35102
  if (isMultiQueryErrors) {
34656
35103
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34657
35104
  /* @__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)) })
35105
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
34659
35106
  ] });
34660
35107
  }
34661
35108
  const jsonRoot = multiQueryData[`req${reqIndex}`];
@@ -34722,7 +35169,7 @@ const ItemCounter = ({
34722
35169
  if (isMultiQueryErrors) {
34723
35170
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34724
35171
  /* @__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)) })
35172
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
34726
35173
  ] });
34727
35174
  }
34728
35175
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -34779,7 +35226,7 @@ const KeyCounter = ({
34779
35226
  if (isMultiQueryErrors) {
34780
35227
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
34781
35228
  /* @__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)) })
35229
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
34783
35230
  ] });
34784
35231
  }
34785
35232
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -34957,11 +35404,7 @@ const toArray = (p) => (
34957
35404
  p === void 0 ? void 0 : Array.isArray(p) ? p : [p]
34958
35405
  );
34959
35406
 
34960
- const HiddenContainer = ({
34961
- name,
34962
- secondName,
34963
- children
34964
- }) => {
35407
+ const HiddenContainer = ({ name, secondName, children }) => {
34965
35408
  const hiddenPaths = useHiddenPathsLayout();
34966
35409
  const nameArr = toArray(name);
34967
35410
  const secondArr = toArray(secondName);
@@ -35164,7 +35607,7 @@ const Labels = ({ data, children }) => {
35164
35607
  if (isMultiQueryErrors) {
35165
35608
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35166
35609
  /* @__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)) })
35610
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35168
35611
  ] });
35169
35612
  }
35170
35613
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -35439,7 +35882,7 @@ const LabelsToSearchParams = ({ data, children }) => {
35439
35882
  if (isMultiQueryErrors) {
35440
35883
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35441
35884
  /* @__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)) })
35885
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35443
35886
  ] });
35444
35887
  }
35445
35888
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -35708,7 +36151,7 @@ const Taints = ({ data, children }) => {
35708
36151
  if (isMultiQueryErrors) {
35709
36152
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
35710
36153
  /* @__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)) })
36154
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
35712
36155
  ] });
35713
36156
  }
35714
36157
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -35952,10 +36395,15 @@ const EditModal$1 = ({
35952
36395
  ...restField,
35953
36396
  name: [name, "operator"],
35954
36397
  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
- }
36398
+ ({ getFieldValue }) => ({
36399
+ validator(_, v) {
36400
+ const nameV = getFieldValue(["tolerations", name, "key"]);
36401
+ if ((nameV === "nameV" || !nameV) && (!v || v !== "Exists")) {
36402
+ return Promise.reject(new Error("Operator must be Exists when `key` is empty"));
36403
+ }
36404
+ return Promise.resolve();
36405
+ }
36406
+ })
35959
36407
  ],
35960
36408
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(
35961
36409
  Select,
@@ -36081,7 +36529,7 @@ const Tolerations = ({
36081
36529
  if (isMultiQueryErrors) {
36082
36530
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36083
36531
  /* @__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)) })
36532
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
36085
36533
  ] });
36086
36534
  }
36087
36535
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -36362,7 +36810,7 @@ const Annotations = ({
36362
36810
  if (isMultiQueryErrors) {
36363
36811
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36364
36812
  /* @__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)) })
36813
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
36366
36814
  ] });
36367
36815
  }
36368
36816
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -36580,7 +37028,7 @@ const ConverterBytes = ({ data }) => {
36580
37028
  if (isError) {
36581
37029
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
36582
37030
  /* @__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)) })
37031
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
36584
37032
  ] });
36585
37033
  }
36586
37034
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -37397,7 +37845,7 @@ const SecretBase64Plain = ({ data }) => {
37397
37845
  if (isError) {
37398
37846
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
37399
37847
  /* @__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)) })
37848
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
37401
37849
  ] });
37402
37850
  }
37403
37851
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
@@ -37471,30 +37919,6 @@ const SecretBase64Plain = ({ data }) => {
37471
37919
  ] });
37472
37920
  };
37473
37921
 
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
37922
  const RoundSpan = styled.span`
37499
37923
  background-color: ${({ $bgColor }) => $bgColor || "none"};
37500
37924
  border-radius: 13px;
@@ -37529,7 +37953,7 @@ const ResourceBadge = ({ data }) => {
37529
37953
  if (isError) {
37530
37954
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
37531
37955
  /* @__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)) })
37956
+ /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e, i) => e && /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: typeof e === "string" ? e : e.message }, i)) })
37533
37957
  ] });
37534
37958
  }
37535
37959
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value2, index) => {
@@ -37584,6 +38008,8 @@ const Events$1 = ({
37584
38008
  baseFactoryNamespacedBuiltinKey,
37585
38009
  baseFactoryClusterSceopedBuiltinKey,
37586
38010
  baseNamespaceFactoryKey,
38011
+ baseNavigationPluralName,
38012
+ baseNavigationSpecificName,
37587
38013
  ...props
37588
38014
  } = data;
37589
38015
  const theme = useTheme();
@@ -37648,6 +38074,354 @@ const Events$1 = ({
37648
38074
  baseFactoryNamespacedBuiltinKey,
37649
38075
  baseFactoryClusterSceopedBuiltinKey,
37650
38076
  baseNamespaceFactoryKey,
38077
+ baseNavigationPluralName,
38078
+ baseNavigationSpecificName,
38079
+ ...props
38080
+ }
38081
+ ),
38082
+ children
38083
+ ] });
38084
+ };
38085
+
38086
+ const getKinds = async ({ clusterName }) => {
38087
+ const result = await axios.get(`/api/clusters/${clusterName}/openapi-bff/search/kinds/getKinds`);
38088
+ return result.data;
38089
+ };
38090
+
38091
+ const parseK8sVersion$1 = (raw) => {
38092
+ const m = /^v(?<major>\d+)(?:(?<stage>alpha|beta)(?<stageNum>\d+)?)?$/i.exec(raw ?? "");
38093
+ if (!m?.groups) return { rank: 0, major: -1, stageNum: -1 };
38094
+ const stage = (m.groups.stage ?? "").toLowerCase();
38095
+ const major = Number(m.groups.major);
38096
+ const stageNum = m.groups.stageNum ? Number(m.groups.stageNum) : 0;
38097
+ const rank = stage === "" ? 3 : stage === "beta" ? 2 : 1;
38098
+ return { rank, major, stageNum };
38099
+ };
38100
+ const versionToken$1 = (e) => e.version || (e.groupVersion?.split("/").pop() ?? "");
38101
+ const compareK8sVersionDesc$1 = (a, b) => {
38102
+ const pa = parseK8sVersion$1(versionToken$1(a));
38103
+ const pb = parseK8sVersion$1(versionToken$1(b));
38104
+ return pb.rank - pa.rank || pb.major - pa.major || pb.stageNum - pa.stageNum;
38105
+ };
38106
+ const orderVersions = (versions) => {
38107
+ const preferredIdx = versions.findIndex((v) => v.preferred === true);
38108
+ if (preferredIdx >= 0) {
38109
+ const preferred = versions[preferredIdx];
38110
+ const rest = versions.filter((_, i) => i !== preferredIdx).slice().sort(compareK8sVersionDesc$1);
38111
+ return [preferred, ...rest];
38112
+ }
38113
+ return versions.slice().sort(compareK8sVersionDesc$1);
38114
+ };
38115
+ const getSortedKindsAll = (index) => {
38116
+ const counts = index.items.reduce(
38117
+ (acc, item) => ({ ...acc, [item.kind]: (acc[item.kind] ?? 0) + 1 }),
38118
+ {}
38119
+ );
38120
+ const rows = index.items.flatMap((item) => {
38121
+ const ordered = orderVersions(item.versions);
38122
+ return ordered.map((v) => ({
38123
+ group: item.group,
38124
+ kind: item.kind,
38125
+ // clone to drop Readonly<> without changing fields (incl. preferred)
38126
+ version: { ...v },
38127
+ ...counts[item.kind] > 1 ? { notUnique: true } : {}
38128
+ }));
38129
+ });
38130
+ return rows.sort(
38131
+ (a, b) => a.kind.localeCompare(b.kind, void 0, { sensitivity: "base" }) || a.group.localeCompare(b.group, void 0, { sensitivity: "base" })
38132
+ );
38133
+ };
38134
+
38135
+ const parseApiVersion = (apiVersion) => {
38136
+ const parts = apiVersion.trim().split("/");
38137
+ return parts.length === 1 ? { group: "", version: parts[0] } : { group: parts[0], version: parts[1] };
38138
+ };
38139
+ const pluralByKind = (entries) => (kind, apiVersion) => {
38140
+ const norm = (s) => s.trim();
38141
+ const kindNorm = norm(kind);
38142
+ const gv = apiVersion ? parseApiVersion(apiVersion) : void 0;
38143
+ const candidates = entries.filter((e) => norm(e.kind) === kindNorm);
38144
+ if (candidates.length === 0) return void 0;
38145
+ const filtered = gv ? candidates.filter((e) => norm(e.group) === norm(gv.group) && e.version.version === gv.version) : candidates;
38146
+ if (filtered.length === 0) return void 0;
38147
+ const preferredFirst = gv ? filtered : [...filtered.filter((e) => e.version.preferred), ...filtered.filter((e) => !e.version.preferred)];
38148
+ const resources = preferredFirst.map((e) => e.version.resource).filter(Boolean);
38149
+ const uniq = Array.from(new Set(resources));
38150
+ if (!gv && uniq.length > 1) {
38151
+ const first = preferredFirst[0]?.version.resource;
38152
+ return first ?? void 0;
38153
+ }
38154
+ return uniq.length === 1 ? uniq[0] : void 0;
38155
+ };
38156
+
38157
+ const findOwnerReferencePath = (rawObject, jsonPathToArrayOfRefs, reference) => {
38158
+ if (!rawObject || !jsonPathToArrayOfRefs) return void 0;
38159
+ let arrayJsonPath = jsonPathToArrayOfRefs.trim();
38160
+ if (arrayJsonPath.startsWith(".")) {
38161
+ arrayJsonPath = `$${arrayJsonPath}`;
38162
+ }
38163
+ if (!arrayJsonPath.startsWith("$")) {
38164
+ arrayJsonPath = `$${arrayJsonPath}`;
38165
+ }
38166
+ arrayJsonPath = arrayJsonPath.replace(/\[\*\]$/, "");
38167
+ const nodes = jp.nodes(rawObject, arrayJsonPath);
38168
+ if (!nodes.length) return void 0;
38169
+ const arrayNode = nodes[0];
38170
+ const arr = arrayNode.value;
38171
+ if (!Array.isArray(arr)) return void 0;
38172
+ const index = arr.findIndex((item) => {
38173
+ if (!item) return false;
38174
+ return item.name === reference.name && item.kind === reference.kind && item.apiVersion === reference.apiVersion;
38175
+ });
38176
+ if (index === -1) return void 0;
38177
+ const basePathSegs = arrayNode.path.slice(1);
38178
+ return [...basePathSegs, index];
38179
+ };
38180
+ const parseDotPath$1 = (dotPath) => dotPath.split(".").filter(Boolean).map((seg) => seg.match(/^\d+$/) ? Number(seg) : seg);
38181
+ const resolveFormPath$1 = (pathInput, basePathForRelative) => {
38182
+ if (!pathInput) return [];
38183
+ if (Array.isArray(pathInput)) return pathInput;
38184
+ const pathStr = String(pathInput);
38185
+ const isRelative = pathStr.startsWith("./") || pathStr.startsWith("../");
38186
+ if (!isRelative) {
38187
+ return parseDotPath$1(pathStr);
38188
+ }
38189
+ let resolved = [...basePathForRelative];
38190
+ const parts = pathStr.split("/").filter(Boolean);
38191
+ for (const part of parts) {
38192
+ if (part === ".") {
38193
+ continue;
38194
+ }
38195
+ if (part === "..") {
38196
+ resolved = resolved.slice(0, -1);
38197
+ continue;
38198
+ }
38199
+ resolved.push(...parseDotPath$1(part));
38200
+ }
38201
+ return resolved;
38202
+ };
38203
+
38204
+ const RefElement = ({
38205
+ reference,
38206
+ keysToForcedLabel,
38207
+ forcedRelatedValuePath,
38208
+ rawObjectToFindLabel,
38209
+ jsonPathToArrayOfRefs,
38210
+ forcedNamespace,
38211
+ theme,
38212
+ baseprefix,
38213
+ cluster,
38214
+ getPlural,
38215
+ baseFactoryNamespacedAPIKey,
38216
+ baseFactoryClusterSceopedAPIKey,
38217
+ baseFactoryNamespacedBuiltinKey,
38218
+ baseFactoryClusterSceopedBuiltinKey,
38219
+ baseFactoriesMapping
38220
+ }) => {
38221
+ let forcedName;
38222
+ let objectNamespace;
38223
+ if (keysToForcedLabel && rawObjectToFindLabel) {
38224
+ forcedName = Array.isArray(keysToForcedLabel) ? _$1.get(rawObjectToFindLabel, keysToForcedLabel) : jp.query(rawObjectToFindLabel, `$${keysToForcedLabel}`)[0];
38225
+ }
38226
+ if (forcedRelatedValuePath && rawObjectToFindLabel) {
38227
+ try {
38228
+ const ownerRefPathSegs = findOwnerReferencePath(
38229
+ rawObjectToFindLabel,
38230
+ jsonPathToArrayOfRefs,
38231
+ // ".spec.customRef"
38232
+ reference
38233
+ );
38234
+ const relatedPath = forcedRelatedValuePath && ownerRefPathSegs ? resolveFormPath$1(forcedRelatedValuePath, ownerRefPathSegs) : void 0;
38235
+ if (relatedPath) {
38236
+ forcedName = _$1.get(rawObjectToFindLabel, relatedPath);
38237
+ }
38238
+ } catch {
38239
+ }
38240
+ }
38241
+ if (rawObjectToFindLabel) {
38242
+ try {
38243
+ const defaultFetched = _$1.get(rawObjectToFindLabel, ["metadata", "namespace"]);
38244
+ const socketFetched = _$1.get(rawObjectToFindLabel, ["items", 0, "metadata", "namespace"]);
38245
+ objectNamespace = socketFetched || defaultFetched;
38246
+ } catch {
38247
+ }
38248
+ }
38249
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
38250
+ ResourceLink,
38251
+ {
38252
+ kind: reference.kind,
38253
+ apiVersion: reference.apiVersion,
38254
+ namespace: forcedNamespace || reference.namespace || objectNamespace,
38255
+ forcedName,
38256
+ name: reference.name,
38257
+ theme,
38258
+ baseprefix,
38259
+ cluster,
38260
+ getPlural,
38261
+ baseFactoryNamespacedAPIKey,
38262
+ baseFactoryClusterSceopedAPIKey,
38263
+ baseFactoryNamespacedBuiltinKey,
38264
+ baseFactoryClusterSceopedBuiltinKey,
38265
+ baseFactoriesMapping
38266
+ }
38267
+ );
38268
+ };
38269
+
38270
+ const RefsList = ({
38271
+ theme,
38272
+ baseprefix,
38273
+ cluster,
38274
+ refsArr,
38275
+ keysToForcedLabel,
38276
+ forcedRelatedValuePath,
38277
+ rawObjectToFindLabel,
38278
+ jsonPathToArrayOfRefs,
38279
+ forcedNamespace,
38280
+ baseFactoryNamespacedAPIKey,
38281
+ baseFactoryClusterSceopedAPIKey,
38282
+ baseFactoryNamespacedBuiltinKey,
38283
+ baseFactoryClusterSceopedBuiltinKey,
38284
+ baseNavigationPluralName,
38285
+ baseNavigationSpecificName,
38286
+ listFlexProps
38287
+ }) => {
38288
+ const [kindIndex, setKindIndex] = useState();
38289
+ const [kindsWithVersion, setKindWithVersion] = useState();
38290
+ useEffect(() => {
38291
+ getKinds({ clusterName: cluster }).then((data) => {
38292
+ setKindIndex(data);
38293
+ setKindWithVersion(getSortedKindsAll(data));
38294
+ }).catch((error) => {
38295
+ console.error(error);
38296
+ });
38297
+ }, [cluster]);
38298
+ const { data: navigationDataArr } = useK8sSmartResource({
38299
+ cluster,
38300
+ group: "front.in-cloud.io",
38301
+ version: "v1alpha1",
38302
+ plural: baseNavigationPluralName,
38303
+ fieldSelector: `metadata.name=${baseNavigationSpecificName}`
38304
+ });
38305
+ const getPlural = kindsWithVersion ? pluralByKind(kindsWithVersion) : void 0;
38306
+ const baseFactoriesMapping = navigationDataArr && navigationDataArr.items && navigationDataArr.items.length > 0 ? navigationDataArr.items[0].spec?.baseFactoriesMapping : void 0;
38307
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Flex, { vertical: true, gap: 8, ...listFlexProps, children: refsArr.map((ref) => /* @__PURE__ */ jsxRuntimeExports.jsx(
38308
+ RefElement,
38309
+ {
38310
+ reference: ref,
38311
+ keysToForcedLabel,
38312
+ forcedRelatedValuePath,
38313
+ rawObjectToFindLabel,
38314
+ jsonPathToArrayOfRefs,
38315
+ forcedNamespace,
38316
+ theme,
38317
+ baseprefix,
38318
+ cluster,
38319
+ getPlural,
38320
+ baseFactoryNamespacedAPIKey,
38321
+ baseFactoryClusterSceopedAPIKey,
38322
+ baseFactoryNamespacedBuiltinKey,
38323
+ baseFactoryClusterSceopedBuiltinKey,
38324
+ baseFactoriesMapping
38325
+ },
38326
+ JSON.stringify(ref)
38327
+ )) });
38328
+ };
38329
+
38330
+ const isOwnerReference = (value) => {
38331
+ if (!value || typeof value !== "object") {
38332
+ return false;
38333
+ }
38334
+ if (value === null) {
38335
+ return false;
38336
+ }
38337
+ if (!("apiVersion" in value) || typeof value.apiVersion !== "string" || !("kind" in value) || typeof value.kind !== "string" || !("name" in value) || typeof value.name !== "string") {
38338
+ return false;
38339
+ }
38340
+ return true;
38341
+ };
38342
+
38343
+ const OwnerRefs = ({
38344
+ data,
38345
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
38346
+ children
38347
+ }) => {
38348
+ const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
38349
+ const {
38350
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
38351
+ id,
38352
+ baseprefix,
38353
+ clusterNamePartOfUrl,
38354
+ reqIndex,
38355
+ errorText,
38356
+ notArrayErrorText,
38357
+ emptyArrayErrorText,
38358
+ isNotRefsArrayErrorText,
38359
+ containerStyle,
38360
+ listFlexProps,
38361
+ keysToForcedLabel,
38362
+ forcedRelatedValuePath,
38363
+ jsonPathToArrayOfRefs,
38364
+ forcedNamespace,
38365
+ baseFactoryNamespacedAPIKey,
38366
+ baseFactoryClusterSceopedAPIKey,
38367
+ baseFactoryNamespacedBuiltinKey,
38368
+ baseFactoryClusterSceopedBuiltinKey,
38369
+ baseNavigationPluralName,
38370
+ baseNavigationSpecificName,
38371
+ ...props
38372
+ } = data;
38373
+ const theme = useTheme();
38374
+ const partsOfUrl = usePartsOfUrl();
38375
+ const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
38376
+ acc[index.toString()] = value;
38377
+ return acc;
38378
+ }, {});
38379
+ const clusterName = prepareTemplate({
38380
+ template: clusterNamePartOfUrl,
38381
+ replaceValues
38382
+ });
38383
+ const preparedForcedNamespace = forcedNamespace ? prepareTemplate({
38384
+ template: forcedNamespace,
38385
+ replaceValues
38386
+ }) : void 0;
38387
+ const jsonRoot = multiQueryData[`req${reqIndex}`];
38388
+ if (jsonRoot === void 0) {
38389
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: errorText });
38390
+ }
38391
+ const refsArr = jp.query(jsonRoot, `$${jsonPathToArrayOfRefs}`)[0];
38392
+ if (!Array.isArray(refsArr)) {
38393
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: notArrayErrorText });
38394
+ }
38395
+ if (refsArr.length === 0) {
38396
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: emptyArrayErrorText });
38397
+ }
38398
+ if (refsArr.some((el) => !isOwnerReference(el))) {
38399
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: containerStyle, children: isNotRefsArrayErrorText });
38400
+ }
38401
+ const guardedRefsArr = refsArr;
38402
+ if (isMultiqueryLoading) {
38403
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
38404
+ }
38405
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
38406
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
38407
+ RefsList,
38408
+ {
38409
+ theme,
38410
+ baseprefix,
38411
+ cluster: clusterName,
38412
+ refsArr: guardedRefsArr,
38413
+ keysToForcedLabel,
38414
+ forcedRelatedValuePath,
38415
+ jsonPathToArrayOfRefs,
38416
+ forcedNamespace: preparedForcedNamespace,
38417
+ rawObjectToFindLabel: jsonRoot,
38418
+ baseFactoryNamespacedAPIKey,
38419
+ baseFactoryClusterSceopedAPIKey,
38420
+ baseFactoryNamespacedBuiltinKey,
38421
+ baseFactoryClusterSceopedBuiltinKey,
38422
+ baseNavigationPluralName,
38423
+ baseNavigationSpecificName,
38424
+ listFlexProps,
37651
38425
  ...props
37652
38426
  }
37653
38427
  ),
@@ -37691,7 +38465,8 @@ const DynamicComponents = {
37691
38465
  ConverterBytes,
37692
38466
  SecretBase64Plain,
37693
38467
  ResourceBadge,
37694
- Events: Events$1
38468
+ Events: Events$1,
38469
+ OwnerRefs
37695
38470
  };
37696
38471
 
37697
38472
  const prepareUrlsToFetchForDynamicRenderer = ({
@@ -37710,13 +38485,30 @@ const prepareUrlsToFetchForDynamicRenderer = ({
37710
38485
  );
37711
38486
  };
37712
38487
 
38488
+ const STRING_KEYS = ["cluster", "group", "version", "plural", "namespace", "fieldSelector", "labelSelector"];
37713
38489
  const DynamicRendererWithProviders = (props) => {
37714
38490
  const location = useLocation();
37715
38491
  const { urlsToFetch, dataToApplyToContext, theme, nodeTerminalDefaultProfile, disableEventBubbling } = props;
38492
+ const directUrls = urlsToFetch.filter((el) => typeof el === "string");
38493
+ const k8sResourcesUrls = urlsToFetch.filter((el) => typeof el !== "string");
37716
38494
  const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
37717
- urls: urlsToFetch,
38495
+ urls: directUrls,
37718
38496
  locationPathname: location.pathname
37719
38497
  });
38498
+ const preparedK8sResoucesUrls = k8sResourcesUrls.map((res) => {
38499
+ let next = { ...res };
38500
+ for (const key of STRING_KEYS) {
38501
+ const val = next[key];
38502
+ if (typeof val === "string" && val.length > 0) {
38503
+ const prepared = prepareUrlsToFetchForDynamicRenderer({
38504
+ urls: [val],
38505
+ locationPathname: location.pathname
38506
+ });
38507
+ next = { ...next, [key]: prepared[0] ?? val };
38508
+ }
38509
+ }
38510
+ return next;
38511
+ });
37720
38512
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
37721
38513
  CursorDefaultDiv,
37722
38514
  {
@@ -37726,7 +38518,14 @@ const DynamicRendererWithProviders = (props) => {
37726
38518
  e.stopPropagation();
37727
38519
  }
37728
38520
  },
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 }) }) }) }) })
38521
+ 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(
38522
+ MultiQueryProvider,
38523
+ {
38524
+ items: [...preparedK8sResoucesUrls, ...preparedUrlsToFetch],
38525
+ dataToApplyToContext,
38526
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props })
38527
+ }
38528
+ ) }) }) })
37730
38529
  }
37731
38530
  );
37732
38531
  };
@@ -38335,6 +39134,7 @@ const EnrichedTableProvider = ({
38335
39134
  setIsError(void 0);
38336
39135
  setIsLoading(true);
38337
39136
  const payload = {
39137
+ clusterName: cluster,
38338
39138
  customizationId,
38339
39139
  tableMappingsReplaceValues,
38340
39140
  forceDefaultAdditionalPrinterColumns,
@@ -46631,6 +47431,7 @@ const Styled$j = {
46631
47431
  BigText: BigText$1
46632
47432
  };
46633
47433
 
47434
+ const NOTIFICATION_KEY = "yaml-data-changed";
46634
47435
  const YamlEditorSingleton = ({
46635
47436
  theme: theme$1,
46636
47437
  cluster,
@@ -46652,9 +47453,52 @@ const YamlEditorSingleton = ({
46652
47453
  const [yamlData, setYamlData] = useState("");
46653
47454
  const [isLoading, setIsLoading] = useState(false);
46654
47455
  const [error, setError] = useState();
47456
+ const initialPrefillYamlRef = useRef(null);
47457
+ const latestPrefillYamlRef = useRef(null);
47458
+ const firstLoadRef = useRef(true);
47459
+ const handleReload = useCallback(() => {
47460
+ api.destroy(NOTIFICATION_KEY);
47461
+ const nextYaml = latestPrefillYamlRef.current ?? initialPrefillYamlRef.current;
47462
+ if (nextYaml !== null) {
47463
+ setYamlData(nextYaml);
47464
+ }
47465
+ }, [api]);
47466
+ const openNotificationYamlChanged = useCallback(() => {
47467
+ const btn = /* @__PURE__ */ jsxRuntimeExports.jsx(
47468
+ Button,
47469
+ {
47470
+ type: "primary",
47471
+ size: "small",
47472
+ onClick: () => {
47473
+ handleReload();
47474
+ },
47475
+ children: "Reload"
47476
+ }
47477
+ );
47478
+ api.info({
47479
+ key: NOTIFICATION_KEY,
47480
+ message: "Data changed",
47481
+ description: "The source data has been updated. Reload to apply the latest changes (will discard your edits).",
47482
+ btn,
47483
+ placement: "bottomRight",
47484
+ duration: 30
47485
+ });
47486
+ }, [api, handleReload]);
46655
47487
  useEffect(() => {
46656
- setYamlData(stringify(prefillValuesSchema));
46657
- }, [prefillValuesSchema]);
47488
+ if (prefillValuesSchema === void 0) return;
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