@prorobotech/openapi-k8s-toolkit 1.2.0-alpha.11 → 1.2.0-alpha.13

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 (117) hide show
  1. package/dist/openapi-k8s-toolkit.es.js +794 -133
  2. package/dist/openapi-k8s-toolkit.es.js.map +1 -1
  3. package/dist/openapi-k8s-toolkit.umd.js +795 -134
  4. package/dist/openapi-k8s-toolkit.umd.js.map +1 -1
  5. package/dist/types/components/atoms/ContentCard/ContentCard.styled.d.ts +2 -0
  6. package/dist/types/components/molecules/BlackholeForm/atoms/HiddenContainer/utils.test.d.ts +1 -0
  7. package/dist/types/components/molecules/BlackholeForm/molecules/FormListInput/utils.test.d.ts +1 -0
  8. package/dist/types/components/molecules/BlackholeForm/molecules/FormRangeInput/utils.test.d.ts +1 -0
  9. package/dist/types/components/molecules/BlackholeForm/molecules/FormStringMultilineInput/helpers.test.d.ts +1 -0
  10. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/BlackholeForm.test.d.ts +1 -0
  11. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/context.test.d.ts +1 -0
  12. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/casts.test.d.ts +1 -0
  13. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/getSortedPropertyKeys.test.d.ts +1 -0
  14. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/hiddenExpanded.test.d.ts +1 -0
  15. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/helpers/prefills.test.d.ts +1 -0
  16. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/utils.test.d.ts +1 -0
  17. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeForm/utilsErrorHandler.test.d.ts +1 -0
  18. package/dist/types/components/molecules/BlackholeForm/organisms/BlackholeFormProvider/BlackholeFormProvider.test.d.ts +2 -0
  19. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTable/utils.test.d.ts +8 -0
  20. package/dist/types/components/molecules/EnrichedTable/organisms/EnrichedTableProvider/utils.test.d.ts +1 -0
  21. package/dist/types/components/molecules/Events/molecules/EventRow/utils.test.d.ts +1 -0
  22. package/dist/types/components/molecules/Events/reducer.test.d.ts +1 -0
  23. package/dist/types/components/molecules/Events/utils.test.d.ts +1 -0
  24. package/dist/types/components/molecules/ManageableBreadcrumbs/organisms/ManageableBreadcrumbsProvider/utils.test.d.ts +1 -0
  25. package/dist/types/components/molecules/ManageableSidebar/organisms/ManageableSidebarProvider/utils.test.d.ts +1 -0
  26. package/dist/types/components/molecules/MarketPlace/molecules/MarketplaceCard/utils.test.d.ts +1 -0
  27. package/dist/types/components/molecules/Terminals/VMVNC/VMVNC.d.ts +9 -0
  28. package/dist/types/components/molecules/Terminals/VMVNC/hooks/useVNCClient.d.ts +29 -0
  29. package/dist/types/components/molecules/Terminals/VMVNC/hooks/useVNCClient.test.d.ts +1 -0
  30. package/dist/types/components/molecules/Terminals/VMVNC/index.d.ts +2 -0
  31. package/dist/types/components/molecules/Terminals/VMVNC/molecules/VMVNCToolbar/VMVNCToolbar.d.ts +17 -0
  32. package/dist/types/components/molecules/Terminals/VMVNC/molecules/VMVNCToolbar/index.d.ts +1 -0
  33. package/dist/types/components/molecules/Terminals/VMVNC/molecules/VMVNCToolbar/styled.d.ts +1364 -0
  34. package/dist/types/components/molecules/Terminals/VMVNC/molecules/index.d.ts +1 -0
  35. package/dist/types/components/molecules/Terminals/VMVNC/styled.d.ts +834 -0
  36. package/dist/types/components/molecules/Terminals/index.d.ts +2 -0
  37. package/dist/types/components/molecules/index.d.ts +2 -2
  38. package/dist/types/components/organisms/DynamicComponents/molecules/Annotations/utils.test.d.ts +1 -0
  39. package/dist/types/components/organisms/DynamicComponents/molecules/ArrayOfObjectsToKeyValues/utils.test.d.ts +1 -0
  40. package/dist/types/components/organisms/DynamicComponents/molecules/EnrichedTable/utils.test.d.ts +1 -0
  41. package/dist/types/components/organisms/DynamicComponents/molecules/Events/utils.test.d.ts +1 -0
  42. package/dist/types/components/organisms/DynamicComponents/molecules/ItemCounter/utils.test.d.ts +1 -0
  43. package/dist/types/components/organisms/DynamicComponents/molecules/KeyCounter/utils.test.d.ts +1 -0
  44. package/dist/types/components/organisms/DynamicComponents/molecules/Labels/utils.test.d.ts +1 -0
  45. package/dist/types/components/organisms/DynamicComponents/molecules/LabelsToSearchParams/utils.test.d.ts +1 -0
  46. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/guard.test.d.ts +1 -0
  47. package/dist/types/components/organisms/DynamicComponents/molecules/OwnerRefs/organsisms/RefsList/molecules/RefElement/utils.test.d.ts +1 -0
  48. package/dist/types/components/organisms/DynamicComponents/molecules/ParsedText/utils.test.d.ts +1 -0
  49. package/dist/types/components/organisms/DynamicComponents/molecules/PodLogs/utils.test.d.ts +1 -0
  50. package/dist/types/components/organisms/DynamicComponents/molecules/PodTerminal/utils.test.d.ts +1 -0
  51. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRange.test.d.ts +1 -0
  52. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/hooks/usePrometheusQueryRangeMulti.test.d.ts +1 -0
  53. package/dist/types/components/organisms/DynamicComponents/molecules/PrometheusGraph/utils/prometheusAdapter.test.d.ts +1 -0
  54. package/dist/types/components/organisms/DynamicComponents/molecules/StatusText/utils.test.d.ts +1 -0
  55. package/dist/types/components/organisms/DynamicComponents/molecules/Taints/utils.test.d.ts +1 -0
  56. package/dist/types/components/organisms/DynamicComponents/molecules/Tolerations/utils.test.d.ts +1 -0
  57. package/dist/types/components/organisms/DynamicComponents/molecules/VMVNC/VMVNC.d.ts +6 -0
  58. package/dist/types/components/organisms/DynamicComponents/molecules/VMVNC/index.d.ts +1 -0
  59. package/dist/types/components/organisms/DynamicComponents/molecules/YamlEditorSingleton/utils.test.d.ts +1 -0
  60. package/dist/types/components/organisms/DynamicComponents/molecules/index.d.ts +1 -0
  61. package/dist/types/components/organisms/DynamicComponents/types.d.ts +8 -0
  62. package/dist/types/components/organisms/DynamicRenderer/DynamicRenderer.test.d.ts +1 -0
  63. package/dist/types/components/organisms/DynamicRendererWithProviders/DynamicRendererWithProviders.test.d.ts +1 -0
  64. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/factoryConfigProvider/factoryConfigProvider.test.d.ts +1 -0
  65. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/factoryConfigProvider/index.d.ts +1 -0
  66. package/dist/types/components/organisms/DynamicRendererWithProviders/{hybridDataProvider.d.ts → providers/hybridDataProvider/hybridDataProvider.d.ts} +1 -1
  67. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/hybridDataProvider/hybridDataProvider.test.d.ts +1 -0
  68. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/hybridDataProvider/index.d.ts +1 -0
  69. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/multiK8sProvider/index.d.ts +2 -0
  70. package/dist/types/components/organisms/DynamicRendererWithProviders/{multiK8sProvider.d.ts → providers/multiK8sProvider/multiK8sProvider.d.ts} +1 -1
  71. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/multiK8sProvider/multiK8sProvider.test.d.ts +1 -0
  72. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/multiQueryProvider/index.d.ts +1 -0
  73. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/multiQueryProvider/multiQueryProvider.test.d.ts +1 -0
  74. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/partsOfUrlContext/index.d.ts +1 -0
  75. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/partsOfUrlContext/partsOfUrlContext.test.d.ts +1 -0
  76. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/themeContext/index.d.ts +1 -0
  77. package/dist/types/components/organisms/DynamicRendererWithProviders/providers/themeContext/themeContext.test.d.ts +1 -0
  78. package/dist/types/hooks/useApiResource.d.ts +1 -0
  79. package/dist/types/hooks/useBuiltinResource.d.ts +1 -0
  80. package/dist/types/hooks/useCrdResource.d.ts +1 -0
  81. package/dist/types/hooks/useK8sSmartResource/useK8sSmartResource.test.d.ts +2 -0
  82. package/dist/types/hooks/useK8sSmartResource/useK8sSmartResourceWithoutKinds.test.d.ts +2 -0
  83. package/dist/types/hooks/useK8sSmartResource/useManyK8sSmartResource.test.d.ts +2 -0
  84. package/dist/types/hooks/useK8sSmartResource/useSmartResourceParams.test.d.ts +2 -0
  85. package/dist/types/hooks/useListThenWatch/reducer.test.d.ts +1 -0
  86. package/dist/types/hooks/useListThenWatch/useInfiniteSentinel.test.d.ts +2 -0
  87. package/dist/types/hooks/useListThenWatch/useListWatch.test.d.ts +2 -0
  88. package/dist/types/hooks/useListThenWatch/utils.test.d.ts +1 -0
  89. package/dist/types/hooks/useResourceScope/useResourceScope.test.d.ts +2 -0
  90. package/dist/types/localTypes/k8s.d.ts +1 -0
  91. package/dist/types/utils/createContextFactory/createContextFactory.test.d.ts +2 -0
  92. package/dist/types/utils/deepMerge/deepMerge.test.d.ts +1 -0
  93. package/dist/types/utils/filterSelectOptions/filterSelectOptions.test.d.ts +1 -0
  94. package/dist/types/utils/getAllPathsFromObj/getAllPathsFromObj.test.d.ts +1 -0
  95. package/dist/types/utils/getGroupsByCategory/getGroupsByCategory.test.d.ts +2 -0
  96. package/dist/types/utils/getPrefixSubArrays/getPrefixSubArrays.test.d.ts +1 -0
  97. package/dist/types/utils/getResourceLink/getResourceLink.test.d.ts +1 -0
  98. package/dist/types/utils/getSortedKinds/getSortedKinds.test.d.ts +1 -0
  99. package/dist/types/utils/getSortedKindsAll/getSortedKindsAll.test.d.ts +1 -0
  100. package/dist/types/utils/getStringByName/getStringByName.test.d.ts +1 -0
  101. package/dist/types/utils/getUppercase/getUppercase.test.d.ts +1 -0
  102. package/dist/types/utils/groupsToTreeData/groupsToTreeData.test.d.ts +1 -0
  103. package/dist/types/utils/hslFromString/hslFromString.test.d.ts +1 -0
  104. package/dist/types/utils/isFlatObject/isFlatObject.test.d.ts +1 -0
  105. package/dist/types/utils/kindByGvr/kindByGvr.test.d.ts +1 -0
  106. package/dist/types/utils/namespacedByGvr/namespacedByGvr.test.d.ts +1 -0
  107. package/dist/types/utils/nestedStringsArrayInclude/nestedStringsArrayInclude.test.d.ts +1 -0
  108. package/dist/types/utils/normalizeValuesForQuotas/normalizeValuesForQuotas.test.d.ts +1 -0
  109. package/dist/types/utils/parseForQuotaValues/parseForQuotaValues.test.d.ts +1 -0
  110. package/dist/types/utils/pluralByKind/pluralByKind.test.d.ts +1 -0
  111. package/dist/types/utils/prepareUrlsToFetchForDynamicRenderer/prepareUrlsToFetchForDynamicRenderer.test.d.ts +1 -0
  112. package/dist/types/utils/tableLocations/tableLocations.test.d.ts +1 -0
  113. package/package.json +3 -1
  114. /package/dist/types/components/organisms/DynamicRendererWithProviders/{factoryConfigProvider.d.ts → providers/factoryConfigProvider/factoryConfigProvider.d.ts} +0 -0
  115. /package/dist/types/components/organisms/DynamicRendererWithProviders/{multiQueryProvider.d.ts → providers/multiQueryProvider/multiQueryProvider.d.ts} +0 -0
  116. /package/dist/types/components/organisms/DynamicRendererWithProviders/{partsOfUrlContext.d.ts → providers/partsOfUrlContext/partsOfUrlContext.d.ts} +0 -0
  117. /package/dist/types/components/organisms/DynamicRendererWithProviders/{themeContext.d.ts → providers/themeContext/themeContext.d.ts} +0 -0
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('styled-components'), require('react'), require('antd'), require('@ant-design/icons'), require('react-router-dom'), require('@tanstack/react-query')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'styled-components', 'react', 'antd', '@ant-design/icons', 'react-router-dom', '@tanstack/react-query'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@prorobotech/openapi-k8s-toolkit"] = {}, global.styled, global.React, global.antd, global.antdIcons, global.ReactRouterDOM, global.reactQuery));
5
- })(this, (function (exports, styled, K, antd, icons, reactRouterDom, reactQuery) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('styled-components'), require('react'), require('antd'), require('@ant-design/icons'), require('react-router-dom'), require('@tanstack/react-query'), require('novnc-next')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'styled-components', 'react', 'antd', '@ant-design/icons', 'react-router-dom', '@tanstack/react-query', 'novnc-next'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@prorobotech/openapi-k8s-toolkit"] = {}, global.styled, global.React, global.antd, global.antdIcons, global.ReactRouterDOM, global.reactQuery, global.NoVNC));
5
+ })(this, (function (exports, styled, K, antd, icons, reactRouterDom, reactQuery, RFB) { 'use strict';
6
6
 
7
7
  const Spacer$1 = styled.div`
8
8
  height: ${({ $space, $spaceMob, $samespace }) => {
@@ -1573,7 +1573,7 @@
1573
1573
  justify-content: center;
1574
1574
  }
1575
1575
  `;
1576
- const Styled$C = {
1576
+ const Styled$E = {
1577
1577
  CustomTreeProvider
1578
1578
  };
1579
1579
 
@@ -1638,7 +1638,7 @@
1638
1638
  });
1639
1639
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1640
1640
  /* @__PURE__ */ jsxRuntimeExports.jsx(Search$1, { style: { marginBottom: 8 }, placeholder: "Search", onChange }),
1641
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1641
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$E.CustomTreeProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1642
1642
  antd.Tree,
1643
1643
  {
1644
1644
  treeData: loop(treeData),
@@ -8196,14 +8196,14 @@
8196
8196
  display: ${({ $displayFlex }) => $displayFlex ? "flex" : "block"};
8197
8197
  flex-flow: ${({ $flexFlow }) => $flexFlow};
8198
8198
  `;
8199
- const Styled$B = {
8199
+ const Styled$D = {
8200
8200
  ContentContainer
8201
8201
  };
8202
8202
 
8203
8203
  const ContentCard$1 = ({ children, flexGrow, displayFlex, flexFlow, maxHeight }) => {
8204
8204
  const { token } = antd.theme.useToken();
8205
8205
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8206
- Styled$B.ContentContainer,
8206
+ Styled$D.ContentContainer,
8207
8207
  {
8208
8208
  $flexGrow: flexGrow,
8209
8209
  $bgColor: token.colorBgContainer,
@@ -8264,13 +8264,13 @@
8264
8264
  padding-inline: 8px;
8265
8265
  }
8266
8266
  `;
8267
- const Styled$A = {
8267
+ const Styled$C = {
8268
8268
  UncontrolledSelect: UncontrolledSelect$1
8269
8269
  };
8270
8270
 
8271
8271
  const UncontrolledSelect = (props) => {
8272
8272
  const { isCursorPointer } = props;
8273
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8273
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$C.UncontrolledSelect, { ...props, $isCursorPointer: isCursorPointer });
8274
8274
  };
8275
8275
 
8276
8276
  const CustomSelect$5 = styled(antd.Select)`
@@ -8318,13 +8318,13 @@
8318
8318
  margin-block: 0 !important;
8319
8319
  }
8320
8320
  `;
8321
- const Styled$z = {
8321
+ const Styled$B = {
8322
8322
  CustomSelect: CustomSelect$5
8323
8323
  };
8324
8324
 
8325
8325
  const CustomSelect$4 = (props) => {
8326
8326
  const { paddingContainerEnd, ...rest } = props;
8327
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
8327
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$B.CustomSelect, { $paddingContainerEnd: paddingContainerEnd, ...rest });
8328
8328
  };
8329
8329
 
8330
8330
  const CursorPointerTag = styled(antd.Tag)`
@@ -8471,7 +8471,7 @@
8471
8471
  height: min-content;
8472
8472
  margin-right: 4px;
8473
8473
  `;
8474
- const Styled$y = {
8474
+ const Styled$A = {
8475
8475
  Abbr: Abbr$2
8476
8476
  };
8477
8477
 
@@ -8511,7 +8511,7 @@
8511
8511
  baseFactoriesMapping
8512
8512
  });
8513
8513
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { align: "center", gap: 8, children: [
8514
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.Abbr, { $bgColor: bgColor, children: abbr }),
8514
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$A.Abbr, { $bgColor: bgColor, children: abbr }),
8515
8515
  resourceLink ? /* @__PURE__ */ jsxRuntimeExports.jsx(
8516
8516
  antd.Typography.Link,
8517
8517
  {
@@ -8550,7 +8550,7 @@
8550
8550
  flex-wrap: nowrap !important;
8551
8551
  }
8552
8552
  `;
8553
- const Styled$x = {
8553
+ const Styled$z = {
8554
8554
  PositionRelativeContainer,
8555
8555
  FullWidthContainer,
8556
8556
  NoWrapContainer
@@ -8593,9 +8593,9 @@
8593
8593
  };
8594
8594
  return [firstItem, ellipsisItem, lastItem];
8595
8595
  };
8596
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$x.PositionRelativeContainer, { children: [
8597
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
8598
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8596
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$z.PositionRelativeContainer, { children: [
8597
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.FullWidthContainer, { ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items: renderItems() }) }),
8598
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$z.NoWrapContainer, { ref: breadcrumbRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Breadcrumb, { separator: ">", items, style: { display: "flex", flexWrap: "nowrap" } }) })
8599
8599
  ] });
8600
8600
  };
8601
8601
 
@@ -8603,12 +8603,12 @@
8603
8603
  min-height: 22px;
8604
8604
  width: 100%;
8605
8605
  `;
8606
- const Styled$w = {
8606
+ const Styled$y = {
8607
8607
  HeightDiv: HeightDiv$1
8608
8608
  };
8609
8609
 
8610
8610
  const ManageableBreadcrumbs = ({ data }) => {
8611
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$w.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8611
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$y.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(CollapsibleBreadcrumb, { items: data.breadcrumbItems }) });
8612
8612
  };
8613
8613
 
8614
8614
  const getKinds = async ({ cluster }) => {
@@ -9594,7 +9594,7 @@
9594
9594
  min-height: 22px;
9595
9595
  width: 100%;
9596
9596
  `;
9597
- const Styled$v = {
9597
+ const Styled$x = {
9598
9598
  HeightDiv
9599
9599
  };
9600
9600
 
@@ -9623,7 +9623,7 @@
9623
9623
  return null;
9624
9624
  }
9625
9625
  if (rawDataLoading) {
9626
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$v.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
9626
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.HeightDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}) });
9627
9627
  }
9628
9628
  if (!rawData) {
9629
9629
  return null;
@@ -9638,7 +9638,7 @@
9638
9638
  idToCompare
9639
9639
  });
9640
9640
  if (!result) {
9641
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$v.HeightDiv, {});
9641
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$x.HeightDiv, {});
9642
9642
  }
9643
9643
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ManageableBreadcrumbs, { data: result }, JSON.stringify(idToCompare));
9644
9644
  };
@@ -9666,7 +9666,7 @@
9666
9666
  margin: 0 !important;
9667
9667
  }
9668
9668
  `;
9669
- const Styled$u = {
9669
+ const Styled$w = {
9670
9670
  CustomMenu
9671
9671
  };
9672
9672
 
@@ -9693,7 +9693,7 @@
9693
9693
  setSelectedKeys(data.selectedKeys);
9694
9694
  }, [data.selectedKeys]);
9695
9695
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9696
- Styled$u.CustomMenu,
9696
+ Styled$w.CustomMenu,
9697
9697
  {
9698
9698
  selectedKeys,
9699
9699
  onSelect: () => {
@@ -33881,7 +33881,7 @@
33881
33881
  white-space: nowrap;
33882
33882
  text-overflow: ellipsis;
33883
33883
  `;
33884
- const Styled$t = {
33884
+ const Styled$v = {
33885
33885
  ShortenedText
33886
33886
  };
33887
33887
 
@@ -33890,7 +33890,7 @@
33890
33890
  const trimmedText = text.substring(0, trimLength);
33891
33891
  return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, placement: "top", children: trimmedText });
33892
33892
  }
33893
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$t.ShortenedText, { $maxWidth: maxWidth, children: text }) });
33893
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: text, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$v.ShortenedText, { $maxWidth: maxWidth, children: text }) });
33894
33894
  };
33895
33895
 
33896
33896
  const FilterDropdown = ({
@@ -43043,7 +43043,7 @@
43043
43043
  font-size: 16px;
43044
43044
  line-height: 24px;
43045
43045
  `;
43046
- const Styled$s = {
43046
+ const Styled$u = {
43047
43047
  BorderRadiusContainer: BorderRadiusContainer$1,
43048
43048
  ControlsRowContainer: ControlsRowContainer$1,
43049
43049
  BigText: BigText$1
@@ -43167,7 +43167,7 @@
43167
43167
  };
43168
43168
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
43169
43169
  contextHolder,
43170
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$s.BorderRadiusContainer, { $designNewLayoutHeight: designNewLayoutHeight, $colorBorder: token.colorBorder, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43170
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$u.BorderRadiusContainer, { $designNewLayoutHeight: designNewLayoutHeight, $colorBorder: token.colorBorder, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
43171
43171
  Ft$1,
43172
43172
  {
43173
43173
  defaultLanguage: "yaml",
@@ -43186,7 +43186,7 @@
43186
43186
  }
43187
43187
  }
43188
43188
  ) }),
43189
- !readOnly && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$s.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
43189
+ !readOnly && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$u.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
43190
43190
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
43191
43191
  backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => navigate(backlink), children: "Cancel" }),
43192
43192
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: handleReload, children: "Reload" })
@@ -43197,7 +43197,7 @@
43197
43197
  open: !!error,
