@dovetail-v2/refine 0.0.52 → 0.0.54

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,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./index-7fe9ade3.js";
1
+ import { j as jsxRuntimeExports } from "./index-d2d0cacc.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -1054,7 +1054,7 @@ const container$1 = "Container";
1054
1054
  const redeploy$1 = "Redeploy";
1055
1055
  const data$1 = "Data";
1056
1056
  const resume$1 = "Resume";
1057
- const sessionAffinity$1 = "会话保持";
1057
+ const sessionAffinity$1 = "Session Affinity";
1058
1058
  const log$1 = "Log";
1059
1059
  const ready$1 = "Ready";
1060
1060
  const updating$1 = "Updating";
@@ -1064,7 +1064,7 @@ const suspended$1 = "Suspended";
1064
1064
  const running$1 = "Running";
1065
1065
  const terminating$1 = "Terminating";
1066
1066
  const terminated$1 = "Terminated";
1067
- const succeeded$1 = "Succeed";
1067
+ const succeeded$1 = "Succeeded";
1068
1068
  const unknown$1 = "Unknown";
1069
1069
  const pending$1 = "Pending";
1070
1070
  const waiting$1 = "Waiting";
@@ -10016,6 +10016,7 @@ class ServiceModel extends ResourceModel {
10016
10016
  }
10017
10017
  return {
10018
10018
  servicePort: p.port,
10019
+ nodePort: p.nodePort,
10019
10020
  link,
10020
10021
  targetPort: p.targetPort,
10021
10022
  protocol: p.protocol
@@ -11399,7 +11400,7 @@ const WorkloadPodsTable = ({
11399
11400
  field: "",
11400
11401
  value: "",
11401
11402
  fn(item) {
11402
- return matchSelector(item, selector, item.metadata.namespace);
11403
+ return matchSelector(item, selector, namespace2);
11403
11404
  }
11404
11405
  }]
11405
11406
  }
@@ -22904,7 +22905,7 @@ const Separator = () => {
22904
22905
  });
22905
22906
  };
22906
22907
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
22907
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-1745c907.js"));
22908
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-f2a92bde.js"));
22908
22909
  const YamlEditorComponent = forwardRef(
22909
22910
  function YamlEditorComponent2(props, ref) {
22910
22911
  const {
@@ -23099,7 +23100,7 @@ const YamlEditorComponent = forwardRef(
23099
23100
  ] }),
23100
23101
  errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { className: ErrorWrapperStyle, size: 8, align: "start", children: [
23101
23102
  /* @__PURE__ */ jsxRuntimeExports.jsx(XmarkFailedSeriousWarningFill16RedIcon, { className: ErrorIconStyle }),
23102
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: ErrorMsgStyle, children: [
23103
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: ErrorMsgStyle, children: [
23103
23104
  errorMsgs.length > 1 ? `${index + 1}. ` : "",
23104
23105
  errorMsg
23105
23106
  ] }, errorMsg)) })
@@ -23533,17 +23534,28 @@ function YamlForm(props) {
23533
23534
  i18n: i18n2
23534
23535
  } = useTranslation();
23535
23536
  const FormWrapper = isShowLayout ? FormLayout : React__default.Fragment;
23537
+ const formWrapperProps = isShowLayout ? {
23538
+ saveButtonProps
23539
+ } : {};
23536
23540
  const schema = useMemo(() => {
23537
23541
  return editorProps.schema || {};
23538
23542
  }, [editorProps.schema]);
23539
23543
  const responseErrors = useMemo(() => errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [], [errorResponseBody, i18n2]);
