@dovetail-v2/refine 0.1.24 → 0.1.26

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-25d5f1c4.js";
1
+ import { j as jsxRuntimeExports } from "./index-042d724d.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -8516,13 +8516,15 @@ function isFirstLetterEnglish(str) {
8516
8516
  return /^[a-zA-Z]/.test(str);
8517
8517
  }
8518
8518
  function addSpaceBeforeLetter(str) {
8519
- return isFirstLetterEnglish(str) ? ` ${str}` : str;
8519
+ return isFirstLetterEnglish(str) ? ` ${str.toLocaleLowerCase()}` : str;
8520
8520
  }
8521
8521
  const useDeleteModal_mi8he5 = "";
8522
8522
  const TextStyle = "t1vq0ett";
8523
8523
  const TipStyle = "t139onst";
8524
8524
  const NameStyle$1 = "n18lzor8";
8525
- const useDeleteModal = (resource) => {
8525
+ const useDeleteModal = (resource, {
8526
+ deleteTip
8527
+ } = {}) => {
8526
8528
  const configs = useContext(ConfigsContext);
8527
8529
  const config = configs[resource];
8528
8530
  const {
@@ -8565,7 +8567,7 @@ const useDeleteModal = (resource) => {
8565
8567
  })
8566
8568
  }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
8567
8569
  className: cx_default(Typo.Label.l4_regular, TipStyle),
8568
- children: t2("dovetail.delete_tip")
8570
+ children: deleteTip || t2("dovetail.delete_tip")
8569
8571
  })]
8570
8572
  }),