43198
43198
  onOk: () => setError(void 0),
43199
43199
  onCancel: () => setError(void 0),
43200
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$s.BigText, { children: "Error!" }) }),
43200
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$u.BigText, { children: "Error!" }) }),
43201
43201
  cancelButtonProps: { style: { display: "none" } },
43202
43202
  children: [
43203
43203
  "An error has occurred: ",
@@ -43313,7 +43313,7 @@
43313
43313
  const VisibilityContainer$2 = styled.div`
43314
43314
  display: ${({ $hidden }) => $hidden ? "none" : "block"};
43315
43315
  `;
43316
- const Styled$r = {
43316
+ const Styled$t = {
43317
43317
  VisibilityContainer: VisibilityContainer$2
43318
43318
  };
43319
43319
 
@@ -43336,7 +43336,7 @@
43336
43336
  if (isMultiqueryLoading) {
43337
43337
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
43338
43338
  }
43339
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$r.VisibilityContainer, { $hidden: valuePrepared === "~undefined-value~", children });
43339
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$t.VisibilityContainer, { $hidden: valuePrepared === "~undefined-value~", children });
43340
43340
  };
43341
43341
 
43342
43342
  const unknownToString = (value) => {
@@ -43575,7 +43575,7 @@
43575
43575
  return dispatch;
43576
43576
  };