23540
23544
  const onFinish = useCallback(async (store) => {
23541
23545
  var _a, _b;
23542
- const result = await ((_a = formProps.onFinish) == null ? void 0 : _a.call(formProps, store));
23543
- if (result) {
23544
- (_b = props.onFinish) == null ? void 0 : _b.call(props);
23546
+ try {
23547
+ const result = await ((_a = formProps.onFinish) == null ? void 0 : _a.call(formProps, store));
23548
+ if (result) {
23549
+ (_b = props.onFinish) == null ? void 0 : _b.call(props);
23550
+ }
23551
+ } catch {
23552
+ } finally {
23553
+ onSaveButtonPropsChange == null ? void 0 : onSaveButtonPropsChange({
23554
+ ...saveButtonProps,
23555
+ loading: false
23556
+ });
23545
23557
  }
23546
- }, [formProps, props]);
23558
+ }, [formProps, props, saveButtonProps, onSaveButtonPropsChange]);
23547
23559
  useEffect(() => {
23548
23560
  onSaveButtonPropsChange == null ? void 0 : onSaveButtonPropsChange(saveButtonProps);
23549
23561
  }, [saveButtonProps, onSaveButtonPropsChange]);
@@ -23551,7 +23563,7 @@ function YamlForm(props) {
23551
23563
  onErrorsChange == null ? void 0 : onErrorsChange(responseErrors);
23552
23564
  }, [responseErrors, onErrorsChange]);
