@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.69 → 0.0.1-alpha.70

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.
@@ -45042,43 +45042,26 @@ const Styled$6 = {
45042
45042
  };
45043
45043
 
45044
45044
  const PodTerminal$1 = ({ cluster, namespace, podName, containers, substractHeight }) => {
45045
- const [selectValue, setSelectValue] = useState(containers[0] || void 0);
45046
- const [currentContainer, setCurrentContainer] = useState();
45047
- const [hash, setHash] = useState(0);
45045
+ const [currentContainer, setCurrentContainer] = useState(containers[0] || void 0);
45048
45046
  const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/terminalPod/terminalPod`;
45049
45047
  if (containers.length === 0) {
45050
45048
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
45051
45049
  }
45052
45050
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45053
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45054
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45055
- Select,
45056
- {
45057
- placeholder: "Select container",
45058
- options: containers.map((container) => ({ value: container, label: container })),
45059
- filterOption: filterSelectOptions,
45060
- disabled: containers.length === 0,
45061
- showSearch: true,
45062
- value: selectValue,
45063
- onChange: (value) => {
45064
- setHash(hash + 1);
45065
- setSelectValue(value);
45066
- }
45067
- }
45068
- ) }),
45069
- /* @__PURE__ */ jsxRuntimeExports.jsx(
45070
- Button,
45071
- {
45072
- type: "primary",
45073
- onClick: () => {
45074
- setCurrentContainer(selectValue);
45075
- setHash(hash + 1);
45076
- },
45077
- disabled: !selectValue,
45078
- children: "Open"
45051
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$6.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45052
+ Select,
45053
+ {
45054
+ placeholder: "Select container",
45055
+ options: containers.map((container) => ({ value: container, label: container })),
45056
+ filterOption: filterSelectOptions,
45057
+ disabled: containers.length === 0,
45058
+ showSearch: true,
45059
+ value: currentContainer,
45060
+ onChange: (value) => {
45061
+ setCurrentContainer(value);
45079
45062
  }
45080
- )
45081
- ] }),
45063
+ }
45064
+ ) }),
45082
45065
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45083
45066
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45084
45067
  XTerminal$2,
@@ -45089,7 +45072,7 @@ const PodTerminal$1 = ({ cluster, namespace, podName, containers, substractHeigh
45089
45072
  container: currentContainer,
45090
45073
  substractHeight
45091
45074
  },
45092
- `${cluster}-${namespace}-${podName}-${currentContainer}-${hash}`
45075
+ `${cluster}-${namespace}-${podName}-${currentContainer}`
45093
45076
  )
45094
45077
  ] });
45095
45078
  };
@@ -45108,15 +45091,9 @@ const FullWidthDiv$2 = st.div`
45108
45091
  width: 100%;
45109
45092
  height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
45110
45093
  `;
45111
- const ShutdownContainer$1 = st.div`
45112
- visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
45113
- margin-top: -40px;
45114
- display: flex;
45115
- justify-content: flex-end;
45116
- `;
45117
45094
  const ProgressContainer = st.div`
45118
- margin-top: -464px;
45119
- height: 464px;
45095
+ margin-top: calc(${({ $substractHeight }) => $substractHeight}px - 100vh);
45096
+ height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
45120
45097
  display: flex;
45121
45098
  flex-flow: column;
45122
45099
  justify-content: center;
@@ -45126,7 +45103,6 @@ const ProgressContainer = st.div`
45126
45103
  const Styled$5 = {
45127
45104
  FullWidthDiv: FullWidthDiv$2,
45128
45105
  CustomCard: CustomCard$2,
45129
- ShutdownContainer: ShutdownContainer$1,
45130
45106
  ProgressContainer
45131
45107
  };
45132
45108
 
@@ -45224,9 +45200,6 @@ const XTerminal$1 = ({ endpoint, nodeName, profile, substractHeight }) => {
45224
45200
  }
45225
45201
  }
45226
45202
  }
45227
- if (data.type === "shutdown") {
45228
- setIsTerminalVisible(false);
45229
- }
45230
45203
  if (data.type === "output") {
45231
45204
  if (data.payload.type === "Buffer" && Array.isArray(data.payload.data)) {
45232
45205
  const text = Buffer.from(data.payload.data);
@@ -45259,25 +45232,8 @@ const XTerminal$1 = ({ endpoint, nodeName, profile, substractHeight }) => {
45259
45232
  };
45260
45233
  }, [terminal, endpoint, nodeName, profile]);
45261
45234
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45262
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.ShutdownContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45263
- Button,
45264
- {
45265
- type: "dashed",
45266
- disabled: !socketRef.current,
45267
- onClick: () => {
45268
- setIsTerminalVisible(false);
45269
- socketRef.current?.send(
45270
- JSON.stringify({
45271
- type: "shutdown"
45272
- })
45273
- );
45274
- },
45275
- children: "Terminate"
45276
- }
45277
- ) }),
45278
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45279
45235
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$5.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
45280
- !isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$5.ProgressContainer, { children: [
45236
+ !isTerminalVisible && !error && isWarmingUp && /* @__PURE__ */ jsxRuntimeExports.jsxs(Styled$5.ProgressContainer, { $substractHeight: substractHeight, children: [
45281
45237
  isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
45282
45238
  !isLoading && /* @__PURE__ */ jsxRuntimeExports.jsx(Progress, { type: "circle", percent: progressPercent }),
45283
45239
  warmupMessage && /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography.Text, { children: [
@@ -45303,37 +45259,21 @@ const Styled$4 = {
45303
45259
  };
45304
45260
 
45305
45261
  const NodeTerminal$1 = ({ cluster, nodeName, substractHeight }) => {
45306
- const [selectValue, setSelectValue] = useState();
45307
- const [currentProfile, setCurrentProfile] = useState();
45308
- const [hash, setHash] = useState(0);
45262
+ const [currentProfile, setCurrentProfile] = useState("general");
45309
45263
  const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/terminalNode/terminalNode`;
45310
45264
  const profiles = ["legacy", "general", "baseline", "netadmin", "restricted", "sysadmin"];
45311
45265
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45312
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45313
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45314
- Select,
45315
- {
45316
- placeholder: "Select profile",
45317
- options: profiles.map((profile) => ({ value: profile, label: profile })),
45318
- filterOption: filterSelectOptions,
45319
- showSearch: true,
45320
- value: selectValue,
45321
- onChange: (value) => setSelectValue(value)
45322
- }
45323
- ) }),
45324
- /* @__PURE__ */ jsxRuntimeExports.jsx(
45325
- Button,
45326
- {
45327
- type: "primary",
45328
- onClick: () => {
45329
- setCurrentProfile(selectValue);
45330
- setHash(hash + 1);
45331
- },
45332
- disabled: !selectValue,
45333
- children: "Open"
45334
- }
45335
- )
45336
- ] }),
45266
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$4.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45267
+ Select,
45268
+ {
45269
+ placeholder: "Select profile",
45270
+ options: profiles.map((profile) => ({ value: profile, label: profile })),
45271
+ filterOption: filterSelectOptions,
45272
+ showSearch: true,
45273
+ value: currentProfile,
45274
+ onChange: (value) => setCurrentProfile(value)
45275
+ }
45276
+ ) }),
45337
45277
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45338
45278
  currentProfile && /* @__PURE__ */ jsxRuntimeExports.jsx(
45339
45279
  XTerminal$1,
@@ -45343,36 +45283,31 @@ const NodeTerminal$1 = ({ cluster, nodeName, substractHeight }) => {
45343
45283
  profile: currentProfile,
45344
45284
  substractHeight
45345
45285
  },
45346
- `${cluster}-${nodeName}-${currentProfile}-${hash}`
45286
+ `${cluster}-${nodeName}-${currentProfile}`
45347
45287
  )
