@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.76 → 0.0.1-alpha.78

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.
@@ -1,5 +1,5 @@
1
1
  import o, { useDebugValue, createElement, useRef, useContext, useState, useLayoutEffect, useEffect, useMemo, memo, useCallback, createContext, Suspense, Fragment } from 'react';
2
- import { Input, Tree, Modal, Alert, theme, Breadcrumb, Spin, Menu, Tooltip, Space, Button, Flex, Tag, Table, Typography, Form, Select, Row, Col, Slider, InputNumber, Switch, Card, notification, Dropdown, Result, Progress, Tabs } from 'antd';
2
+ import { Input, Tree, Modal, Alert, theme, Breadcrumb, Spin, Menu, Tooltip, Space, Button, Flex, Tag, Table, notification, Typography, Form, Select, Row, Col, Slider, InputNumber, Switch, Card, Dropdown, Result, Progress, Tabs } from 'antd';
3
3
  import { LoadingOutlined, ExclamationCircleFilled, CloseCircleFilled, CheckCircleFilled, SearchOutlined, CheckOutlined, CloseOutlined, EditOutlined, DeleteOutlined, CaretDownOutlined, CaretRightOutlined, BugOutlined, PlusOutlined, EllipsisOutlined } from '@ant-design/icons';
4
4
  import { useQuery, useQueries } from '@tanstack/react-query';
5
5
  import { Link, useNavigate, useLocation } from 'react-router-dom';
@@ -8405,7 +8405,7 @@ const ResumeCircleIcon = () => {
8405
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
8406
  "path",
8407
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",
8408
+ 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 0ZM23.1289 17.7695L14.5977 23.9766C14.5509 24.0102 14.4958 24.0302 14.4383 24.0346C14.3809 24.0389 14.3234 24.0273 14.2721 24.001C14.2208 23.9748 14.1778 23.9349 14.1477 23.8858C14.1176 23.8367 14.1017 23.7803 14.1016 23.7227V11.3164C14.1014 11.2587 14.1172 11.2021 14.1472 11.1528C14.1772 11.1035 14.2203 11.0635 14.2717 11.0372C14.3231 11.0109 14.3807 10.9994 14.4382 11.0038C14.4958 11.0083 14.551 11.0286 14.5977 11.0625L23.1289 17.2656C23.1692 17.2941 23.2021 17.3319 23.2248 17.3757C23.2475 17.4196 23.2593 17.4682 23.2593 17.5176C23.2593 17.5669 23.2475 17.6156 23.2248 17.6594C23.2021 17.7033 23.1692 17.741 23.1289 17.7695Z",
8409
8409
  fill: token.colorText,
8410
8410
  fillOpacity: "0.88"
8411
8411
  }
@@ -41643,10 +41643,12 @@ const YamlEditorSingleton$1 = ({
41643
41643
  typeName,
41644
41644
  backlink,
41645
41645
  designNewLayout,
41646
- designNewLayoutHeight
41646
+ designNewLayoutHeight,
41647
+ openNotification
41647
41648
  }) => {
41648
41649
  const { token } = theme.useToken();
41649
41650
  const navigate = useNavigate();
41651
+ const [api, contextHolder] = notification.useNotification();
41650
41652
  const [yamlData, setYamlData] = useState("");
41651
41653
  const [isLoading, setIsLoading] = useState(false);
41652
41654
  const [error, setError] = useState();
@@ -41668,6 +41670,13 @@ const YamlEditorSingleton$1 = ({
41668
41670
  navigate(backlink);
41669
41671
  }
41670
41672
  setIsLoading(false);
41673
+ if (openNotification) {
41674
+ api.success({
41675
+ message: "Created successfully",
41676
+ description: "Entry was created",
41677
+ placement: "topRight"
41678
+ });
41679
+ }
41671
41680
  }).catch((error2) => {
41672
41681
  console.log("Form submit error", error2);
41673
41682
  setIsLoading(false);
@@ -41680,6 +41689,13 @@ const YamlEditorSingleton$1 = ({
41680
41689
  navigate(backlink);
41681
41690
  }
41682
41691
  setIsLoading(false);
41692
+ if (openNotification) {
41693
+ api.success({
41694
+ message: "Updated successfully",
41695
+ description: "Entry was updated",
41696
+ placement: "topRight"
41697
+ });
41698
+ }
41683
41699
  }).catch((error2) => {
41684
41700
  console.log("Form submit error", error2);
41685
41701
  setIsLoading(false);
@@ -41688,6 +41704,7 @@ const YamlEditorSingleton$1 = ({
41688
41704
  }
41689
41705
  };
41690
41706
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
41707
+ contextHolder,
41691
41708
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$g.BorderRadiusContainer, { $designNewLayoutHeight: designNewLayoutHeight, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
41692
41709
  Ft,
41693
41710
  {
@@ -45475,9 +45492,11 @@ const CustomCard = st.div`
45475
45492
  `;
45476
45493
  const VisibilityContainer = st.div`
45477
45494
  visibility: ${({ $isVisible }) => $isVisible ? "visible" : "hidden"};
45495
+ margin-top: -51px;
45478
45496
  `;
45479
45497
  const CursorPointerDiv = st.div`
45480
45498
  cursor: pointer;
45499
+ user-select: none;
45481
45500
  `;
45482
45501
  const Styled$1 = {
45483
45502
  FullWidthDiv,
@@ -45579,7 +45598,7 @@ const MonacoEditor = ({
45579
45598
  ),
45580
45599
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isPaused ? "Not streaming events" : "Streaming events" })
45581
45600
  ] }) }),
