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

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