45348
45288
  ] });
45349
45289
  };
45350
45290
 
45351
- const FullWidthDiv$1 = st.div`
45352
- display: flex;
45353
- justify-content: center;
45354
- width: 100%;
45355
- `;
45356
45291
  const CustomCard$1 = st.div`
45357
45292
  visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
45358
- max-height: calc(100vh - 158px);
45293
+ height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
45359
45294
 
45360
45295
  * {
45361
45296
  scrollbar-width: thin;
45362
45297
  }
45363
45298
  `;
45364
- const ShutdownContainer = st.div`
45365
- margin-top: -40px;
45299
+ const FullWidthDiv$1 = st.div`
45366
45300
  display: flex;
45367
- justify-content: flex-end;
45301
+ justify-content: center;
45302
+ width: 100%;
45303
+ height: calc(100vh - ${({ $substractHeight }) => $substractHeight}px);
45368
45304
  `;
45369
45305
  const Styled$3 = {
45370
45306
  FullWidthDiv: FullWidthDiv$1,
45371
- CustomCard: CustomCard$1,
45372
- ShutdownContainer
45307
+ CustomCard: CustomCard$1
45373
45308
  };
45374
45309
 
45375
- const XTerminal = ({ endpoint, namespace, podName, container }) => {
45310
+ const XTerminal = ({ endpoint, namespace, podName, container, substractHeight }) => {
45376
45311
  const [isLoading, setIsLoading] = useState(true);
45377
45312
  const [error, setError] = useState();
45378
45313
  const [isTerminalVisible, setIsTerminalVisible] = useState(false);
@@ -45390,8 +45325,7 @@ const XTerminal = ({ endpoint, namespace, podName, container }) => {
45390
45325
  cursorStyle: "block",
45391
45326
  fontFamily: "monospace",
45392
45327
  fontSize: 16,
45393
- theme: themes.MaterialDark,
45394
- convertEol: true
45328
+ theme: themes.MaterialDark
45395
45329
  });
45396
45330
  terminal2.loadAddon(fitAddon.current);
45397
45331
  terminal2.open(terminalRef.current);
@@ -45449,24 +45383,7 @@ const XTerminal = ({ endpoint, namespace, podName, container }) => {
45449
45383
  };
45450
45384
  }, [terminal, endpoint, namespace, podName, container]);
45451
45385
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45452
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.ShutdownContainer, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45453
- Button,
45454
- {
45455
- type: "dashed",
45456
- disabled: !socketRef.current,
45457
- onClick: () => {
45458
- setIsTerminalVisible(false);
45459
- socketRef.current?.send(
45460
- JSON.stringify({
45461
- type: "close"
45462
- })
45463
- );
45464
- },
45465
- children: "Terminate"
45466
- }
45467
- ) }),
45468
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45469
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
45386
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.CustomCard, { $isVisible: isTerminalVisible, $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$3.FullWidthDiv, { $substractHeight: substractHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: terminalRef, style: { width: "100%", height: "100%" } }) }) }),
45470
45387
  isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(Spin, {}),
45471
45388
  error && /* @__PURE__ */ jsxRuntimeExports.jsx(Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
45472
45389
  ] });
@@ -45481,44 +45398,27 @@ const Styled$2 = {
45481
45398
  CustomSelect: CustomSelect$1
45482
45399
  };
45483
45400
 
45484
- const PodLogs$1 = ({ cluster, namespace, podName, containers }) => {
45485
- const [selectValue, setSelectValue] = useState(containers[0] || void 0);
45486
- const [currentContainer, setCurrentContainer] = useState();
45487
- const [hash, setHash] = useState(0);
45401
+ const PodLogs$1 = ({ cluster, namespace, podName, containers, substractHeight }) => {
45402
+ const [currentContainer, setCurrentContainer] = useState(containers[0] || void 0);
45488
45403
  const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/podLogs/podLogs`;
