@prorobotech/openapi-k8s-toolkit 1.2.1-alpha.0 → 1.2.1-alpha.2

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.
@@ -82623,7 +82623,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82623
82623
 
82624
82624
  const XTerminal$2 = ({ endpoint, namespace, podName, container, substractHeight }) => {
82625
82625
  const [isLoading, setIsLoading] = React$1.useState(true);
82626
- const [error, setError] = React$1.useState();
82626
+ const [error, setError] = React$1.useState(null);
82627
82627
  const [terminal, setTerminal] = React$1.useState();
82628
82628
  const terminalInstance = React$1.useRef(null);
82629
82629
  const terminalRef = React$1.useRef(null);
@@ -82670,6 +82670,10 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82670
82670
  };
82671
82671
  socket.onmessage = (event) => {
82672
82672
  const data = JSON.parse(event.data);
82673
+ if (data.type === "error") {
82674
+ setError(data.payload);
82675
+ return;
82676
+ }
82673
82677
  if (data.type === "output") {
82674
82678
  if (data.payload.type === "Buffer" && Array.isArray(data.payload.data)) {
82675
82679
  const text = Buffer.from(data.payload.data);
@@ -82682,9 +82686,9 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82682
82686
  socket.onclose = () => {
82683
82687
  console.log(`[${namespace}/${podName}]: WebSocket Client Closed`);
82684
82688
  };
82685
- socket.onerror = (error2) => {
82686
- console.error("WebSocket Error:", error2);
82687
- setError(error2);
82689
+ socket.onerror = () => {
82690
+ console.error("WebSocket Error");
82691
+ setError("Failed to connect to terminal");
82688
82692
  };
82689
82693
  terminal.onData((data) => {
82690
82694
  if (data === "\x1BOP") {
@@ -82703,7 +82707,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
82703
82707
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
82704
82708
  /* @__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%" } }) }) }),
82705
82709
  isLoading && !error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Spin, {}),
82706
- error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "error", title: "Error", subTitle: JSON.stringify(error) })
82710
+ error && /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Result, { status: "error", title: "Error", subTitle: error })
82707
82711
  ] });
82708
82712
  };
82709
82713
 
@@ -85788,6 +85792,23 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
85788
85792
  });
85789
85793
  };
85790
85794
 
85795
+ const getPlugins = async ({ cluster }) => {
85796
+ return axios.get(`/api/clusters/${cluster}/openapi-bff/plugins/getPlugins`);
85797
+ };
85798
+
85799
+ const usePluginManifest = ({
85800
+ cluster,
85801
+ refetchInterval,
85802
+ isEnabled
85803
+ }) => {
85804
+ return reactQuery.useQuery({
85805
+ queryKey: ["usePluginManifest", cluster],
85806
+ queryFn: () => getPlugins({ cluster }),
85807
+ refetchInterval: refetchInterval !== void 0 ? refetchInterval : 6e4,
85808
+ enabled: isEnabled
85809
+ });
85810
+ };
85811
+
85791
85812
  exports.BackToDefaultIcon = BackToDefaultIcon;
85792
85813
  exports.BlackholeForm = BlackholeForm;
85793
85814
  exports.BlackholeFormProvider = BlackholeFormProvider;
@@ -85927,6 +85948,7 @@ Take a look at the reducer(s) handling this action type: ${action.type}.
85927
85948
  exports.useListWatch = useListWatch;
85928
85949
  exports.useManyK8sSmartResource = useManyK8sSmartResource;
85929
85950
  exports.usePermissions = usePermissions;
85951
+ exports.usePluginManifest = usePluginManifest;
85930
85952
  exports.useResourceScope = useResourceScope;
85931
85953
  exports.useSmartResourceParams = useSmartResourceParams;
85932
85954