43577
43577
 
43578
- const Container$2 = styled.div`
43578
+ const Container$3 = styled.div`
43579
43579
  display: flex;
43580
43580
  flex-direction: column;
43581
43581
  gap: ${({ $designNewLayout }) => $designNewLayout ? "4px" : "8px"};
@@ -43601,8 +43601,8 @@
43601
43601
  display: ${({ $isOpen }) => $isOpen ? "block" : "none"};
43602
43602
  padding: ${({ $designNewLayout }) => $designNewLayout ? "0 0 0 6px" : "4px"};
43603
43603
  `;
43604
- const Styled$q = {
43605
- Container: Container$2,
43604
+ const Styled$s = {
43605
+ Container: Container$3,
43606
43606
  TitleBar,
43607
43607
  Content: Content$1
43608
43608
  };
@@ -43628,14 +43628,14 @@
43628
43628
  }
43629
43629
  };
43630
43630
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
43631
- Styled$q.Container,
43631
+ Styled$s.Container,
43632
43632
  {
43633
43633
  $designNewLayout: designNewLayout,
43634
43634
  $borderColor: token.colorBorder,
43635
43635
  $bgColor: token.colorBgContainer,
43636
43636
  children: [
43637
43637
  /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", children: [
43638
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$q.TitleBar, { onClick: () => toggleCollapse(), children: [
43638
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$s.TitleBar, { onClick: () => toggleCollapse(), children: [
43639
43639
  !designNewLayout && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CaretDownOutlined, { size: 14 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(icons.CaretRightOutlined, { size: 14 }) }),
43640
43640
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title }),
43641
43641
  designNewLayout && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isOpen ? /* @__PURE__ */ jsxRuntimeExports.jsx(DownIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(UpIcon, {}) })
@@ -43646,7 +43646,7 @@
43646
43646
  persistedCheckbox
43647
43647
  ] })
43648
43648
  ] }),
43649
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$q.Content, { $isOpen: isOpen, $designNewLayout: designNewLayout, children })
43649
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$s.Content, { $isOpen: isOpen, $designNewLayout: designNewLayout, children })
43650
43650
  ]
43651
43651
  }
43652
43652
  );
@@ -43680,13 +43680,13 @@
43680
43680
  const Content = styled.div`
43681
43681
  padding: ${({ $designNewLayout }) => $designNewLayout ? "0 0 0 6px" : "4px"};
43682
43682
  `;
43683
- const Styled$p = {
43683
+ const Styled$r = {
43684
43684
  Content
43685
43685
  };
43686
43686
 
43687
43687
  const ArrayInsideContainer = ({ children }) => {
43688
43688
  const designNewLayout = useDesignNewLayout();
43689
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$p.Content, { $designNewLayout: designNewLayout, children });
43689
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$r.Content, { $designNewLayout: designNewLayout, children });
43690
43690
  };
43691
43691
 
43692
43692
  const includesPath = (haystack, needle) => haystack.some((h) => h.length === needle.length && h.every((seg, i) => seg === String(needle[i])));
@@ -44239,7 +44239,7 @@
44239
44239
  const ResetedFormList$3 = styled(antd.Form.List)`
44240
44240
  margin-bottom: 8px;
44241
44241
  `;
44242
- const Styled$o = {
44242
+ const Styled$q = {
44243
44243
  ResetedFormList: ResetedFormList$3
44244
44244
  };
44245
44245
 
@@ -44324,7 +44324,7 @@
44324
44324
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[3], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
44325
44325
  ] }),
44326
44326
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
44327
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.ResetedFormList, { name: "taints", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44327
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$q.ResetedFormList, { name: "taints", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44328
44328
  fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
44329
44329
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44330
44330
  ResetedFormItem$1,
@@ -44564,7 +44564,7 @@
44564
44564
  const ResetedFormList$2 = styled(antd.Form.List)`
44565
44565
  margin-bottom: 8px;
44566
44566
  `;
44567
- const Styled$n = {
44567
+ const Styled$p = {
44568
44568
  ResetedFormList: ResetedFormList$2
44569
44569
  };
44570
44570
 
@@ -44659,7 +44659,7 @@
44659
44659
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[4], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
44660
44660
  ] }),
44661
44661
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
44662
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.ResetedFormList, { name: "tolerations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44662
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$p.ResetedFormList, { name: "tolerations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
44663
44663
  fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
44664
44664
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
44665
44665
  ResetedFormItem$1,
@@ -44941,7 +44941,7 @@
44941
44941
  const ResetedFormList$1 = styled(antd.Form.List)`
44942
44942
  margin-bottom: 8px;
44943
44943
  `;
44944
- const Styled$m = {
44944
+ const Styled$o = {
44945
44945
  ResetedFormList: ResetedFormList$1
44946
44946
  };
44947
44947
 
@@ -45031,7 +45031,7 @@
45031
45031
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[2], children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {}) })
45032
45032
  ] }),
45033
45033
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 10, $samespace: true }),
45034
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$m.ResetedFormList, { name: "annotations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45034
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$o.ResetedFormList, { name: "annotations", children: (fields, { add, remove }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45035
45035
  fields.map(({ key, name, ...restField }) => /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Row, { gutter: [16, 16], children: [
45036
45036
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Col, { span: cols[0], children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45037
45037
  ResetedFormItem$1,
@@ -46180,7 +46180,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
46180
46180
  margin-bottom: 0 !important;
46181
46181
  }
46182
46182
  `;
46183
- const Styled$l = {
46183
+ const Styled$n = {
46184
46184
  NoSelect,
46185
46185
  DisabledInput,
46186
46186
  NotificationOverrides
@@ -46246,10 +46246,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
46246
46246
  }
46247
46247
  };