45489
45404
  if (containers.length === 0) {
45490
45405
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
45491
45406
  }
45492
45407
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45493
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45494
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$2.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45495
- Select,
45496
- {
45497
- placeholder: "Select container",
45498
- options: containers.map((container) => ({ value: container, label: container })),
45499
- filterOption: filterSelectOptions,
45500
- disabled: containers.length === 0,
45501
- showSearch: true,
45502
- value: selectValue,
45503
- onChange: (value) => {
45504
- setHash(hash + 1);
45505
- setSelectValue(value);
45506
- }
45507
- }
45508
- ) }),
45509
- /* @__PURE__ */ jsxRuntimeExports.jsx(
45510
- Button,
45511
- {
45512
- type: "primary",
45513
- onClick: () => {
45514
- setCurrentContainer(selectValue);
45515
- setHash(hash + 1);
45516
- },
45517
- disabled: !selectValue,
45518
- children: "Open"
45408
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$2.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45409
+ Select,
45410
+ {
45411
+ placeholder: "Select container",
45412
+ options: containers.map((container) => ({ value: container, label: container })),
45413
+ filterOption: filterSelectOptions,
45414
+ disabled: containers.length === 0,
45415
+ showSearch: true,
45416
+ value: currentContainer,
45417
+ onChange: (value) => {
45418
+ setCurrentContainer(value);
45519
45419
  }
45520
- )
45521
- ] }),
45420
+ }
45421
+ ) }),
45522
45422
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45523
45423
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45524
45424
  XTerminal,
