@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.73 → 0.0.1-alpha.74

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.
@@ -8388,6 +8388,30 @@ const UnlockedIcon = () => {
8388
8388
  ) });
8389
8389
  };
8390
8390
 
8391
+ const PauseCircleIcon = () => {
8392
+ const { token } = theme.useToken();
8393
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "35", height: "35", viewBox: "0 0 35 35", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
8394
+ "path",
8395
+ {
8396
+ d: "M17.5 0C7.83594 0 0 7.83594 0 17.5C0 27.1641 7.83594 35 17.5 35C27.1641 35 35 27.1641 35 17.5C35 7.83594 27.1641 0 17.5 0ZM14.375 23.4375C14.375 23.6094 14.2344 23.75 14.0625 23.75H12.1875C12.0156 23.75 11.875 23.6094 11.875 23.4375V11.5625C11.875 11.3906 12.0156 11.25 12.1875 11.25H14.0625C14.2344 11.25 14.375 11.3906 14.375 11.5625V23.4375ZM23.125 23.4375C23.125 23.6094 22.9844 23.75 22.8125 23.75H20.9375C20.7656 23.75 20.625 23.6094 20.625 23.4375V11.5625C20.625 11.3906 20.7656 11.25 20.9375 11.25H22.8125C22.9844 11.25 23.125 11.3906 23.125 11.5625V23.4375Z",
8397
+ fill: token.colorText,
8398
+ fillOpacity: "0.88"
8399
+ }
8400
+ ) });
8401
+ };
8402
+
8403
+ const ResumeCircleIcon = () => {
8404
+ const { token } = theme.useToken();
8405
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { width: "35", height: "35", viewBox: "0 0 35 35", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
8406
+ "path",
8407
+ {
8408
+ d: "M18 0.5C8.33594 0.5 0.5 8.33594 0.5 18C0.5 27.6641 8.33594 35.5 18 35.5C27.6641 35.5 35.5 27.6641 35.5 18C35.5 8.33594 27.6641 0.5 18 0.5ZM23.6289 18.2695L15.0977 24.4766C15.0509 24.5102 14.9958 24.5302 14.9383 24.5346C14.8809 24.5389 14.8234 24.5273 14.7721 24.501C14.7208 24.4748 14.6778 24.4349 14.6477 24.3858C14.6176 24.3367 14.6017 24.2803 14.6016 24.2227V11.8164C14.6014 11.7587 14.6172 11.7021 14.6472 11.6528C14.6772 11.6035 14.7203 11.5635 14.7717 11.5372C14.8231 11.5109 14.8807 11.4994 14.9382 11.5038C14.9958 11.5083 15.051 11.5286 15.0977 11.5625L23.6289 17.7656C23.6692 17.7941 23.7021 17.8319 23.7248 17.8757C23.7475 17.9196 23.7593 17.9682 23.7593 18.0176C23.7593 18.0669 23.7475 18.1156 23.7248 18.1594C23.7021 18.2033 23.6692 18.241 23.6289 18.2695Z",
8409
+ fill: token.colorText,
8410
+ fillOpacity: "0.88"
8411
+ }
8412
+ ) });
8413
+ };
8414
+
8391
8415
  const ContentContainer = st.div`
8392
8416
  border: 1px solid ${({ $borderColor }) => $borderColor};
8393
8417
  border-radius: 6px;
@@ -45062,7 +45086,7 @@ const PodTerminal$1 = ({ cluster, namespace, podName, containers, substractHeigh
45062
45086
  }
45063
45087
  }
45064
45088
  ) }),
45065
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45089
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45066
45090
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45067
45091
  XTerminal$2,
45068
45092
  {
@@ -45258,8 +45282,8 @@ const Styled$4 = {
45258
45282
  CustomSelect: CustomSelect$2
45259
45283
  };
45260
45284
 
45261
- const NodeTerminal$1 = ({ cluster, nodeName, substractHeight }) => {
45262
- const [currentProfile, setCurrentProfile] = useState("general");
45285
+ const NodeTerminal$1 = ({ cluster, nodeName, substractHeight, defaultProfile }) => {
45286
+ const [currentProfile, setCurrentProfile] = useState(defaultProfile || "general");
45263
45287
  const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/terminalNode/terminalNode`;
45264
45288
  const profiles = ["legacy", "general", "baseline", "netadmin", "restricted", "sysadmin"];
45265
45289
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
@@ -45274,7 +45298,7 @@ const NodeTerminal$1 = ({ cluster, nodeName, substractHeight }) => {
45274
45298
  onChange: (value) => setCurrentProfile(value)
45275
45299
  }
45276
45300
  ) }),
45277
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45301
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45278
45302
  currentProfile && /* @__PURE__ */ jsxRuntimeExports.jsx(
45279
45303
  XTerminal$1,
45280
45304
  {
@@ -45419,7 +45443,7 @@ const PodLogs$1 = ({ cluster, namespace, podName, containers, substractHeight })
45419
45443
  }
45420
45444
  }