46248
46248
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: containerStyle, children: [
46249
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$l.NotificationOverrides, {}),
46249
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.NotificationOverrides, {}),
46250
46250
  /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 8, ...flexProps, children: [
46251
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$l.NoSelect, { style: inputContainerStyle, children: niceLooking ? /* @__PURE__ */ jsxRuntimeExports.jsx(te, { theme, hidden, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
46252
- Styled$l.DisabledInput,
46251
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$n.NoSelect, { style: inputContainerStyle, children: niceLooking ? /* @__PURE__ */ jsxRuntimeExports.jsx(te, { theme, hidden, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
46252
+ Styled$n.DisabledInput,
46253
46253
  {
46254
46254
  $hidden: hidden,
46255
46255
  ref: inputRef,
@@ -46264,7 +46264,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
46264
46264
  value: decodedText
46265
46265
  }
46266
46266
  ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
46267
- Styled$l.DisabledInput,
46267
+ Styled$n.DisabledInput,
46268
46268
  {
46269
46269
  $hidden: hidden,
46270
46270
  ref: inputRef,
@@ -46298,7 +46298,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
46298
46298
  letter-spacing: 0.02em;
46299
46299
  box-sizing: content-box;
46300
46300
  `;
46301
- const Styled$k = {
46301
+ const Styled$m = {
46302
46302
  RoundSpan
46303
46303
  };
46304
46304
 
@@ -46337,7 +46337,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
46337
46337
  multiQueryData
46338
46338
  }) : getUppercase(parsedValue);
46339
46339
  const bgColor = hslFromString(parsedValue, theme);
46340
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$k.RoundSpan, { $bgColor: bgColor, style, children: parsedAbbreviation });
46340
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$m.RoundSpan, { $bgColor: bgColor, style, children: parsedAbbreviation });
46341
46341
  };
46342
46342
 
46343
46343
  const serializeLabelsWithNoEncoding = (input) => {
@@ -47015,6 +47015,50 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47015
47015
  ] });
47016
47016
  };
47017
47017
 
47018
+ const VMVNC$1 = ({
47019
+ data,
47020
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47021
+ children
47022
+ }) => {
47023
+ const { data: multiQueryData, isLoading: isMultiqueryLoading } = useMultiQuery();
47024
+ const {
47025
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47026
+ id,
47027
+ cluster,
47028
+ namespace,
47029
+ vmName,
47030
+ forcedFullWsPath,
47031
+ substractHeight,
47032
+ ...props
47033
+ } = data;
47034
+ const partsOfUrl = usePartsOfUrl();
47035
+ const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
47036
+ acc[index.toString()] = value;
47037
+ return acc;
47038
+ }, {});
47039
+ const clusterPrepared = cluster ? parseAll({ text: cluster, replaceValues, multiQueryData }) : void 0;
47040
+ const namespacePrepared = namespace ? parseAll({ text: namespace, replaceValues, multiQueryData }) : void 0;
47041
+ const vmNamePrepared = vmName ? parseAll({ text: vmName, replaceValues, multiQueryData }) : void 0;
47042
+ const forcedFullWsPathPrepared = forcedFullWsPath ? parseAll({ text: forcedFullWsPath, replaceValues, multiQueryData }) : void 0;
47043
+ if (isMultiqueryLoading) {
47044
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading multiquery" });
47045
+ }
47046
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
47047
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
47048
+ VMVNC,
47049
+ {
47050
+ cluster: clusterPrepared,
47051
+ namespace: namespacePrepared,
47052
+ vmName: vmNamePrepared,
47053
+ forcedFullWsPath: forcedFullWsPathPrepared,
47054
+ substractHeight: substractHeight || 400,
47055
+ ...props
47056
+ }
47057
+ ),
47058
+ children
47059
+ ] });
47060
+ };
47061
+
47018
47062
  const DynamicComponents = {
47019
47063
  DefaultDiv,
47020
47064
  antdText: AntdText,
@@ -47055,7 +47099,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
47055
47099
  Events: Events$1,
47056
47100
  OwnerRefs,
47057
47101
  Toggler,
47058
- TogglerSegmented
47102
+ TogglerSegmented,
47103
+ VMVNC: VMVNC$1
47059
47104
  };
47060
47105
 
47061
47106
  const prepareUrlsToFetchForDynamicRenderer = ({
@@ -48484,7 +48529,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
48484
48529
  border-radius: 8px;
48485
48530
  }
48486
48531
  `;
48487
- const Styled$j = {
48532
+ const Styled$l = {
48488
48533
  BorderRadiusContainer
48489
48534
  };
48490
48535
 
@@ -48531,7 +48576,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
48531
48576
  }
48532
48577
  }
48533
48578
  }, [yamlData, editorUri]);
48534
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$j.BorderRadiusContainer, { $colorBorder: token.colorBorder, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48579
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$l.BorderRadiusContainer, { $colorBorder: token.colorBorder, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
48535
48580
  Ft$1,
48536
48581
  {
48537
48582
  language: "yaml",
@@ -49288,7 +49333,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49288
49333
  const MarginBottom = styled.div`
49289
49334
  margin-bottom: 8px;
49290
49335
  `;
49291
- const Styled$i = {
49336
+ const Styled$k = {
49292
49337
  MarginBottom
49293
49338
  };
49294
49339
 
@@ -49354,7 +49399,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49354
49399
  },
49355
49400
  arrKey !== void 0 ? arrKey : Array.isArray(name) ? name.slice(-1)[0] : name
49356
49401
  ),
49357
- isBase64 && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$i.MarginBottom, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49402
+ isBase64 && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$k.MarginBottom, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49358
49403
  antd.Input.TextArea,
49359
49404
  {
49360
49405
  placeholder: getStringByName(name),
@@ -49381,7 +49426,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49381
49426
  cursor: pointer;
49382
49427
  padding-top: 11px;
49383
49428
  `;
49384
- const Styled$h = {
49429
+ const Styled$j = {
49385
49430
  SwitchAndCrossContainer,
49386
49431
  CrossContainer
49387
49432
  };
@@ -49406,7 +49451,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49406
49451
  onRemoveByMinus && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { size: "small", type: "text", onClick: onRemoveByMinus, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MinusIcon, {}) })
49407
49452
  ] })
49408
49453
  ] }),
49409
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$h.SwitchAndCrossContainer, { children: [
49454
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$j.SwitchAndCrossContainer, { children: [
49410
49455
  /* @__PURE__ */ jsxRuntimeExports.jsx(
49411
49456
  ResetedFormItem$1,
49412
49457
  {
@@ -49416,7 +49461,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49416
49461
  arrKey !== void 0 ? arrKey : Array.isArray(name) ? name.slice(-1)[0] : name
49417
49462
  ),
49418
49463
  /* @__PURE__ */ jsxRuntimeExports.jsx(
49419
- Styled$h.CrossContainer,
49464
+ Styled$j.CrossContainer,
49420
49465
  {
49421
49466
  onClick: () => {
49422
49467
  if (makeValueUndefined) {
@@ -49604,7 +49649,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49604
49649
  ] });
49605
49650
  };
49606
49651
 
49607
- const Container$1 = styled.div`
49652
+ const Container$2 = styled.div`
49608
49653
  height: 140px;
49609
49654
  border: 1px solid ${({ $colorBorder }) => $colorBorder};
49610
49655
  border-radius: 8px;
@@ -49615,8 +49660,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49615
49660
  border-radius: 8px;
49616
49661
  }
49617
49662
  `;
49618
- const Styled$g = {
49619
- Container: Container$1
49663
+ const Styled$i = {
49664
+ Container: Container$2
49620
49665
  };
49621
49666
 
49622
49667
  const FormInlineYamlEditor = ({ path, persistedControls, externalValue }) => {
@@ -49669,7 +49714,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49669
49714
  }
49670
49715
  }
49671
49716
  }, [yamlText, modelUri]);
49672
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.Container, { $colorBorder: token.colorBorder, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49717
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$i.Container, { $colorBorder: token.colorBorder, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
49673
49718
  Ft$1,
49674
49719
  {
49675
49720
  language: "yaml",
@@ -49808,7 +49853,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49808
49853
  });
49809
49854
  };
49810
49855
 
49811
- const Container = styled.div`
49856
+ const Container$1 = styled.div`
49812
49857
  display: grid;
49813
49858
  grid-template-columns: repeat(2, 1fr);
49814
49859
  gap: ${({ $designNewLayout }) => $designNewLayout ? "36px" : "8px"};
@@ -49836,9 +49881,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
49836
49881
  font-size: 16px;
49837
49882
  line-height: 24px;
49838
49883
  `;
49839
- const Styled$f = {
49884
+ const Styled$h = {
49840
49885
  ResetedFormList,
49841
- Container,
49886
+ Container: Container$1,
49842
49887
  OverflowContainer: OverflowContainer$1,
49843
49888
  ControlsRowContainer,
49844
49889
  DebugContainer,
@@ -50118,7 +50163,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
50118
50163
  }
50119
50164
  ),
50120
50165
  /* @__PURE__ */ jsxRuntimeExports.jsx(
50121
- Styled$f.ResetedFormList,
50166
+ Styled$h.ResetedFormList,
50122
50167
  {
50123
50168
  name: arrName || name,
50124
50169
  rules: !forceNonRequired && required?.includes(getStringByName(name)) ? [
@@ -51559,8 +51604,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51559
51604
  setPersistedKeys([...persistedKeys.filter((arr) => JSON.stringify(arr) !== JSON.stringify(value))]);
51560
51605
  };
51561
51606
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
51562
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$f.Container, { $designNewLayout: designNewLayout, $designNewLayoutHeight: designNewLayoutHeight, children: [
51563
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.OverflowContainer, { ref: overflowRef, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
51607
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$h.Container, { $designNewLayout: designNewLayout, $designNewLayoutHeight: designNewLayoutHeight, children: [
51608
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.OverflowContainer, { ref: overflowRef, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
51564
51609
  antd.Form,
51565
51610
  {
51566
51611
  form,
@@ -51614,7 +51659,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51614
51659
  ) })
51615
51660
  ] }),
51616
51661
  /* @__PURE__ */ jsxRuntimeExports.jsx(FlexGrow, {}),
51617
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
51662
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.ControlsRowContainer, { $bgColor: token.colorPrimaryBg, $designNewLayout: designNewLayout, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: designNewLayout ? 10 : 16, align: "center", children: [
51618
51663
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "primary", onClick: onSubmit, loading: isLoading, children: "Submit" }),
51619
51664
  backlink && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => navigate(backlink), children: "Cancel" }),
51620
51665
  /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: () => setIsDebugModalOpen(true), icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.BugOutlined, {}) }),
@@ -51626,7 +51671,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51626
51671
  open: !!error,
51627
51672
  onOk: () => setError(void 0),
51628
51673
  onCancel: () => setError(void 0),
51629
- title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.BigText, { children: "Error!" }) }),
51674
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "danger", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.BigText, { children: "Error!" }) }),
51630
51675
  cancelButtonProps: { style: { display: "none" } },
51631
51676
  children: [
51632
51677
  "An error has occurred: ",
@@ -51642,7 +51687,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51642
51687
  onCancel: () => setIsDebugModalOpen(false),
51643
51688
  title: "Debug for properties",
51644
51689
  width: "90vw",
51645
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.DebugContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(K.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
51690
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$h.DebugContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(K.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
51646
51691
  Editor,
51647
51692
  {
51648
51693
  defaultLanguage: "json",
@@ -51697,7 +51742,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51697
51742
  }
51698
51743
  if (data2.result === "error") {
51699
51744
  setIsError(data2.error);
51700
- console.log(data2.error);
51745
+ console.warn(data2.error);
51701
51746
  fallbackToManualMode();
51702
51747
  } else {
51703
51748
  setPreparedData({
@@ -51740,15 +51785,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51740
51785
  }
51741
51786
  );
51742
51787
  }
51788
+ if (isError) {
51789
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { message: isError, type: "error" });
51790
+ }
51743
51791
  if (!preparedData?.properties && !isError) {
51744
51792
  return null;
51745
51793
  }
51746
51794
  if (!preparedData?.properties) {
51747
51795
  return null;
51748
51796
  }
51749
- if (isError) {
51750
- return /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Alert, { message: isError, type: "error" });
51751
- }
51752
51797
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
51753
51798
  BlackholeForm,
51754
51799
  {
@@ -51779,7 +51824,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51779
51824
  );
51780
51825
  };
51781
51826
 
51782
- const CustomCard$5 = styled(antd.Card)`
51827
+ const CustomCard$6 = styled(antd.Card)`
51783
51828
  display: flex;
51784
51829
  justify-content: center;
51785
51830
  align-items: center;
@@ -51799,12 +51844,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
51799
51844
  padding: 8px;
51800
51845
  }
51801
51846
  `;
51802
- const Styled$e = {
51803
- CustomCard: CustomCard$5
51847
+ const Styled$g = {
51848
+ CustomCard: CustomCard$6
51804
51849
  };
51805
51850
 
51806
51851
  const AddCard = ({ onAddClick }) => {
51807
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.CustomCard, { onClick: onAddClick, children: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.PlusOutlined, {}) });
51852
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.CustomCard, { onClick: onAddClick, children: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.PlusOutlined, {}) });
51808
51853
  };
51809
51854
 
51810
51855
  const byteToHex = [];
@@ -52021,7 +52066,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52021
52066
  return `/${baseprefix}/${cluster}/${namespace}/forms/builtin/${apiVersion}/${plural}?backlink=${window.location.pathname}`;
52022
52067
  };
52023
52068
 
52024
- const CustomCard$4 = styled(antd.Card)`
52069
+ const CustomCard$5 = styled(antd.Card)`
52025
52070
  position: relative;
52026
52071
  width: 238px;
52027
52072
  overflow-x: auto;
@@ -52092,8 +52137,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52092
52137
  bottom: 6px;
52093
52138
  right: 6px;
52094
52139
  `;
52095
- const Styled$d = {
52096
- CustomCard: CustomCard$4,
52140
+ const Styled$f = {
52141
+ CustomCard: CustomCard$5,
52097
52142
  ImageContainer,
52098
52143
  OverflowContainer,
52099
52144
  TitleContainer,
@@ -52164,14 +52209,14 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52164
52209
  return null;
52165
52210
  }
52166
52211
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
52167
- Styled$d.CustomCard,
52212
+ Styled$f.CustomCard,
52168
52213
  {
52169
52214
  $isDisabled: disabled,
52170
52215
  $hoverColor: token.colorPrimary,
52171
52216
  onClick: () => disabled ? null : navigate(navigateUrl),
52172
52217
  children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { vertical: true, style: { width: "100%", height: "100%" }, justify: "spaceBetween", children: [
52173
52218
  /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", children: [
52174
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.ImageContainer, { dangerouslySetInnerHTML: { __html: decodedIcon } }),
52219
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.ImageContainer, { dangerouslySetInnerHTML: { __html: decodedIcon } }),
52175
52220
  isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
52176
52221
  "div",
52177
52222
  {
@@ -52192,8 +52237,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52192
52237
  }
52193
52238
  )
52194
52239
  ] }),
52195
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$d.OverflowContainer, { children: [
52196
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$d.TitleContainer, { children: [
52240
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$f.OverflowContainer, { children: [
52241
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$f.TitleContainer, { children: [
52197
52242
  name,
52198
52243
  " ",
52199
52244
  addedMode && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
@@ -52201,10 +52246,10 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52201
52246
  k8sList?.items?.length
52202
52247
  ] })
52203
52248
  ] }),
52204
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.TagsContainer, { children: tags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.CustomTag, { children: tag }, tag)) }),
52205
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.DescriptionContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: description }) })
52249
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.TagsContainer, { children: tags.map((tag) => /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.CustomTag, { children: tag }, tag)) }),
52250
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.DescriptionContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: description }) })
52206
52251
  ] }),
52207
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.EditButtonContainer, { children: isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
52252
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$f.EditButtonContainer, { children: isEditMode && /* @__PURE__ */ jsxRuntimeExports.jsx(
52208
52253
  "div",
52209
52254
  {
52210
52255
  onClick: (e) => {
@@ -52262,7 +52307,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52262
52307
  line-clamp: 1;
52263
52308
  word-break: break-all;
52264
52309
  `;
52265
- const Styled$c = {
52310
+ const Styled$e = {
52266
52311
  BigValue
52267
52312
  };
52268
52313
 
@@ -52372,7 +52417,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52372
52417
  /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "space-between", children: [
52373
52418
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 12, vertical: true, children: [
52374
52419
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Typography.Text, { type: "secondary", children: "Available Products" }) }),
52375
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$c.BigValue, { children: "Marketplace" }) })
52420
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$e.BigValue, { children: "Marketplace" }) })
52376
52421
  ] }) }),