8571
8573
  async onOk() {
@@ -9726,7 +9728,7 @@ function PVCDistributeStorage({ pvc: pvc2, editable }) {
9726
9728
  {
9727
9729
  modalProps: {
9728
9730
  formRef,
9729
- title: t2("dovetail.edit_replicas"),
9731
+ title: t2("dovetail.edit_distribute_storage"),
9730
9732
  renderContent() {
9731
9733
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9732
9734
  DistributeStorageForm,
@@ -11413,8 +11415,13 @@ function K8sDropdown(props) {
11413
11415
  const { globalStore } = useGlobalStore();
11414
11416
  const useResourceResult = useResource();
11415
11417
  const resource = useResourceResult.resource;
11418
+ const configs = useContext(ConfigsContext);
11419
+ const config = configs[(resource == null ? void 0 : resource.name) || ""];
11416
11420
  const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
11417
- (resource == null ? void 0 : resource.name) || ""
11421
+ (resource == null ? void 0 : resource.name) || "",
11422
+ {
11423
+ deleteTip: config.deleteTip
11424
+ }
11418
11425
  );
11419
11426
  const download2 = useDownloadYAML();
11420
11427
  const { t: t2 } = useTranslation();
@@ -11428,8 +11435,6 @@ function K8sDropdown(props) {
11428
11435
  resource: resource == null ? void 0 : resource.name,
11429
11436
  action: AccessControlAuth.Delete
11430
11437
  });
11431
- const configs = useContext(ConfigsContext);
11432
- const config = configs[(resource == null ? void 0 : resource.name) || ""];
11433
11438
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11434
11439
  /* @__PURE__ */ jsxRuntimeExports.jsx(
11435
11440
  Dropdown,
@@ -12914,6 +12919,7 @@ const WorkloadPodsTable_975j2t = "";
12914
12919
  const WorkloadPodsTable = ({
12915
12920
  namespace: namespace2,
12916
12921
  selector,
12922
+ className,
12917
12923
  hideToolbar,
12918
12924
  filter,
12919
12925
  hideNodeColumn
@@ -12968,7 +12974,7 @@ const WorkloadPodsTable = ({
12968
12974
  }
12969
12975
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, {
12970
12976
  direction: "vertical",
12971
- className: "c1dicff8",
12977
+ className: cx_default("c1dicff8", className),
12972
12978
  children: [hideToolbar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
12973
12979
  selectedKeys,
12974
12980
  hideCreate: true
@@ -13098,8 +13104,8 @@ function WorkloadReplicas({
13098
13104
  data: donutData,
13099
13105
  width: 70,
13100
13106
  height: 70,
13101
- innerRadius: 26,
13102
- outerRadius: 32,
13107
+ innerRadius: 28,
13108
+ outerRadius: 34,
13103
13109
  centerRender: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
13104
13110
  className: DonutChartCenterStyle,
13105
13111
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
@@ -33569,6 +33575,11 @@ const Shell = React__default.forwardRef(function Shell2(props, ref) {
33569
33575
  var _a;
33570
33576
  (_a = termInstanceRef.current) == null ? void 0 : _a.writeln(data2);
33571
33577
  }, []);
33578
+ const onClear = useCallback(() => {
33579
+ var _a;
33580
+ clear();
33581
+ (_a = props.onClear) == null ? void 0 : _a.call(props);
33582
+ }, [clear, props.onClear]);
33572
33583
  useEffect(() => {
33573
33584
  const destroy = setupTerminal();
33574
33585
  return () => {
@@ -33636,7 +33647,7 @@ const Shell = React__default.forwardRef(function Shell2(props, ref) {
33636
33647
  operations,
33637
33648
  onSearchNext: searchNext,
33638
33649
  onSearchPre: searchPrevious,
33639
- onClear: clear,
33650
+ onClear,
33640
33651
  onDownloadLog: downloadContent,
33641
33652
  onSetFontSize: (fontSize) => {
33642
33653
  setOptions({
@@ -38612,7 +38623,7 @@ const Separator = () => {
38612
38623
  });
38613
38624
  };
38614
38625
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
38615
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-cb7ba6ca.js"));
38626
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-e2011bb6.js"));
38616
38627
  const YamlEditorComponent = forwardRef(
38617
38628
  function YamlEditorComponent2(props, ref) {
38618
38629
  const {
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bN, cC, A, aW, aY, aF, ca, bk, a1, co, cc, aQ, T, C, i, cG, aI, bp, ac, cI, ai, ap, cR, ax, cd, cb, cU, aM, bw, w, aD, bD, cT, cD, bG, D, b1, as, bJ, ar, at, a0, c9, c8, cS, bi, aU, ad, bQ, cF, cH, cm, aG, aj, s, q, cJ, I, bt, aT, t, M, be, bg, ce, cL, aL, bs, aq, ay, az, a8, aA, aX, aE, bE, bH, a9, d2, cn, cx, bM, N, a2, e, aV, a6, bP, by, bx, cK, b$, cZ, g, cY, aJ, bq, cg, L, ba, bb, bo, H, bc, J, bd, B, b5, cA, z, b4, G, b8, E, b6, F, b7, K, c0, b9, cz, aa, d0, c$, P, bm, v, ae, ah, b_, bj, cP, cO, a$, bu, c6, c5, p, aK, bl, x, bv, b0, d1, y, cq, cE, bK, bR, bS, d4, aH, R, ag, an, am, bL, ak, cQ, c2, al, cB, c7, bh, bA, au, h, Q, O, bf, ct, cw, cs, cr, cu, cv, cp, ch, ck, cl, cj, ci, cf, cy, bT, aN, br, aB, m, bW, l, aZ, cX, o, bX, a_, n, aS, bn, k, cW, aP, aR, c4, bC, bB, c3, aO, S, bF, cV, c_, b2, b3, bz, bI, c1, bY, bZ, ab, $, cN, af, W, cM, ao, aw, av, f, aC, bU, U, a3, d, d7, d6, d9, d3, a7, da, d5, d8, a5, a4, r, a, c, X, V, Y, Z, u, bO, _, bV, b } from "./index-25d5f1c4.js";
1
+ import { bN, cC, A, aW, aY, aF, ca, bk, a1, co, cc, aQ, T, C, i, cG, aI, bp, ac, cI, ai, ap, cR, ax, cd, cb, cU, aM, bw, w, aD, bD, cT, cD, bG, D, b1, as, bJ, ar, at, a0, c9, c8, cS, bi, aU, ad, bQ, cF, cH, cm, aG, aj, s, q, cJ, I, bt, aT, t, M, be, bg, ce, cL, aL, bs, aq, ay, az, a8, aA, aX, aE, bE, bH, a9, d2, cn, cx, bM, N, a2, e, aV, a6, bP, by, bx, cK, b$, cZ, g, cY, aJ, bq, cg, L, ba, bb, bo, H, bc, J, bd, B, b5, cA, z, b4, G, b8, E, b6, F, b7, K, c0, b9, cz, aa, d0, c$, P, bm, v, ae, ah, b_, bj, cP, cO, a$, bu, c6, c5, p, aK, bl, x, bv, b0, d1, y, cq, cE, bK, bR, bS, d4, aH, R, ag, an, am, bL, ak, cQ, c2, al, cB, c7, bh, bA, au, h, Q, O, bf, ct, cw, cs, cr, cu, cv, cp, ch, ck, cl, cj, ci, cf, cy, bT, aN, br, aB, m, bW, l, aZ, cX, o, bX, a_, n, aS, bn, k, cW, aP, aR, c4, bC, bB, c3, aO, S, bF, cV, c_, b2, b3, bz, bI, c1, bY, bZ, ab, $, cN, af, W, cM, ao, aw, av, f, aC, bU, U, a3, d, d7, d6, d9, d3, a7, da, d5, d8, a5, a4, r, a, c, X, V, Y, Z, u, bO, _, bV, b } from "./index-042d724d.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "react";
@@ -8522,13 +8522,15 @@ var __publicField = (obj, key, value) => {
8522
8522
  return /^[a-zA-Z]/.test(str);
8523
8523
  }
8524
8524
  function addSpaceBeforeLetter(str) {
8525
- return isFirstLetterEnglish(str) ? ` ${str}` : str;
8525
+ return isFirstLetterEnglish(str) ? ` ${str.toLocaleLowerCase()}` : str;
8526
8526
  }
8527
8527
  const useDeleteModal_mi8he5 = "";
8528
8528
  const TextStyle = "t1vq0ett";
8529
8529
  const TipStyle = "t139onst";
8530
8530
  const NameStyle$1 = "n18lzor8";
8531
- const useDeleteModal = (resource) => {
8531
+ const useDeleteModal = (resource, {
8532
+ deleteTip
8533
+ } = {}) => {
8532
8534
  const configs = React.useContext(ConfigsContext);
8533
8535
  const config = configs[resource];
8534
8536
  const {
@@ -8571,7 +8573,7 @@ var __publicField = (obj, key, value) => {
8571
8573
  })
8572
8574
  }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
8573
8575
  className: cx_default(eagle.Typo.Label.l4_regular, TipStyle),
8574
- children: t2("dovetail.delete_tip")
8576
+ children: deleteTip || t2("dovetail.delete_tip")
8575
8577
  })]
8576
8578
  }),
8577
8579
  async onOk() {
@@ -9732,7 +9734,7 @@ var __publicField = (obj, key, value) => {
9732
9734
  {
9733
9735
  modalProps: {
9734
9736
  formRef,
9735
- title: t2("dovetail.edit_replicas"),
9737
+ title: t2("dovetail.edit_distribute_storage"),
9736
9738
  renderContent() {
9737
9739
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9738
9740
  DistributeStorageForm,
@@ -11419,8 +11421,13 @@ var __publicField = (obj, key, value) => {
11419
11421
  const { globalStore } = useGlobalStore();
11420
11422
  const useResourceResult = core.useResource();
11421
11423
  const resource = useResourceResult.resource;
11424
+ const configs = React.useContext(ConfigsContext);
11425
+ const config = configs[(resource == null ? void 0 : resource.name) || ""];
11422
11426
  const { modalProps, visible, openDeleteConfirmModal } = useDeleteModal(
11423
- (resource == null ? void 0 : resource.name) || ""
11427
+ (resource == null ? void 0 : resource.name) || "",
11428
+ {
11429
+ deleteTip: config.deleteTip
11430
+ }
11424
11431
  );
11425
11432
  const download2 = useDownloadYAML();
11426
11433
  const { t: t2 } = useTranslation();
@@ -11434,8 +11441,6 @@ var __publicField = (obj, key, value) => {
11434
11441
  resource: resource == null ? void 0 : resource.name,
11435
11442
  action: AccessControlAuth.Delete
11436
11443
  });
11437
- const configs = React.useContext(ConfigsContext);
11438
- const config = configs[(resource == null ? void 0 : resource.name) || ""];
11439
11444
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11440
11445
  /* @__PURE__ */ jsxRuntimeExports.jsx(
11441
11446
  eagle.Dropdown,
@@ -12920,6 +12925,7 @@ var __publicField = (obj, key, value) => {
12920
12925
  const WorkloadPodsTable = ({
12921
12926
  namespace: namespace2,
12922
12927
  selector,
12928
+ className,
12923
12929
  hideToolbar,
12924
12930
  filter,
12925
12931
  hideNodeColumn
@@ -12974,7 +12980,7 @@ var __publicField = (obj, key, value) => {
12974
12980
  }
12975
12981
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(eagle.Space, {
12976
12982
  direction: "vertical",
12977
- className: "c1dicff8",
12983
+ className: cx_default("c1dicff8", className),
12978
12984
  children: [hideToolbar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
12979
12985
  selectedKeys,
12980
12986
  hideCreate: true
@@ -13104,8 +13110,8 @@ var __publicField = (obj, key, value) => {
13104
13110
  data: donutData,
13105
13111
  width: 70,
13106
13112
  height: 70,
13107
- innerRadius: 26,
13108
- outerRadius: 32,
13113
+ innerRadius: 28,
13114
+ outerRadius: 34,
13109
13115
  centerRender: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
13110
13116
  className: DonutChartCenterStyle,
13111
13117
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
@@ -33575,6 +33581,11 @@ WARNING: This link could potentially be dangerous`)) {
33575
33581
  var _a;
33576
33582
  (_a = termInstanceRef.current) == null ? void 0 : _a.writeln(data2);
33577
33583
  }, []);
33584
+ const onClear = React.useCallback(() => {
33585
+ var _a;
33586
+ clear();
33587
+ (_a = props.onClear) == null ? void 0 : _a.call(props);
33588
+ }, [clear, props.onClear]);
33578
33589
  React.useEffect(() => {
33579
33590
  const destroy = setupTerminal();
33580
33591
  return () => {
@@ -33642,7 +33653,7 @@ WARNING: This link could potentially be dangerous`)) {
33642
33653
  operations,
33643
33654
  onSearchNext: searchNext,
33644
33655
  onSearchPre: searchPrevious,
33645
- onClear: clear,
33656
+ onClear,
33646
33657
  onDownloadLog: downloadContent,
33647
33658
  onSetFontSize: (fontSize) => {
33648
33659
  setOptions({
@@ -27,6 +27,7 @@ export type ShellProps = React.PropsWithChildren<{
27
27
  onReconnect?: () => void;
28
28
  onSocketInit?: (socket: WebSocket) => void;
29
29
  onTermInit?: (term: Terminal) => void;
30
+ onClear?: () => void;
30
31
  onSocketMessage?: (e: MessageEvent, socket: WebSocket, term: Terminal | null) => void;
31
32
  onSocketOpen?: (socket: WebSocket) => void;
32
33
  onSocketClose?: (socket: WebSocket, term: Terminal | null) => void;
@@ -66,6 +67,7 @@ export declare const Shell: React.ForwardRefExoticComponent<{
66
67
  onReconnect?: (() => void) | undefined;
67
68
  onSocketInit?: ((socket: WebSocket) => void) | undefined;
68
69
  onTermInit?: ((term: Terminal) => void) | undefined;
70
+ onClear?: (() => void) | undefined;
69
71
  onSocketMessage?: ((e: MessageEvent, socket: WebSocket, term: Terminal | null) => void) | undefined;
70
72
  onSocketOpen?: ((socket: WebSocket) => void) | undefined;
71
73
  onSocketClose?: ((socket: WebSocket, term: Terminal | null) => void) | undefined;
@@ -2,6 +2,7 @@ import { LabelSelector } from 'kubernetes-types/meta/v1';
2
2
  import React from 'react';
3
3
  import { PodModel } from '../../models';
4
4
  interface WorkloadPodsTableProps {
5
+ className?: string;
5
6
  namespace?: string;
6
7
  selector?: LabelSelector;
7
8
  filter?: (item: PodModel) => boolean;
@@ -1,5 +1,8 @@
1
1
  import { ModalProps } from '@cloudtower/eagle';
2
- export declare const useDeleteModal: (resource: string) => {
2
+ import React from 'react';
3
+ export declare const useDeleteModal: (resource: string, { deleteTip }?: {
4
+ deleteTip?: React.ReactNode;
5
+ }) => {
3
6
  modalProps: ModalProps;
4
7
  visible: boolean;
5
8
  openDeleteConfirmModal: (id: string) => void;
@@ -46,6 +46,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
46
46
  tableProps?: Partial<InternalTableProps<Model>>;
47
47
  isCustom?: boolean;
48
48
  createButtonText?: string;
49
+ deleteTip?: string;
49
50
  formConfig?: {
50
51
  fields?: (props: {
51
52
  record?: Model;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",