23553
23565
  return /* @__PURE__ */ jsxRuntimeExports.jsx(FormWrapper, {
23554
- saveButtonProps,
23566
+ ...formWrapperProps,
23555
23567
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form, {
23556
23568
  ...formProps,
23557
23569
  initialValues: formProps.initialValues,
@@ -23665,9 +23677,10 @@ function FormModal(props) {
23665
23677
  const saveButtonProps = isYamlForm ? yamlSaveButtonProps : refineFormResult.formResult.saveButtonProps;
23666
23678
  const onCancel = useCallback(() => {
23667
23679
  popModal();
23668
- }, []);
23680
+ }, [popModal]);
23669
23681
  const onOk = useCallback((e2) => {
23670
23682
  var _a2;
23683
+ setIsError(false);
23671
23684
  (_a2 = saveButtonProps.onClick) == null ? void 0 : _a2.call(saveButtonProps, e2);
23672
23685
  }, [saveButtonProps]);
23673
23686
  const errorText = (() => {
@@ -23696,11 +23709,11 @@ function FormModal(props) {
23696
23709
  }) : "",
23697
23710
  okButtonProps: {
23698
23711
  ...saveButtonProps,
23699
- children: (_e = config.formConfig) == null ? void 0 : _e.saveButtonText
23712
+ children: (_e = config.formConfig) == null ? void 0 : _e.saveButtonText,
23713
+ onClick: onOk
23700
23714
  },
23701
23715
  closeIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseCircleFilled$1, {}),
23702
23716
  okText,
23703
- onOk,
23704
23717
  onCancel,
23705
23718
  destroyOnClose: true,
23706
23719
  fullscreen: true,
@@ -24081,7 +24094,7 @@ const IngressRulesComponent = ({
24081
24094
  children: result
24082
24095
  });
24083
24096
  };
24084
- const columns_qgyagz = "";
24097
+ const columns_1h38dp = "";
24085
24098
  const DashedTitleStyle = "dh5j833";
24086
24099
  const ServiceClusterTooltipStyle = "s1fcgan";
24087
24100
  const NameLink = (props) => {
@@ -24569,7 +24582,7 @@ const DataKeysColumnRenderer = (i18n2) => {
24569
24582
  sortable: true
24570
24583
  };
24571
24584
  };
24572
- const PortMappingColumnRenderer = (i18n2) => {
24585
+ const PortMappingColumnRenderer = (i18n2, clusterVip) => {
24573
24586
  return {
24574
24587
  key: "displayPortMapping",
24575
24588
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
@@ -24590,8 +24603,9 @@ const PortMappingColumnRenderer = (i18n2) => {
24590
24603
  whiteSpace: "pre"
24591
24604
  },
24592
24605
  children: [record.displayType === "NodePort" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
24593
- href: `//${v.link}`,
24606
+ href: `//${clusterVip}:${v.nodePort}`,
24594
24607
  target: "_blank",
24608
+ className: "ciistgu",
24595
24609
  children: v.servicePort
24596
24610
  }) : v.servicePort, " ", "> ", v.targetPort, "/", v.protocol]
24597
24611
  }),
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b7, bL, A, aA, aC, ak, bn, aK, H, bB, bp, au, x, C, h, bP, an, aO, Z, bR, a1, a8, b_, ac, bq, bo, c1, aq, aU, v, ai, aZ, c0, bM, b1, D, aH, b3, b$, aI, ay, ba, bO, bQ, bz, al, a2, q, p, bS, I, aR, ax, s, br, bU, ap, aQ, ad, ae, U, af, aB, aj, a_, b2, V, M, bA, b6, N, J, c, az, Q, b9, aW, aV, bT, bl, f, bt, X, P, aM, t, _, bk, aJ, bY, bX, aF, aS, o, ao, aL, w, aT, aG, c5, bN, b4, bb, bc, am, R, a0, a6, a5, b5, a3, bZ, a4, a9, g, bG, bJ, bF, bE, bH, bI, bC, bu, bx, by, bw, bv, bs, bd, ar, aP, ag, l, bg, k, aD, c4, n, bh, aE, m, aw, aN, i, c3, at, av, aY, aX, as, S, b0, a$, c2, bD, bm, bi, bj, Y, bW, $, W, bV, a7, ab, aa, e, bK, ah, be, y, K, d, T, O, L, r, b, B, z, E, F, u, b8, G, bf, a } from "./index-7fe9ade3.js";
1
+ import { b7, bL, A, aA, aC, ak, bn, aK, H, bB, bp, au, x, C, h, bP, an, aO, Z, bR, a1, a8, b_, ac, bq, bo, c1, aq, aU, v, ai, aZ, c0, bM, b1, D, aH, b3, b$, aI, ay, ba, bO, bQ, bz, al, a2, q, p, bS, I, aR, ax, s, br, bU, ap, aQ, ad, ae, U, af, aB, aj, a_, b2, V, M, bA, b6, N, J, c, az, Q, b9, aW, aV, bT, bl, f, bt, X, P, aM, t, _, bk, aJ, bY, bX, aF, aS, o, ao, aL, w, aT, aG, c5, bN, b4, bb, bc, am, R, a0, a6, a5, b5, a3, bZ, a4, a9, g, bG, bJ, bF, bE, bH, bI, bC, bu, bx, by, bw, bv, bs, bd, ar, aP, ag, l, bg, k, aD, c4, n, bh, aE, m, aw, aN, i, c3, at, av, aY, aX, as, S, b0, a$, c2, bD, bm, bi, bj, Y, bW, $, W, bV, a7, ab, aa, e, bK, ah, be, y, K, d, T, O, L, r, b, B, z, E, F, u, b8, G, bf, a } from "./index-d2d0cacc.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "@cloudtower/icons-react";
@@ -1060,7 +1060,7 @@ var __publicField = (obj, key, value) => {
1060
1060
  const redeploy$1 = "Redeploy";
1061
1061
  const data$1 = "Data";
1062
1062
  const resume$1 = "Resume";
1063
- const sessionAffinity$1 = "会话保持";
1063
+ const sessionAffinity$1 = "Session Affinity";
1064
1064
  const log$1 = "Log";
1065
1065
  const ready$1 = "Ready";
1066
1066
  const updating$1 = "Updating";
@@ -1070,7 +1070,7 @@ var __publicField = (obj, key, value) => {
1070
1070
  const running$1 = "Running";
1071
1071
  const terminating$1 = "Terminating";
1072
1072
  const terminated$1 = "Terminated";
1073
- const succeeded$1 = "Succeed";
1073
+ const succeeded$1 = "Succeeded";
1074
1074
  const unknown$1 = "Unknown";
1075
1075
  const pending$1 = "Pending";
1076
1076
  const waiting$1 = "Waiting";
@@ -10022,6 +10022,7 @@ var __publicField = (obj, key, value) => {
10022
10022
  }
10023
10023
  return {
10024
10024
  servicePort: p.port,
10025
+ nodePort: p.nodePort,
10025
10026
  link,
10026
10027
  targetPort: p.targetPort,
10027
10028
  protocol: p.protocol
@@ -11405,7 +11406,7 @@ var __publicField = (obj, key, value) => {
11405
11406
  field: "",
11406
11407
  value: "",
11407
11408
  fn(item) {
11408
- return matchSelector(item, selector, item.metadata.namespace);
11409
+ return matchSelector(item, selector, namespace2);
11409
11410
  }
11410
11411
  }]
11411
11412
  }
@@ -23105,7 +23106,7 @@ var __publicField = (obj, key, value) => {
23105
23106
  ] }),