52377
52422
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 12, vertical: true, children: [
52378
52423
  /* @__PURE__ */ jsxRuntimeExports.jsx(SearchTextInput, { uniqueTags, selectedTags, onSelectedTags: setSelectedTags }),
@@ -52578,7 +52623,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52578
52623
  line-clamp: 1;
52579
52624
  word-break: break-all;
52580
52625
  `;
52581
- const Styled$b = {
52626
+ const Styled$d = {
52582
52627
  ActionMenuPlaceholder};
52583
52628
 
52584
52629
  const ProjectInfoCard = ({
@@ -52657,7 +52702,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52657
52702
  } : void 0,
52658
52703
  onUpdate: updatePermission.data?.status.allowed ? openUpdate : void 0
52659
52704
  }
52660
- ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$b.ActionMenuPlaceholder, {}) }),
52705
+ ) : /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$d.ActionMenuPlaceholder, {}) }),
52661
52706
  /* @__PURE__ */ jsxRuntimeExports.jsx(DropdownAccessGroups, { accessGroups })
52662
52707
  ] }) })
52663
52708
  ] }),
@@ -52730,7 +52775,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52730
52775
 
52731
52776
  var addonFitExports = addonFit.exports;
52732
52777
 
52733
- const CustomCard$3 = styled.div`
52778
+ const CustomCard$4 = styled.div`
52734
52779
  visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
52735
52780
  height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
52736
52781
 
@@ -52738,15 +52783,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52738
52783
  scrollbar-width: thin;
52739
52784
  }
52740
52785
  `;
52741
- const FullWidthDiv$3 = styled.div`
52786
+ const FullWidthDiv$4 = styled.div`
52742
52787
  display: flex;
52743
52788
  justify-content: center;
52744
52789
  width: 100%;
52745
52790
  height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
52746
52791
  `;
52747
- const Styled$a = {
52748
- FullWidthDiv: FullWidthDiv$3,
52749
- CustomCard: CustomCard$3
52792
+ const Styled$c = {
52793
+ FullWidthDiv: FullWidthDiv$4,
52794
+ CustomCard: CustomCard$4
52750
52795
  };
52751
52796
 
52752
52797
  const XTerminal$2 = ({ endpoint, namespace, podName, container, substractHeight }) => {
@@ -52829,7 +52874,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52829
52874
  };
52830
52875
  }, [terminal, endpoint, namespace, podName, container]);
52831
52876
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
52832
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$a.CustomCard, { $isVisible: !isLoading && !error, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$a.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
52877
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$c.CustomCard, { $isVisible: !isLoading && !error, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$c.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
52833
52878
  isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
52834
52879
  error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
52835
52880
  ] });
@@ -52840,7 +52885,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52840
52885
  width: 200px;
52841
52886
  }
52842
52887
  `;
52843
- const Styled$9 = {
52888
+ const Styled$b = {
52844
52889
  CustomSelect: CustomSelect$3
52845
52890
  };
52846
52891
 
@@ -52851,7 +52896,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52851
52896
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
52852
52897
  }
52853
52898
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
52854
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$9.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
52899
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$b.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
52855
52900
  antd.Select,
52856
52901
  {
52857
52902
  placeholder: "Select container",
@@ -52880,7 +52925,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52880
52925
  ] });
52881
52926
  };
52882
52927
 
52883
- const CustomCard$2 = styled.div`
52928
+ const CustomCard$3 = styled.div`
52884
52929
  visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
52885
52930
  height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
52886
52931
 
@@ -52888,7 +52933,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52888
52933
  scrollbar-width: thin;
52889
52934
  }
52890
52935
  `;
52891
- const FullWidthDiv$2 = styled.div`
52936
+ const FullWidthDiv$3 = styled.div`
52892
52937
  display: flex;
52893
52938
  justify-content: center;
52894
52939
  width: 100%;
@@ -52903,9 +52948,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
52903
52948
  align-items: center;
52904
52949
  gap: 8px;
52905
52950
  `;
52906
- const Styled$8 = {
52907
- FullWidthDiv: FullWidthDiv$2,
52908
- CustomCard: CustomCard$2,
52951
+ const Styled$a = {
52952
+ FullWidthDiv: FullWidthDiv$3,
52953
+ CustomCard: CustomCard$3,
52909
52954
  ProgressContainer
52910
52955
  };
52911
52956
 
@@ -53035,8 +53080,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53035
53080
  };
53036
53081
  }, [terminal, endpoint, nodeName, profile]);
53037
53082
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53038
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$8.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$8.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
53039
- !isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$8.ProgressContainer, { $substractHeight: substractHeight, children: [
53083
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$a.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$a.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
53084
+ !isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$a.ProgressContainer, { $substractHeight: substractHeight, children: [
53040
53085
  isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
53041
53086
  !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Progress, { type: "circle", percent: progressPercent }),
53042
53087
  warmupMessage && /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Typography.Text, { children: [
@@ -53057,7 +53102,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53057
53102
  width: 200px;
53058
53103
  }
53059
53104
  `;
53060
- const Styled$7 = {
53105
+ const Styled$9 = {
53061
53106
  CustomSelect: CustomSelect$2
53062
53107
  };
53063
53108
 
@@ -53066,7 +53111,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53066
53111
  const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/terminalNode/terminalNode`;
53067
53112
  const profiles = ["legacy", "general", "baseline", "netadmin", "restricted", "sysadmin"];
53068
53113
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53069
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$7.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53114
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$9.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53070
53115
  antd.Select,
53071
53116
  {
53072
53117
  placeholder: "Select profile",
@@ -53091,7 +53136,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53091
53136
  ] });
53092
53137
  };
53093
53138
 
53094
- const CustomCard$1 = styled.div`
53139
+ const CustomCard$2 = styled.div`
53095
53140
  visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
53096
53141
  height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
53097
53142
 
@@ -53099,15 +53144,15 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53099
53144
  scrollbar-width: thin;
53100
53145
  }
53101
53146
  `;
53102
- const FullWidthDiv$1 = styled.div`
53147
+ const FullWidthDiv$2 = styled.div`
53103
53148
  display: flex;
53104
53149
  justify-content: center;
53105
53150
  width: 100%;
53106
53151
  height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
53107
53152
  `;