45421
45445
  ) }),
45422
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45446
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45423
45447
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45424
45448
  XTerminal,
45425
45449
  {
@@ -45447,15 +45471,17 @@ const CustomCard = st.div`
45447
45471
  scrollbar-width: thin;
45448
45472
  }
45449
45473
  `;
45450
- const RightAboveContainer = st.div`
45451
- margin-top: -40px;
45452
- display: flex;
45453
- justify-content: flex-end;
45474
+ const VisibilityContainer = st.div`
45475
+ visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
45476
+ `;
45477
+ const CursorPointerDiv = st.div`
45478
+ cursor: pointer;
45454
45479
  `;
45455
45480
  const Styled$1 = {
45456
45481
  FullWidthDiv,
45457
45482
  CustomCard,
45458
- RightAboveContainer
45483
+ VisibilityContainer,
45484
+ CursorPointerDiv
45459
45485
  };
45460
45486
 
45461
45487
  const MonacoEditor = ({
@@ -45525,29 +45551,32 @@ const MonacoEditor = ({
45525
45551
  };
45526
45552
  }, [endpoint, namespace, podName, container, previous]);
45527
45553
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45528
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.RightAboveContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45529
- Button,
45530
- {
45531
- onClick: () => {
45532
- if (isPaused) {
45533
- setIsPaused(false);
45534
- socketRef.current?.send(
45535
- JSON.stringify({
45536
- type: "continue"
45537
- })
45538
- );
45539
- } else {
45540
- setIsPaused(true);
45541
- socketRef.current?.send(
45542
- JSON.stringify({
45543
- type: "stop"
45544
- })
45545
- );
45546
- }
45547
- },
45548
- children: isPaused ? "Continue" : "Stop"
45549
- }
45550
- ) }),
45554
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.VisibilityContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { justify: "start", align: "center", gap: 16, children: [
45555
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
45556
+ Styled$1.CursorPointerDiv,
45557
+ {
45558
+ onClick: () => {
45559
+ if (isPaused) {
45560
+ setIsPaused(false);
45561
+ socketRef.current?.send(
45562
+ JSON.stringify({
45563
+ type: "continue"
45564
+ })
45565
+ );
45566
+ } else {
45567
+ setIsPaused(true);
45568
+ socketRef.current?.send(
45569
+ JSON.stringify({
45570
+ type: "stop"
45571
+ })
45572
+ );
45573
+ }
45574
+ },
45575
+ children: isPaused ? /* @__PURE__ */ jsxRuntimeExports.jsx(ResumeCircleIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(PauseCircleIcon, {})
45576
+ }
45577
+ ),
45578
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isPaused ? "Not streaming events" : "Streaming events" })
45579
+ ] }) }),
45551
45580
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45552
45581
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45553
45582
  Ft,
@@ -45635,7 +45664,7 @@ const PodLogsMonaco = ({
45635
45664
  }
45636
45665
  ) })
45637
45666
  ] }),
45638
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45667
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45639
45668
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45640
45669
  MonacoEditor,
45641
45670
  {
@@ -46246,7 +46275,7 @@ const PodTerminal = ({
46246
46275
  namespace: namespacePrepared,
46247
46276
  podName: podNamePrepared,
46248
46277
  containers,
46249
- substractHeight: substractHeight || 332,
46278
+ substractHeight: substractHeight || 340,
46250
46279
  ...props
46251
46280
  }
46252
46281
  ),
@@ -46254,6 +46283,10 @@ const PodTerminal = ({
46254
46283
  ] });
46255
46284
  };
46256
46285
 
46286
+ const factoryConfigContext = createContextFactory();
46287
+ const FactoryConfigContextProvider = factoryConfigContext.Provider;
46288
+ const useFactoryConfig = factoryConfigContext.useTypedContext;
46289
+
46257
46290
  const parseMutliqueryText$1 = ({ text, multiQueryData }) => {
46258
46291
  if (!text) return "";
46259
46292
  return text.replace(/\{reqs\[(\d+)\]\[((?:\s*['"][^'"]+['"]\s*,?)+)\]\}/g, (match, reqIndexStr, rawPath) => {
@@ -46284,6 +46317,7 @@ const NodeTerminal = ({
46284
46317
  substractHeight,
46285
46318
  ...props
46286
46319
  } = data;
46320
+ const { nodeTerminalDefaultProfile } = useFactoryConfig();
46287
46321
  const partsOfUrl = usePartsOfUrl();
46288
46322
  const replaceValues = partsOfUrl.partsOfUrl.reduce((acc, value, index) => {
46289
46323
  acc[index.toString()] = value;
@@ -46306,7 +46340,8 @@ const NodeTerminal = ({
46306
46340
  {
46307
46341
  cluster: clusterPrepared,
46308
46342
  nodeName: nodeNamePrepared,
46309
- substractHeight: substractHeight || 332,
46343
+ substractHeight: substractHeight || 340,
46344
+ defaultProfile: nodeTerminalDefaultProfile,
46310
46345
  ...props
46311
46346
  }
46312
46347
  ),
@@ -46399,7 +46434,7 @@ const PodLogs = ({
46399
46434
  podName: podNamePrepared,
46400
46435
  containers,
46401
46436
  theme,
46402
- substractHeight: substractHeight || 332,
46437
+ substractHeight: substractHeight || 340 + 35 + 8,
46403
46438
  rawPodInfo: podInfo,
46404
46439
  ...props
46405
46440
  }
@@ -46450,12 +46485,12 @@ const prepareUrlsToFetchForDynamicRenderer = ({
46450
46485
 
46451
46486
  const DynamicRendererWithProviders = (props) => {
46452
46487
  const location = useLocation();
46453
- const { urlsToFetch, theme } = props;
46488
+ const { urlsToFetch, theme, nodeTerminalDefaultProfile } = props;
46454
46489
  const preparedUrlsToFetch = prepareUrlsToFetchForDynamicRenderer({
46455
46490
  urls: urlsToFetch,
46456
46491
  locationPathname: location.pathname
46457
46492
  });
46458
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) }) });
46493
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsxRuntimeExports.jsx(FactoryConfigContextProvider, { value: { nodeTerminalDefaultProfile }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PartsOfUrlProvider, { value: { partsOfUrl: location.pathname.split("/") }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MultiQueryProvider, { urls: preparedUrlsToFetch, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DynamicRenderer, { ...props }) }) }) }) });
46459
46494
  };
46460
46495
 
46461
46496
  const isLeafNode = (value) => {
@@ -46931,5 +46966,5 @@ const useCrdData = ({
46931
46966
  });
46932
46967
  };
46933
46968
 
46934
- export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, NodeTerminal$1 as NodeTerminal, PlusIcon, PodLogs$1 as PodLogs, PodLogsMonaco, PodTerminal$1 as PodTerminal, ProjectInfoCard$1 as ProjectInfoCard, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UnlockedIcon, UpIcon, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getObjectFormItemsDraft, getPrefixSubarrays, getStringByName, getSwagger, groupsToTreeData, isFlatObject, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
46969
+ export { BackToDefaultIcon, BlackholeForm, BlackholeFormDataProvider, ContentCard$1 as ContentCard, DeleteIcon, DeleteModal, DeleteModalMany, DownIcon, DynamicComponents, DynamicRenderer, DynamicRendererWithProviders, EditIcon, EnrichedTable$1 as EnrichedTable, EnrichedTableProvider, LockedIcon, ManageableBreadcrumbs, ManageableBreadcrumbsWithDataProvider, ManageableSidebar, ManageableSidebarWithDataProvider, MarketPlace, MarketplaceCard$1 as MarketplaceCard, MinusIcon, NodeTerminal$1 as NodeTerminal, PauseCircleIcon, PlusIcon, PodLogs$1 as PodLogs, PodLogsMonaco, PodTerminal$1 as PodTerminal, ProjectInfoCard$1 as ProjectInfoCard, ResumeCircleIcon, Spacer$1 as Spacer, SuccessIcon, TreeWithSearch, UnlockedIcon, UpIcon, checkIfApiInstanceNamespaceScoped, checkIfBuiltInInstanceNamespaceScoped, checkPermission, createContextFactory, createNewEntry, deleteEntry, feedbackIcons, filterIfApiInstanceNamespaceScoped, filterIfBuiltInInstanceNamespaceScoped, filterSelectOptions, floorToDecimal, getAllPathsFromObj, getApiResourceSingle, getApiResourceTypes, getApiResourceTypesByApiGroup, getApiResources, getBuiltinResourceSingle, getBuiltinResourceTypes, getBuiltinResources, getBuiltinTreeData, getClusterList, getCrdData, getCrdResourceSingle, getCrdResources, getDirectUnknownResource, getEnrichedColumns, getEnrichedColumnsWithControls, getGroupsByCategory, getObjectFormItemsDraft, getPrefixSubarrays, getStringByName, getSwagger, groupsToTreeData, isFlatObject, normalizeValuesForQuotasToNumber, parseQuotaValue, parseQuotaValueCpu, parseQuotaValueMemoryAndStorage, prepareDataForManageableBreadcrumbs, prepareDataForManageableSidebar, prepareTemplate, prepareUrlsToFetchForDynamicRenderer, updateEntry, useApiResourceSingle, useApiResourceTypesByGroup, useApiResources, useApisResourceTypes, useBuiltinResourceSingle, useBuiltinResourceTypes, useBuiltinResources, useClusterList, useCrdData, useCrdResourceSingle, useCrdResources, useDirectUnknownResource, usePermissions };
46935
46970
  //# sourceMappingURL=openapi-k8s-toolkit.es.js.map