@prorobotech/openapi-k8s-toolkit 0.0.1-alpha.75 → 0.0.1-alpha.77

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';
@@ -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();
@@ -41660,7 +41662,7 @@ const YamlEditorSingleton$1 = ({
41660
41662
  const { namespace } = currentValues.metadata;
41661
41663
  const { name } = currentValues.metadata;
41662
41664
  const body = currentValues;
41663
- const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis"}/${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${typeName}/${isCreate ? "" : name}`;
41665
+ const endpoint = `/api/clusters/${cluster}/k8s/${type === "builtin" ? "" : "apis/"}${apiGroupApiVersion}${isNameSpaced ? `/namespaces/${namespace}` : ""}/${typeName}/${isCreate ? "" : name}`;
41664
41666
  if (isCreate) {
41665
41667
  createNewEntry({ endpoint, body }).then((res) => {
41666
41668
  console.log(res);
@@ -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,6 +45492,7 @@ 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;
@@ -45579,7 +45597,7 @@ const MonacoEditor = ({
45579
45597
  ),
45580
45598
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: isPaused ? "Not streaming events" : "Streaming events" })
45581
45599
  ] }) }),
45582
- /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 8, $samespace: true }),
45600
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45583
45601
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.CustomCard, { $isVisible: isTerminalVisible, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Styled$1.FullWidthDiv, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45584
45602
  Ft,
45585
45603
  {
@@ -45600,12 +45618,20 @@ const MonacoEditor = ({
45600
45618
  ] });
45601
45619
  };
45602
45620
 
45621
+ const TopRowContent = st.div`
45622
+ width: 100%;
45623
+ height: 35px;
45624
+ margin-left: 202px;
45625
+ display: flex;
45626
+ align-items: center;
45627
+ `;
45603
45628
  const CustomSelect = st.div`
45604
45629
  .ant-select {
45605
45630
  width: 200px;
45606
45631
  }
45607
45632
  `;
45608
45633
  const Styled = {
45634
+ TopRowContent,
45609
45635
  CustomSelect
45610
45636
  };
45611
45637
 
@@ -45631,7 +45657,7 @@ const PodLogsMonaco = ({
45631
45657
  { value: "previous", label: "Previous log" }
45632
45658
  ] : [{ value: "current", label: "Current log" }];
45633
45659
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
45634
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45660
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.TopRowContent, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Flex, { gap: 16, children: [
45635
45661
  /* @__PURE__ */ jsxRuntimeExports.jsx(Styled.CustomSelect, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
45636
45662
  Select,
45637
45663
  {
@@ -45665,7 +45691,7 @@ const PodLogsMonaco = ({
45665
45691
  }
45666
45692
  }
45667
45693
  ) })
45668
- ] }),
45694
+ ] }) }),
45669
45695
  /* @__PURE__ */ jsxRuntimeExports.jsx(Spacer$1, { $space: 16, $samespace: true }),
45670
45696
  currentContainer && /* @__PURE__ */ jsxRuntimeExports.jsx(
45671
45697
  MonacoEditor,
@@ -46532,6 +46558,7 @@ const YamlEditorSingleton = ({
46532
46558
  typeName: typeNamePrepared,
46533
46559
  designNewLayout: true,
46534
46560
  designNewLayoutHeight: height,
46561
+ openNotification: true,
46535
46562
  ...props
46536
46563
  }
46537
46564
  ),