53108
- const Styled$6 = {
53109
- FullWidthDiv: FullWidthDiv$1,
53110
- CustomCard: CustomCard$1
53153
+ const Styled$8 = {
53154
+ FullWidthDiv: FullWidthDiv$2,
53155
+ CustomCard: CustomCard$2
53111
53156
  };
53112
53157
 
53113
53158
  const XTerminal = ({ endpoint, namespace, podName, container, substractHeight }) => {
@@ -53186,7 +53231,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53186
53231
  };
53187
53232
  }, [terminal, endpoint, namespace, podName, container]);
53188
53233
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53189
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
53234
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$8.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$8.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
53190
53235
  isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
53191
53236
  error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
53192
53237
  ] });
@@ -53197,7 +53242,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53197
53242
  width: 200px;
53198
53243
  }
53199
53244
  `;
53200
- const Styled$5 = {
53245
+ const Styled$7 = {
53201
53246
  CustomSelect: CustomSelect$1
53202
53247
  };
53203
53248
 
@@ -53208,7 +53253,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53208
53253
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
53209
53254
  }
53210
53255
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53211
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53256
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$7.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53212
53257
  antd.Select,
53213
53258
  {
53214
53259
  placeholder: "Select container",
@@ -53237,12 +53282,12 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53237
53282
  ] });
53238
53283
  };
53239
53284
 
53240
- const FullWidthDiv = styled.div`
53285
+ const FullWidthDiv$1 = styled.div`
53241
53286
  display: flex;
53242
53287
  justify-content: center;
53243
53288
  width: 100%;
53244
53289
  `;
53245
- const CustomCard = styled.div`
53290
+ const CustomCard$1 = styled.div`
53246
53291
  visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
53247
53292
  max-height: calc(100vh - 158px);
53248
53293
 
@@ -53258,9 +53303,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53258
53303
  cursor: pointer;
53259
53304
  user-select: none;
53260
53305
  `;
53261
- const Styled$4 = {
53262
- FullWidthDiv,
53263
- CustomCard,
53306
+ const Styled$6 = {
53307
+ FullWidthDiv: FullWidthDiv$1,
53308
+ CustomCard: CustomCard$1,
53264
53309
  VisibilityContainer,
53265
53310
  CursorPointerDiv: CursorPointerDiv$1
53266
53311
  };
@@ -53337,9 +53382,9 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53337
53382
  };
53338
53383
  }, [endpoint, namespace, podName, container, previous, editorReady]);
53339
53384
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53340
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.VisibilityContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "start", align: "center", gap: 16, children: [
53385
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.VisibilityContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { justify: "start", align: "center", gap: 16, children: [
53341
53386
  /* @__PURE__ */ jsxRuntimeExports.jsx(
53342
- Styled$4.CursorPointerDiv,
53387
+ Styled$6.CursorPointerDiv,
53343
53388
  {
53344
53389
  onClick: () => {
53345
53390
  if (isPaused) {
@@ -53364,7 +53409,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53364
53409
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isPaused ? "Not streaming events" : "Streaming events" })
53365
53410
  ] }) }),
53366
53411
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
53367
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53412
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53368
53413
  Ft$1,
53369
53414
  {
53370
53415
  defaultLanguage: "plaintext",
@@ -53395,7 +53440,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53395
53440
  width: 200px;
53396
53441
  }
53397
53442
  `;
53398
- const Styled$3 = {
53443
+ const Styled$5 = {
53399
53444
  TopRowContent,
53400
53445
  CustomSelect
53401
53446
  };
@@ -53441,8 +53486,8 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53441
53486
  }
53442
53487
  ];
53443
53488
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
53444
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.TopRowContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 16, children: [
53445
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53489
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.TopRowContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Flex, { gap: 16, children: [
53490
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53446
53491
  antd.Select,
53447
53492
  {
53448
53493
  placeholder: "Select container",
@@ -53457,7 +53502,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53457
53502
  }
53458
53503
  }
53459
53504
  ) }),
53460
- currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53505
+ currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53461
53506
  antd.Select,
53462
53507
  {
53463
53508
  placeholder: "Select current/previous",
@@ -53493,6 +53538,621 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
53493
53538
  ] });
53494
53539
  };
53495
53540
 