23106
23107
  errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsxs(kit.space, { className: ErrorWrapperStyle, size: 8, align: "start", children: [
23107
23108
  /* @__PURE__ */ jsxRuntimeExports.jsx(iconsReact.XmarkFailedSeriousWarningFill16RedIcon, { className: ErrorIconStyle }),
23108
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: ErrorMsgStyle, children: [
23109
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errorMsgs.map((errorMsg, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: ErrorMsgStyle, children: [
23109
23110
  errorMsgs.length > 1 ? `${index + 1}. ` : "",
23110
23111
  errorMsg
23111
23112
  ] }, errorMsg)) })
@@ -23539,17 +23540,28 @@ var __publicField = (obj, key, value) => {
23539
23540
  i18n: i18n2
23540
23541
  } = useTranslation();
23541
23542
  const FormWrapper = isShowLayout ? FormLayout : React.Fragment;
23543
+ const formWrapperProps = isShowLayout ? {
23544
+ saveButtonProps
23545
+ } : {};
23542
23546
  const schema = React.useMemo(() => {
23543
23547
  return editorProps.schema || {};
23544
23548
  }, [editorProps.schema]);
23545
23549
  const responseErrors = React.useMemo(() => errorResponseBody ? getCommonErrors(errorResponseBody, i18n2) : [], [errorResponseBody, i18n2]);
23546
23550
  const onFinish = React.useCallback(async (store) => {
23547
23551
  var _a, _b;
23548
- const result = await ((_a = formProps.onFinish) == null ? void 0 : _a.call(formProps, store));
23549
- if (result) {
23550
- (_b = props.onFinish) == null ? void 0 : _b.call(props);
23552
+ try {
23553
+ const result = await ((_a = formProps.onFinish) == null ? void 0 : _a.call(formProps, store));
23554
+ if (result) {
23555
+ (_b = props.onFinish) == null ? void 0 : _b.call(props);
23556
+ }
23557
+ } catch {
23558
+ } finally {
23559
+ onSaveButtonPropsChange == null ? void 0 : onSaveButtonPropsChange({
23560
+ ...saveButtonProps,
23561
+ loading: false
23562
+ });
23551
23563
  }
23552
- }, [formProps, props]);
23564
+ }, [formProps, props, saveButtonProps, onSaveButtonPropsChange]);
23553
23565
  React.useEffect(() => {
23554
23566
  onSaveButtonPropsChange == null ? void 0 : onSaveButtonPropsChange(saveButtonProps);
23555
23567
  }, [saveButtonProps, onSaveButtonPropsChange]);
@@ -23557,7 +23569,7 @@ var __publicField = (obj, key, value) => {
23557
23569
  onErrorsChange == null ? void 0 : onErrorsChange(responseErrors);
23558
23570
  }, [responseErrors, onErrorsChange]);