45582
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45601
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45583
45602
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45584
45603
  Ft,
45585
45604
  {
@@ -45600,12 +45619,20 @@ const MonacoEditor = ({
45600
45619
  ] });
45601
45620
  };
45602
45621
 
45622
+ const TopRowContent = st.div`
45623
+ width: 100%;
45624
+ height: 35px;
45625
+ margin-left: 202px;
45626
+ display: flex;
45627
+ align-items: center;
45628
+ `;
45603
45629
  const CustomSelect = st.div`
45604
45630
  .ant-select {
45605
45631
  width: 200px;
45606
45632
  }
45607
45633
  `;
45608
45634
  const Styled = {
45635
+ TopRowContent,
45609
45636
  CustomSelect
45610
45637
  };
45611
45638
 
@@ -45614,6 +45641,7 @@ const PodLogsMonaco = ({
45614
45641
  namespace,
45615
45642
  podName,
45616
45643
  containers,
45644
+ initContainers,
45617
45645
  theme,
45618
45646
  substractHeight,
45619
45647
  rawPodInfo
@@ -45630,13 +45658,31 @@ const PodLogsMonaco = ({
45630
45658
  { value: "current", label: "Current log" },
45631
45659
  { value: "previous", label: "Previous log" }
45632
45660
  ] : [{ value: "current", label: "Current log" }];
45661
+ const options = initContainers.length > 0 ? [
45662
+ {
45663
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Containers" }),
45664
+ title: "Containers",
45665
+ options: containers.map((container) => ({ value: container, label: container }))
45666
+ },
45667
+ {
45668
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Init Containers" }),
45669
+ title: "Init Containers",
45670
+ options: initContainers.map((container) => ({ value: container, label: container }))
45671
+ }
45672
+ ] : [
45673
+ {
45674
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Containers" }),
45675
+ title: "Containers",
45676
+ options: containers.map((container) => ({ value: container, label: container }))
45677
+ }
45678
+ ];
45633
45679
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45634
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45680
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.TopRowContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45635
45681
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45636
45682
  Select,
45637
45683
  {
45638
45684
  placeholder: "Select container",
45639
- options: containers.map((container) => ({ value: container, label: container })),
45685
+ options,
45640
45686
  filterOption: filterSelectOptions,
45641
45687
  disabled: containers.length === 0,
45642
45688
  showSearch: true,
@@ -45665,7 +45711,7 @@ const PodLogsMonaco = ({
45665
45711
  }
45666
45712
  }
45667
45713
  ) })
45668
- ] }),
45714
+ ] }) }),
45669
45715
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45670
45716
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45671
45717
  MonacoEditor,
@@ -46366,7 +46412,11 @@ const parseMutliqueryText$1 = ({ text, multiQueryData }) => {
46366
46412
  }
46367
46413
  });
46368
46414
  };
46369
- const getRunningContainerNames = (pod) => (pod.status?.containerStatuses ?? []).filter((st) => Boolean(st.state?.running)).map((st) => st.name);
46415
+ const getRunningContainerNames = (pod) => {
46416
+ const containers = (pod.status?.containerStatuses ?? []).filter((st) => Boolean(st.state?.running)).map((st) => st.name);
46417
+ const initContainers = (pod.status?.initContainerStatuses ?? []).map((st) => st.name);
46418
+ return { containers, initContainers };
46419
+ };
46370
46420
 
46371
46421
  const PodLogs = ({
46372
46422
  data,
@@ -46426,7 +46476,7 @@ const PodLogs = ({
46426
46476
  if (!podInfo) {
46427
46477
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: "No Pod Info" });
46428
46478
  }
46429
- const containers = getRunningContainerNames(podInfo);
46479
+ const { containers, initContainers } = getRunningContainerNames(podInfo);
46430
46480
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
46431
46481
  /* @__PURE__ */ jsxRuntimeExports.jsx(
46432
46482
  PodLogsMonaco,
@@ -46435,6 +46485,7 @@ const PodLogs = ({
46435
46485
  namespace: namespacePrepared,
46436
46486
  podName: podNamePrepared,
46437
46487
  containers,
46488
+ initContainers,
46438
46489
  theme,
46439
46490
  substractHeight: substractHeight || 340 + 35 + 8,
46440
46491
  rawPodInfo: podInfo,
@@ -46532,6 +46583,7 @@ const YamlEditorSingleton = ({
46532
46583
  typeName: typeNamePrepared,
46533
46584
  designNewLayout: true,
46534
46585
  designNewLayoutHeight: height,
46586
+ openNotification: true,
46535
46587
  ...props
46536
46588
  }
46537
46589
  ),