53541
+ const buildDefaultWsPath = (cluster, namespace, vmName) => {
53542
+ const base = cluster ? `/k8s/clusters/${encodeURIComponent(cluster)}` : `/k8s`;
53543
+ return `${base}/apis/subresources.kubevirt.io/v1/namespaces/${encodeURIComponent(
53544
+ namespace
53545
+ )}/virtualmachineinstances/${encodeURIComponent(vmName)}/vnc`;
53546
+ };
53547
+ const normalizePath = (p) => p.startsWith("/") ? p : `/${p}`;
53548
+ const useVNCClient = ({
53549
+ cluster,
53550
+ namespace,
53551
+ vmName,
53552
+ forcedFullWsPath
53553
+ }) => {
53554
+ const [isLoading, setIsLoading] = K.useState(true);
53555
+ const [error, setError] = K.useState(null);
53556
+ const [status, setStatus] = K.useState("Loading VNC client...");
53557
+ const [isConnected, setIsConnected] = K.useState(false);
53558
+ const [showDotCursor, setShowDotCursor] = K.useState(false);
53559
+ const [scalingMode, setScalingModeState] = K.useState("local");
53560
+ const [screenEl, setScreenEl] = K.useState(null);
53561
+ const screenRef = K.useCallback((node) => {
53562
+ setScreenEl(node);
53563
+ }, []);
53564
+ const rfbRef = K.useRef(null);
53565
+ const [isManuallyDisconnected, setIsManuallyDisconnected] = K.useState(false);
53566
+ const [, setReconnectAttempts] = K.useState(0);
53567
+ const [shouldReconnect, setShouldReconnect] = K.useState(true);
53568
+ const [connectionKey, setConnectionKey] = K.useState(0);
53569
+ const reconnectTimeoutRef = K.useRef(null);
53570
+ const isManuallyDisconnectedRef = K.useRef(false);
53571
+ const shouldReconnectRef = K.useRef(true);
53572
+ const showDotCursorRef = K.useRef(showDotCursor);
53573
+ const maxReconnectAttempts = 5;
53574
+ const reconnectDelay = 3e3;
53575
+ K.useEffect(() => {
53576
+ isManuallyDisconnectedRef.current = isManuallyDisconnected;
53577
+ }, [isManuallyDisconnected]);
53578
+ K.useEffect(() => {
53579
+ shouldReconnectRef.current = shouldReconnect;
53580
+ }, [shouldReconnect]);
53581
+ K.useEffect(() => {
53582
+ showDotCursorRef.current = showDotCursor;
53583
+ if (rfbRef.current && typeof rfbRef.current.showDotCursor !== "undefined") {
53584
+ try {
53585
+ rfbRef.current.showDotCursor = showDotCursor;
53586
+ } catch (err) {
53587
+ console.error("Error updating dot cursor:", err);
53588
+ }
53589
+ }
53590
+ }, [showDotCursor, isConnected]);
53591
+ const applyScalingMode = (rfb, mode) => {
53592
+ if (!rfb) return;
53593
+ if (mode === "none") {
53594
+ rfb.scaleViewport = false;
53595
+ rfb.resizeSession = false;
53596
+ } else if (mode === "local") {
53597
+ rfb.scaleViewport = true;
53598
+ rfb.resizeSession = false;
53599
+ } else {
53600
+ rfb.scaleViewport = false;
53601
+ rfb.resizeSession = true;
53602
+ }
53603
+ };
53604
+ const setScalingMode = K.useCallback((mode) => {
53605
+ setScalingModeState(mode);
53606
+ if (rfbRef.current) {
53607
+ applyScalingMode(rfbRef.current, mode);
53608
+ }
53609
+ }, []);
53610
+ K.useEffect(() => {
53611
+ console.log("[VMVNC hook] effect run", {
53612
+ cluster,
53613
+ namespace,
53614
+ vmName,
53615
+ connectionKey,
53616
+ hasScreenEl: !!screenEl,
53617
+ forcedFullWsPath
53618
+ });
53619
+ const hasForced = !!forcedFullWsPath;
53620
+ const hasNamespaceVm = !!namespace && !!vmName;
53621
+ if (!hasForced && !hasNamespaceVm) {
53622
+ setIsLoading(false);
53623
+ setIsConnected(false);
53624
+ setStatus("VNC not configured");
53625
+ setError("Provide forcedFullWsPath or both namespace and vmName for VNC connection");
53626
+ return;
53627
+ }
53628
+ if (!screenEl) {
53629
+ setIsLoading(true);
53630
+ setError(null);
53631
+ setStatus("Waiting for VNC container...");
53632
+ return;
53633
+ }
53634
+ if (reconnectTimeoutRef.current) {
53635
+ window.clearTimeout(reconnectTimeoutRef.current);
53636
+ reconnectTimeoutRef.current = null;
53637
+ }
53638
+ setIsLoading(true);
53639
+ setError(null);
53640
+ setStatus("Connecting...");
53641
+ const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
53642
+ const { host } = window.location;
53643
+ const defaultWsPath = namespace && vmName ? buildDefaultWsPath(cluster, namespace, vmName) : void 0;
53644
+ const wsPath = (() => {
53645
+ if (forcedFullWsPath && !forcedFullWsPath.startsWith("ws")) {
53646
+ return normalizePath(forcedFullWsPath);
53647
+ }
53648
+ return defaultWsPath;
53649
+ })();
53650
+ const wsUrl = forcedFullWsPath && forcedFullWsPath.startsWith("ws") ? forcedFullWsPath : `${protocol}//${host}${wsPath ?? ""}`;
53651
+ console.log(`[VMVNC ${namespace ?? "no-ns"}/${vmName ?? "no-vm"}]: WebSocket URL: ${wsUrl}`);
53652
+ console.log(`[VMVNC ${namespace ?? "no-ns"}/${vmName ?? "no-vm"}]: WebSocket path: ${wsPath}`);
53653
+ if (!forcedFullWsPath?.startsWith("ws") && !wsPath) {
53654
+ setIsLoading(false);
53655
+ setIsConnected(false);
53656
+ setStatus("VNC not configured");
53657
+ setError("Unable to build WebSocket path. Provide forcedFullWsPath or namespace+vmName.");
53658
+ return;
53659
+ }
53660
+ let cancelled = false;
53661
+ try {
53662
+ const rfb = new RFB(screenEl, wsUrl, {
53663
+ credentials: { password: "" },
53664
+ showDotCursor: showDotCursorRef.current
53665
+ });
53666
+ rfbRef.current = rfb;
53667
+ applyScalingMode(rfb, scalingMode);
53668
+ if (typeof rfb.showDotCursor !== "undefined") {
53669
+ try {
53670
+ rfb.showDotCursor = showDotCursorRef.current;
53671
+ } catch (err) {
53672
+ console.error("Error setting dot cursor on RFB instance:", err);
53673
+ }
53674
+ }
53675
+ const handleConnect = () => {
53676
+ if (cancelled) return;
53677
+ console.log(`[VMVNC ${namespace}/${vmName}]: Connected`);
53678
+ setStatus("Connected");
53679
+ setIsLoading(false);
53680
+ setError(null);
53681
+ setIsConnected(true);
53682
+ setReconnectAttempts(0);
53683
+ if (reconnectTimeoutRef.current) {
53684
+ window.clearTimeout(reconnectTimeoutRef.current);
53685
+ reconnectTimeoutRef.current = null;
53686
+ }
53687
+ };
53688
+ const handleDisconnect = (e) => {
53689
+ if (cancelled) return;
53690
+ const detail = e?.detail;
53691
+ const wasManuallyDisconnected = isManuallyDisconnectedRef.current;
53692
+ const autoReconnectEnabled = shouldReconnectRef.current;
53693
+ console.log(
53694
+ `[VMVNC ${namespace}/${vmName}]: Disconnected (clean=${detail?.clean}, manual=${wasManuallyDisconnected}, autoReconnect=${autoReconnectEnabled})`
53695
+ );
53696
+ setIsConnected(false);
53697
+ setIsLoading(false);
53698
+ if (wasManuallyDisconnected) {
53699
+ setStatus("Disconnected");
53700
+ setError(null);
53701
+ return;
53702
+ }
53703
+ if (!autoReconnectEnabled) {
53704
+ if (detail?.clean) {
53705
+ setStatus("Disconnected");
53706
+ } else {
53707
+ setStatus("Connection closed");
53708
+ setError("Connection closed unexpectedly");
53709
+ }
53710
+ return;
53711
+ }
53712
+ if (detail?.clean) {
53713
+ setStatus("Disconnected - Reconnecting...");
53714
+ setError(null);
53715
+ } else {
53716
+ setStatus("Connection closed - Reconnecting...");
53717
+ setError("Connection closed unexpectedly");
53718
+ }
53719
+ reconnectTimeoutRef.current = window.setTimeout(() => {
53720
+ if (isManuallyDisconnectedRef.current || !shouldReconnectRef.current) {
53721
+ console.log(`[VMVNC ${namespace}/${vmName}]: Reconnect cancelled before attempting`);
53722
+ return;
53723
+ }
53724
+ setReconnectAttempts((prev) => {
53725
+ const next = prev + 1;
53726
+ if (next > maxReconnectAttempts) {
53727
+ console.log(`[VMVNC ${namespace}/${vmName}]: Max reconnect attempts reached (${maxReconnectAttempts})`);
53728
+ setStatus("Connection failed - Max reconnect attempts reached");
53729
+ setError("Failed to reconnect after multiple attempts");
53730
+ setIsLoading(false);
53731
+ setShouldReconnect(false);
53732
+ return prev;
53733
+ }
53734
+ console.log(
53735
+ `[VMVNC ${namespace}/${vmName}]: Reconnect attempt ${next}/${maxReconnectAttempts} (bump connectionKey)`
53736
+ );
53737
+ setStatus(`Reconnecting... (Attempt ${next}/${maxReconnectAttempts})`);
53738
+ setIsLoading(true);
53739
+ setError(null);
53740
+ setConnectionKey((k) => k + 1);
53741
+ return next;
53742
+ });
53743
+ }, reconnectDelay);
53744
+ };
53745
+ const handleCredentialsRequired = () => {
53746
+ if (cancelled) return;
53747
+ console.log(`[VMVNC ${namespace}/${vmName}]: Credentials required`);
53748
+ setStatus("Credentials required");
53749
+ };
53750
+ const handleSecurityFailure = (e) => {
53751
+ if (cancelled) return;
53752
+ const detail = e?.detail;
53753
+ console.error(`[VMVNC ${namespace}/${vmName}]: Security failure`, detail);
53754
+ setError(`Security failure: ${detail?.reason || "Unknown error"}`);
53755
+ setIsLoading(false);
53756
+ setIsConnected(false);
53757
+ };
53758
+ const handleDesktopName = (e) => {
53759
+ if (cancelled) return;
53760
+ const detail = e?.detail;
53761
+ if (detail?.name) {
53762
+ console.log(`[VMVNC ${namespace}/${vmName}]: Desktop name: ${detail.name}`);
53763
+ setStatus(`Connected to ${detail.name}`);
53764
+ }
53765
+ };
53766
+ rfb.addEventListener("connect", handleConnect);
53767
+ rfb.addEventListener("disconnect", handleDisconnect);
53768
+ rfb.addEventListener("credentialsrequired", handleCredentialsRequired);
53769
+ rfb.addEventListener("securityfailure", handleSecurityFailure);
53770
+ rfb.addEventListener("desktopname", handleDesktopName);
53771
+ return () => {
53772
+ cancelled = true;
53773
+ console.log(`[VMVNC ${namespace}/${vmName}]: Cleaning up connection`);
53774
+ if (reconnectTimeoutRef.current) {
53775
+ window.clearTimeout(reconnectTimeoutRef.current);
53776
+ reconnectTimeoutRef.current = null;
53777
+ }
53778
+ if (rfbRef.current) {
53779
+ try {
53780
+ rfbRef.current.disconnect();
53781
+ } catch (err) {
53782
+ console.error("Error disconnecting RFB during cleanup:", err);
53783
+ }
53784
+ rfbRef.current = null;
53785
+ }
53786
+ if (screenEl) {
53787
+ while (screenEl.firstChild) {
53788
+ screenEl.removeChild(screenEl.firstChild);
53789
+ }
53790
+ }
53791
+ };
53792
+ } catch (err) {
53793
+ console.error(`[VMVNC ${namespace}/${vmName}]: Error creating RFB connection:`, err);
53794
+ setError(`Failed to create VNC connection: ${err instanceof Error ? err.message : "Unknown error"}`);
53795
+ setIsLoading(false);
53796
+ setIsConnected(false);
53797
+ setStatus("Failed to create VNC connection");
53798
+ }
53799
+ }, [cluster, namespace, vmName, forcedFullWsPath, scalingMode, connectionKey, screenEl]);
53800
+ const disconnect = K.useCallback(() => {
53801
+ isManuallyDisconnectedRef.current = true;
53802
+ shouldReconnectRef.current = false;
53803
+ setIsManuallyDisconnected(true);
53804
+ setShouldReconnect(false);
53805
+ if (reconnectTimeoutRef.current) {
53806
+ window.clearTimeout(reconnectTimeoutRef.current);
53807
+ reconnectTimeoutRef.current = null;
53808
+ }
53809
+ if (rfbRef.current) {
53810
+ try {
53811
+ rfbRef.current.disconnect();
53812
+ } catch (err) {
53813
+ console.error("Error disconnecting RFB:", err);
53814
+ }
53815
+ rfbRef.current = null;
53816
+ }
53817
+ setStatus("Disconnected");
53818
+ setIsLoading(false);
53819
+ setIsConnected(false);
53820
+ }, []);
53821
+ const reconnect = K.useCallback(() => {
53822
+ isManuallyDisconnectedRef.current = false;
53823
+ shouldReconnectRef.current = true;
53824
+ setIsManuallyDisconnected(false);
53825
+ setShouldReconnect(true);
53826
+ setReconnectAttempts(0);
53827
+ setError(null);
53828
+ setIsLoading(true);
53829
+ setStatus("Reconnecting...");
53830
+ if (reconnectTimeoutRef.current) {
53831
+ window.clearTimeout(reconnectTimeoutRef.current);
53832
+ reconnectTimeoutRef.current = null;
53833
+ }
53834
+ if (rfbRef.current) {
53835
+ try {
53836
+ rfbRef.current.disconnect();
53837
+ } catch (err) {
53838
+ console.error("Error disconnecting RFB before manual reconnect:", err);
53839
+ }
53840
+ rfbRef.current = null;
53841
+ }
53842
+ setConnectionKey((k) => k + 1);
53843
+ }, []);
53844
+ const sendCtrlAltDel = () => {
53845
+ if (!rfbRef.current) return;
53846
+ try {
53847
+ rfbRef.current.sendCtrlAltDel();
53848
+ } catch (err) {
53849
+ console.error("Error sending Ctrl+Alt+Del:", err);
53850
+ }
53851
+ };
53852
+ return {
53853
+ screenRef,
53854
+ isLoading,
53855
+ error,
53856
+ status,
53857
+ isConnected,
53858
+ showDotCursor,
53859
+ scalingMode,
53860
+ setShowDotCursor,
53861
+ setScalingMode,
53862
+ disconnect,
53863
+ reconnect,
53864
+ sendCtrlAltDel
53865
+ };
53866
+ };
53867
+
53868
+ const ShowCursorDiv = styled.div`
53869
+ display: flex;
53870
+ justify-content: space-between;
53871
+ align-items: center;
53872
+ min-width: 200px;
53873
+ `;
53874
+ const ScalingModeContainer = styled.div`
53875
+ min-width: 200px;
53876
+ `;
53877
+ const ScalingModeTitle = styled.div`
53878
+ margin-bottom: 8px;
53879
+ font-weight: 500;
53880
+ `;
53881
+ const StatusBar = styled.div`
53882
+ background-color: #2d2d2d;
53883
+ color: white;
53884
+ padding: 8px 16px;
53885
+ font-size: 12px;
53886
+ border-bottom: 1px solid #3d3d3d;
53887
+ display: flex;
53888
+ align-items: center;
53889
+ justify-content: flex-start;
53890
+ flex-shrink: 0;
53891
+ z-index: 10;
53892
+ flex-wrap: wrap;
53893
+ gap: 4px;
53894
+ `;
53895
+ const StatusDivider = styled.span`
53896
+ color: #666;
53897
+ margin: 0 8px;
53898
+ user-select: none;
53899
+ `;
53900
+ const Styled$4 = {
53901
+ ShowCursorDiv,
53902
+ ScalingModeContainer,
53903
+ ScalingModeTitle,
53904
+ StatusBar,
53905
+ StatusDivider
53906
+ };
53907
+
53908
+ const VMVNCToolbar = ({
53909
+ status,
53910
+ isConnected,
53911
+ isFullscreen,
53912
+ isLoading,
53913
+ showDotCursor,
53914
+ scalingMode,
53915
+ onSendCtrlAltDel,
53916
+ onToggleFullscreen,
53917
+ onReconnect,
53918
+ onShowDotCursorChange,
53919
+ onScalingModeChange
53920
+ }) => {
53921
+ const optionsMenuItems = K.useMemo(
53922
+ () => [
53923
+ {
53924
+ key: "show-cursor",
53925
+ label: /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$4.ShowCursorDiv, { children: [
53926
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Show Cursor" }),
53927
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Switch, { checked: showDotCursor, onChange: onShowDotCursorChange, disabled: !isConnected, size: "small" })
53928
+ ] })
53929
+ },
53930
+ {
53931
+ type: "divider"
53932
+ },
53933
+ {
53934
+ key: "scaling-mode",
53935
+ label: /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$4.ScalingModeContainer, { children: [
53936
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.ScalingModeTitle, { children: "Scaling Mode" }),
53937
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
53938
+ antd.Radio.Group,
53939
+ {
53940
+ value: scalingMode,
53941
+ onChange: (e) => onScalingModeChange(e.target.value),
53942
+ disabled: !isConnected,
53943
+ style: { display: "flex", flexDirection: "column", gap: 8 },
53944
+ children: [
53945
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Radio, { value: "none", children: "None" }),
53946
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Radio, { value: "local", children: "Local scaling" }),
53947
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Radio, { value: "remote", children: "Remote resizing" })
53948
+ ]
53949
+ }
53950
+ )
53951
+ ] })
53952
+ }
53953
+ ],
53954
+ [showDotCursor, scalingMode, isConnected, onShowDotCursorChange, onScalingModeChange]
53955
+ );
53956
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.StatusBar, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Space, { size: "small", children: [
53957
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: "Send Ctrl+Alt+Del", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53958
+ antd.Button,
53959
+ {
53960
+ type: "text",
53961
+ size: "small",
53962
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.PoweroffOutlined, {}),
53963
+ onClick: onSendCtrlAltDel,
53964
+ disabled: !isConnected,
53965
+ style: { color: "#ffffff" },
53966
+ children: "Send Ctrl+Alt+Del"
53967
+ }
53968
+ ) }),
53969
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: isFullscreen ? "Exit Fullscreen" : "Fullscreen", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53970
+ antd.Button,
53971
+ {
53972
+ type: "text",
53973
+ size: "small",
53974
+ icon: isFullscreen ? /* @__PURE__ */ jsxRuntimeExports.jsx(icons.FullscreenExitOutlined, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(icons.FullscreenOutlined, {}),
53975
+ onClick: onToggleFullscreen,
53976
+ disabled: !isConnected,
53977
+ style: { color: "#ffffff" },
53978
+ children: "Fullscreen"
53979
+ }
53980
+ ) }),
53981
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Dropdown, { menu: { items: optionsMenuItems }, trigger: ["click"], placement: "bottomRight", children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "text", size: "small", icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.SettingOutlined, {}), style: { color: "#ffffff" }, children: "Options" }) }),
53982
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Tooltip, { title: "Reconnect", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
53983
+ antd.Button,
53984
+ {
53985
+ type: "text",
53986
+ size: "small",
53987
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.ReloadOutlined, {}),
53988
+ onClick: onReconnect,
53989
+ loading: isLoading,
53990
+ style: { color: "#ffffff" },
53991
+ children: "Reconnect"
53992
+ }
53993
+ ) }),
53994
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.StatusDivider, { children: "|" }),
53995
+ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: status })
53996
+ ] }) });
53997
+ };
53998
+
53999
+ const Container = styled.div`
54000
+ height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
54001
+ display: flex;
54002
+ flex-direction: column;
54003
+ background-color: #1e1e1e;
54004
+ position: relative;
54005
+
54006
+ * {
54007
+ scrollbar-width: thin;
54008
+ }
54009
+ `;
54010
+ const CustomCard = styled.div`
54011
+ visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
54012
+ height: 100%;
54013
+ display: flex;
54014
+ flex-direction: column;
54015
+ background-color: #1e1e1e;
54016
+ position: relative;
54017
+
54018
+ * {
54019
+ scrollbar-width: thin;
54020
+ }
54021
+ `;
54022
+ const ContentWrapper = styled.div`
54023
+ display: flex;
54024
+ flex: 1;
54025
+ overflow: hidden;
54026
+ position: relative;
54027
+ min-width: 0; /* Allow flex item to shrink */
54028
+ `;
54029
+ const FullWidthDiv = styled.div`
54030
+ display: flex;
54031
+ justify-content: center;
54032
+ align-items: center;
54033
+ flex: 1;
54034
+ overflow: hidden;
54035
+ background-color: black;
54036
+ min-width: 0; /* Allow flex item to shrink */
54037
+ transition: margin-right 0.3s ease;
54038
+ `;
54039
+ const LoadingContainer = styled.div`
54040
+ display: flex;
54041
+ flex-direction: column;
54042
+ align-items: center;
54043
+ justify-content: center;
54044
+ padding: 40px;
54045
+ color: white;
54046
+ `;
54047
+ const ErrorContainer = styled.div`
54048
+ display: flex;
54049
+ flex-direction: column;
54050
+ align-items: center;
54051
+ justify-content: center;
54052
+ padding: 40px;
54053
+ color: white;
54054
+ `;
54055
+ const Styled$3 = {
54056
+ Container,
54057
+ CustomCard,
54058
+ ContentWrapper,
54059
+ FullWidthDiv,
54060
+ LoadingContainer,
54061
+ ErrorContainer
54062
+ };
54063
+
54064
+ const VMVNC = ({ cluster, namespace, vmName, forcedFullWsPath, substractHeight }) => {
54065
+ const containerRef = K.useRef(null);
54066
+ const [isFullscreen, setIsFullscreen] = K.useState(false);
54067
+ const {
54068
+ screenRef,
54069
+ isLoading,
54070
+ error,
54071
+ status,
54072
+ isConnected,
54073
+ showDotCursor,
54074
+ scalingMode,
54075
+ setShowDotCursor,
54076
+ setScalingMode,
54077
+ disconnect,
54078
+ reconnect,
54079
+ sendCtrlAltDel
54080
+ } = useVNCClient({ cluster, namespace, vmName, forcedFullWsPath });
54081
+ const handleToggleFullscreen = () => {
54082
+ const element = containerRef.current;
54083
+ if (!element) return;
54084
+ if (!isFullscreen) {
54085
+ if (element.requestFullscreen) {
54086
+ element.requestFullscreen();
54087
+ } else if (element.webkitRequestFullscreen) {
54088
+ element.webkitRequestFullscreen();
54089
+ } else if (element.msRequestFullscreen) {
54090
+ element.msRequestFullscreen();
54091
+ }
54092
+ return;
54093
+ }
54094
+ const fullscreenDoc = document;
54095
+ if (fullscreenDoc.exitFullscreen) {
54096
+ fullscreenDoc.exitFullscreen();
54097
+ } else if (fullscreenDoc.webkitExitFullscreen) {
54098
+ fullscreenDoc.webkitExitFullscreen();
54099
+ } else if (fullscreenDoc.msExitFullscreen) {
54100
+ fullscreenDoc.msExitFullscreen();
54101
+ }
54102
+ };
54103
+ K.useEffect(() => {
54104
+ const handleFullscreenChange = () => {
54105
+ setIsFullscreen(!!document.fullscreenElement);
54106
+ };
54107
+ document.addEventListener("fullscreenchange", handleFullscreenChange);
54108
+ document.addEventListener("webkitfullscreenchange", handleFullscreenChange);
54109
+ document.addEventListener("msfullscreenchange", handleFullscreenChange);
54110
+ return () => {
54111
+ document.removeEventListener("fullscreenchange", handleFullscreenChange);
54112
+ document.removeEventListener("webkitfullscreenchange", handleFullscreenChange);
54113
+ document.removeEventListener("msfullscreenchange", handleFullscreenChange);
54114
+ };
54115
+ }, []);
54116
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$3.Container, { ref: containerRef, $substractHeight: substractHeight, children: [
54117
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$3.CustomCard, { $isVisible: !isLoading && !error, $substractHeight: substractHeight, children: [
54118
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
54119
+ VMVNCToolbar,
54120
+ {
54121
+ status,
54122
+ isConnected,
54123
+ isFullscreen,
54124
+ isLoading,
54125
+ showDotCursor,
54126
+ scalingMode,
54127
+ onSendCtrlAltDel: sendCtrlAltDel,
54128
+ onToggleFullscreen: handleToggleFullscreen,
54129
+ onReconnect: reconnect,
54130
+ onShowDotCursorChange: setShowDotCursor,
54131
+ onScalingModeChange: setScalingMode
54132
+ }
54133
+ ),
54134
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.ContentWrapper, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { width: "100%", height: "100%" }, ref: screenRef }) }) })
54135
+ ] }),
54136
+ isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$3.LoadingContainer, { children: [
54137
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, { size: "large" }),
54138
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
54139
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: status })
54140
+ ] }),
54141
+ error && !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.ErrorContainer, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
54142
+ antd.Result,
54143
+ {
54144
+ status: "error",
54145
+ title: "VNC Connection Error",
54146
+ subTitle: error,
54147
+ extra: /* @__PURE__ */ jsxRuntimeExports.jsxs(antd.Space, { children: [
54148
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { onClick: disconnect, children: "Disconnect" }),
54149
+ /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Button, { type: "primary", onClick: reconnect, loading: isLoading, children: "Reconnect" })
54150
+ ] })
54151
+ }
54152
+ ) })
54153
+ ] });
54154
+ };
54155
+
53496
54156
  const SelectTag = styled(antd.Tag)`
53497
54157
  margin-inline-end: 4px;
53498
54158
  padding: 4px 6px;
@@ -55208,6 +55868,7 @@ if (_IS_WORKLET) registerPaint("spoiler", SpoilerPainterWorklet);
55208
55868
  exports.UncontrolledSelect = UncontrolledSelect;
55209
55869
  exports.UnlockedIcon = UnlockedIcon;
55210
55870
  exports.UpIcon = UpIcon;
55871
+ exports.VMVNC = VMVNC;
55211
55872
  exports.YamlEditorSingleton = YamlEditorSingleton$1;
55212
55873
  exports.checkIfApiInstanceNamespaceScoped = checkIfApiInstanceNamespaceScoped;
55213
55874
  exports.checkIfBuiltInInstanceNamespaceScoped = checkIfBuiltInInstanceNamespaceScoped;