@@ -45526,9 +45426,10 @@ const PodLogs$1 = ({ cluster, namespace, podName, containers }) => {
45526
45426
  endpoint,
45527
45427
  namespace,
45528
45428
  podName,
45529
- container: currentContainer
45429
+ container: currentContainer,
45430
+ substractHeight
45530
45431
  },
45531
- `${cluster}-${namespace}-${podName}-${currentContainer}-${hash}`
45432
+ `${cluster}-${namespace}-${podName}-${currentContainer}`
45532
45433
  )
45533
45434
  ] });
45534
45435
  };
@@ -45683,43 +45584,26 @@ const PodLogsMonaco = ({
45683
45584
  theme,
45684
45585
  substractHeight
45685
45586
  }) => {
45686
- const [selectValue, setSelectValue] = useState(containers[0] || void 0);
45687
- const [currentContainer, setCurrentContainer] = useState();
45688
- const [hash, setHash] = useState(0);
45587
+ const [currentContainer, setCurrentContainer] = useState(containers[0] || void 0);
45689
45588
  const endpoint = `/api/clusters/${cluster}/openapi-bff-ws/terminal/podLogs/podLogs`;
45690
45589
  if (containers.length === 0) {
45691
45590
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Running Containers" });
45692
45591
  }
45693
45592
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45694
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45695
- /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45696
- Select,
45697
- {
45698
- placeholder: "Select container",
45699
- options: containers.map((container) => ({ value: container, label: container })),
45700
- filterOption: filterSelectOptions,
45701
- disabled: containers.length === 0,
45702
- showSearch: true,
45703
- value: selectValue,
45704
- onChange: (value) => {
45705
- setHash(hash + 1);
45706
- setSelectValue(value);
45707
- }
45708
- }
45709
- ) }),
45710
- /* @__PURE__ */ jsxRuntimeExports.jsx(
45711
- Button,
45712
- {
45713
- type: "primary",
45714
- onClick: () => {
45715
- setCurrentContainer(selectValue);
45716
- setHash(hash + 1);
45717
- },
45718
- disabled: !selectValue,
45719
- children: "Open"
45593
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45594
+ Select,
45595
+ {
45596
+ placeholder: "Select container",
45597
+ options: containers.map((container) => ({ value: container, label: container })),
45598
+ filterOption: filterSelectOptions,
45599
+ disabled: containers.length === 0,
45600
+ showSearch: true,
45601
+ value: currentContainer,
45602
+ onChange: (value) => {
45603
+ setCurrentContainer(value);
45720
45604
  }
45721
- )
45722
- ] }),
45605
+ }
45606
+ ) }),
45723
45607
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45724
45608
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45725
45609
  MonacoEditor,
@@ -45731,7 +45615,7 @@ const PodLogsMonaco = ({
45731
45615
  theme,
45732
45616
  substractHeight
45733
45617
  },
45734
- `${cluster}-${namespace}-${podName}-${currentContainer}-${hash}`
45618
+ `${cluster}-${namespace}-${podName}-${currentContainer}`
45735
45619
  )
45736
45620
  ] });
45737
45621
  };