23559
23571
  return /* @__PURE__ */ jsxRuntimeExports.jsx(FormWrapper, {
23560
- saveButtonProps,
23572
+ ...formWrapperProps,
23561
23573
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.form, {
23562
23574
  ...formProps,
23563
23575
  initialValues: formProps.initialValues,
@@ -23671,9 +23683,10 @@ var __publicField = (obj, key, value) => {
23671
23683
  const saveButtonProps = isYamlForm ? yamlSaveButtonProps : refineFormResult.formResult.saveButtonProps;
23672
23684
  const onCancel = React.useCallback(() => {
23673
23685
  popModal();
23674
- }, []);
23686
+ }, [popModal]);
23675
23687
  const onOk = React.useCallback((e2) => {
23676
23688
  var _a2;
23689
+ setIsError(false);
23677
23690
  (_a2 = saveButtonProps.onClick) == null ? void 0 : _a2.call(saveButtonProps, e2);
23678
23691
  }, [saveButtonProps]);
23679
23692
  const errorText = (() => {
@@ -23702,11 +23715,11 @@ var __publicField = (obj, key, value) => {
23702
23715
  }) : "",
23703
23716
  okButtonProps: {
23704
23717
  ...saveButtonProps,
23705
- children: (_e = config.formConfig) == null ? void 0 : _e.saveButtonText
23718
+ children: (_e = config.formConfig) == null ? void 0 : _e.saveButtonText,
23719
+ onClick: onOk
23706
23720
  },
23707
23721
  closeIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(CloseCircleFilled$1, {}),
23708
23722
  okText,
23709
- onOk,
23710
23723
  onCancel,
23711
23724
  destroyOnClose: true,
23712
23725
  fullscreen: true,
@@ -24087,7 +24100,7 @@ var __publicField = (obj, key, value) => {
24087
24100
  children: result
24088
24101
  });
24089
24102
  };
24090
- const columns_qgyagz = "";
24103
+ const columns_1h38dp = "";
24091
24104
  const DashedTitleStyle = "dh5j833";
24092
24105
  const ServiceClusterTooltipStyle = "s1fcgan";
24093
24106
  const NameLink = (props) => {
@@ -24575,7 +24588,7 @@ var __publicField = (obj, key, value) => {
24575
24588
  sortable: true
24576
24589
  };
24577
24590
  };
24578
- const PortMappingColumnRenderer = (i18n2) => {
24591
+ const PortMappingColumnRenderer = (i18n2, clusterVip) => {
24579
24592
  return {
24580
24593
  key: "displayPortMapping",
24581
24594
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
@@ -24596,8 +24609,9 @@ var __publicField = (obj, key, value) => {
24596
24609
  whiteSpace: "pre"
24597
24610
  },
24598
24611
  children: [record.displayType === "NodePort" ? /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Link, {
24599
- href: `//${v.link}`,
24612
+ href: `//${clusterVip}:${v.nodePort}`,
24600
24613
  target: "_blank",
24614
+ className: "ciistgu",
24601
24615
  children: v.servicePort
24602
24616
  }) : v.servicePort, " ", "> ", v.targetPort, "/", v.protocol]
24603
24617
  }),
package/dist/style.css CHANGED
@@ -1541,6 +1541,7 @@
1541
1541
  .l25ca2k{padding:0 !important;}
1542
1542
  .dh5j833{border-bottom:1px dashed rgba(107,128,167,0.6);padding-bottom:1px;}
1543
1543
  .s1fcgan.ant-tooltip .ant-tooltip-inner{width:256px;}
1544
+ .ciistgu{padding:0 !important;}
1544
1545
  body,
1545
1546
  #root {
1546
1547
  height: 100%;
@@ -19,6 +19,9 @@ export interface YamlFormProps {
19
19
  onSaveButtonPropsChange?: (saveButtonProps: {
20
20
  disabled?: boolean;
21
21
  onClick: () => void;
22
+ loading?: boolean | {
23
+ delay?: number | undefined;
24
+ };
22
25
  }) => void;
23
26
  onErrorsChange?: (errors: string[]) => void;
24
27
  onFinish?: () => void;
@@ -32,4 +32,4 @@ export declare const IngressClassColumnRenderer: <Model extends IngressModel>(i1
32
32
  export declare const IngressTlsColumnRenderer: <Model extends IngressModel>(i18n: I18nType) => Column<Model>;
33
33
  export declare const PodContainersNumColumnRenderer: <Model extends PodModel>(i18n: I18nType) => Column<Model>;
34
34
  export declare const DataKeysColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType) => Column<Model>;
35
- export declare const PortMappingColumnRenderer: <Model extends ServiceModel>(i18n: I18nType) => Column<Model>;
35
+ export declare const PortMappingColumnRenderer: <Model extends ServiceModel>(i18n: I18nType, clusterVip: string) => Column<Model>;
@@ -17,6 +17,7 @@ export declare class ServiceModel extends ResourceModel<ServiceType> {
17
17
  get dnsRecord(): string;
18
18
  get displayPortMapping(): {
19
19
  servicePort: number;
20
+ nodePort: number | undefined;
20
21
  link: string;
21
22
  targetPort: string | number | undefined;
22
23
  protocol: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.52",
3
+ "version": "0.0.54",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",