@dovetail-v2/refine 0.1.17-alpha.4 → 0.1.17

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-b2236176.js";
1
+ import { j as jsxRuntimeExports } from "./index-809eef35.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -12,7 +12,7 @@ import { parse, stringify } from "qs";
12
12
  import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
13
13
  import { Typo, Tag, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$2, Pagination, Alert, usePopModal, Modal, usePushModal, Fields, Units, OverflowTooltip, Tooltip, StatusCapsule, Dropdown, Menu as Menu$1, Icon as Icon$1, Divider, Link as Link$1, Tabs as Tabs$1, TabsTabPane, Row, Col, Popover, AntdTable, TableForm, getOptions, DonutChart, SegmentControl, Checkbox, DropdownMenu, SearchInput, Token, AntdSelectOptGroup, MenuItemGroup, Layout as Layout$1, Time as Time$1, useMessage, ModalStack, KitStoreProvider, ConfigProvider } from "@cloudtower/eagle";
14
14
  import { EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, InfoICircleFill16GrayIcon, InfoICircleFill16Gray70Icon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, FontSize16GrayIcon, FontSize16BlueIcon, LogCollection16GrayIcon, LogCollection16GradientBlueIcon, TrashBinDeletePermanently16GrayIcon, TrashBinDeletePermanently16BlueIcon, Loading24GradientBlueIcon, OpenTerminal16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon, EditPen16BlueIcon } from "@cloudtower/icons-react";
15
- import { first, cloneDeep, set as set$1, omit as omit$1, merge, get as get$3, debounce, last, isObject as isObject$4, uniq, keyBy } from "lodash-es";
15
+ import { first, get as get$3, cloneDeep, set as set$1, omit as omit$1, merge, debounce, last, isObject as isObject$4, uniq, keyBy } from "lodash-es";
16
16
  import yaml$1 from "js-yaml";
17
17
  import { paginateData, sortData, dataProvider, liveProvider } from "k8s-api-provider";
18
18
  import * as monaco from "monaco-editor";
@@ -1168,6 +1168,7 @@ const failed_state$1 = "Failed";
1168
1168
  const exec_pod = "Execute shell";
1169
1169
  const search$1 = "Search";
1170
1170
  const edit_label$1 = "Edit label";
1171
+ const csi$1 = "CSI driver";
1171
1172
  const dovetail$1 = {
1172
1173
  copy: copy$2,
1173
1174
  reset_arguments: reset_arguments$1,
@@ -1338,7 +1339,8 @@ const dovetail$1 = {
1338
1339
  failed_state: failed_state$1,
1339
1340
  exec_pod,
1340
1341
  search: search$1,
1341
- edit_label: edit_label$1
1342
+ edit_label: edit_label$1,
1343
+ csi: csi$1
1342
1344
  };
1343
1345
  const EN = {
1344
1346
  dovetail: dovetail$1
@@ -1530,7 +1532,7 @@ const edit_annotation = "编辑注解";
1530
1532
  const edit_annotation_success_toast = "编辑资源 {{name}} 的注解成功";
1531
1533
  const pvc = "持久卷申领";
1532
1534
  const pv = "持久卷";
1533
- const csi = "CSI";
1535
+ const csi = "CSI driver";
1534
1536
  const retain = "保留";
1535
1537
  const default_sc = "默认存储类";
1536
1538
  const reclaim_policy = "回收策略";
@@ -9569,8 +9571,7 @@ const DistributeStorageForm = React__default.forwardRef(function DistributeStora
9569
9571
  },
9570
9572
  min: 1,
9571
9573
  meta: {},
9572
- suffix: "GiB",
9573
- controls: true
9574
+ suffix: "GiB"
9574
9575
  }
9575
9576
  )
9576
9577
  }
@@ -10817,6 +10818,9 @@ class PersistentVolumeClaimModel extends ResourceModel {
10817
10818
  return ResourceState.FAILED;
10818
10819
  }
10819
10820
  }
10821
+ get storageBytes() {
10822
+ return parseSi(get$3(this._rawYaml, "spec.resources.requests.storage") || "0Gi");
10823
+ }
10820
10824
  updateDistributeStorage(distributeStorage) {
10821
10825
  const yaml2 = cloneDeep(this._globalStore.restoreItem(this));
10822
10826
  return set$1(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
@@ -11724,6 +11728,7 @@ const ResourceLink = (props) => {
11724
11728
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
11725
11729
  className: LinkStyle,
11726
11730
  onClick,
11731
+ title: resourceId,
11727
11732
  children: resourceId
11728
11733
  });
11729
11734
  };
@@ -38426,7 +38431,7 @@ const Separator = () => {
38426
38431
  });
38427
38432
  };
38428
38433
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
38429
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-41c433a2.js"));
38434
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-bc29572d.js"));
38430
38435
  const YamlEditorComponent = forwardRef(
38431
38436
  function YamlEditorComponent2(props, ref) {
38432
38437
  const {
@@ -39333,6 +39338,9 @@ function FormModal(props) {
39333
39338
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39334
39339
  children: title
39335
39340
  }), !(isYamlForm || isDisabledChangeMode) ? /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentControl, {
39341
+ style: {
39342
+ fontWeight: "normal"
39343
+ },
39336
39344
  value: mode,
39337
39345
  options: [{
39338
39346
  value: "form",
@@ -40512,14 +40520,14 @@ const PVCStorageColumnRenderer = (i18n2) => {
40512
40520
  return {
40513
40521
  key: "storage",
40514
40522
  display: true,
40515
- dataIndex: ["spec", "resources", "requests", "storage"],
40523
+ dataIndex: ["storageBytes"],
40516
40524
  title: i18n2.t("dovetail.distributed"),
40517
40525
  width: 120,
40518
40526
  sortable: true,
40519
40527
  align: "right",
40520
40528
  render(value2) {
40521
40529
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, {
40522
- rawValue: parseSi(value2),
40530
+ rawValue: value2,
40523
40531
  decimals: 1
40524
40532
  });
40525
40533
  }
@@ -40532,7 +40540,14 @@ const PVRefColumnRenderer = (i18n2) => {
40532
40540
  dataIndex: ["pv"],
40533
40541
  title: i18n2.t("dovetail.pv"),
40534
40542
  width: 160,
40535
- sortable: true
40543
+ sortable: true,
40544
+ render(value2) {
40545
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
40546
+ resourceKind: "persistentvolumes",
40547
+ namespace: "",
40548
+ name: value2
40549
+ });
40550
+ }
40536
40551
  };
40537
40552
  };
40538
40553
  const PVStorageClassColumnRenderer = (i18n2) => {
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-b2236176.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-809eef35.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "react";
@@ -1174,6 +1174,7 @@ var __publicField = (obj, key, value) => {
1174
1174
  const exec_pod = "Execute shell";
1175
1175
  const search$1 = "Search";
1176
1176
  const edit_label$1 = "Edit label";
1177
+ const csi$1 = "CSI driver";
1177
1178
  const dovetail$1 = {
1178
1179
  copy: copy$2,
1179
1180
  reset_arguments: reset_arguments$1,
@@ -1344,7 +1345,8 @@ var __publicField = (obj, key, value) => {
1344
1345
  failed_state: failed_state$1,
1345
1346
  exec_pod,
1346
1347
  search: search$1,
1347
- edit_label: edit_label$1
1348
+ edit_label: edit_label$1,
1349
+ csi: csi$1
1348
1350
  };
1349
1351
  const EN = {
1350
1352
  dovetail: dovetail$1
@@ -1536,7 +1538,7 @@ var __publicField = (obj, key, value) => {
1536
1538
  const edit_annotation_success_toast = "编辑资源 {{name}} 的注解成功";
1537
1539
  const pvc = "持久卷申领";
1538
1540
  const pv = "持久卷";
1539
- const csi = "CSI";
1541
+ const csi = "CSI driver";
1540
1542
  const retain = "保留";
1541
1543
  const default_sc = "默认存储类";
1542
1544
  const reclaim_policy = "回收策略";
@@ -9575,8 +9577,7 @@ var __publicField = (obj, key, value) => {
9575
9577
  },
9576
9578
  min: 1,
9577
9579
  meta: {},
9578
- suffix: "GiB",
9579
- controls: true
9580
+ suffix: "GiB"
9580
9581
  }
9581
9582
  )
9582
9583
  }
@@ -10823,6 +10824,9 @@ var __publicField = (obj, key, value) => {
10823
10824
  return ResourceState.FAILED;
10824
10825
  }
10825
10826
  }
10827
+ get storageBytes() {
10828
+ return parseSi(lodashEs.get(this._rawYaml, "spec.resources.requests.storage") || "0Gi");
10829
+ }
10826
10830
  updateDistributeStorage(distributeStorage) {
10827
10831
  const yaml2 = lodashEs.cloneDeep(this._globalStore.restoreItem(this));
10828
10832
  return lodashEs.set(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
@@ -11730,6 +11734,7 @@ var __publicField = (obj, key, value) => {
11730
11734
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Link, {
11731
11735
  className: LinkStyle,
11732
11736
  onClick,
11737
+ title: resourceId,
11733
11738
  children: resourceId
11734
11739
  });
11735
11740
  };
@@ -39339,6 +39344,9 @@ WARNING: This link could potentially be dangerous`)) {
39339
39344
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39340
39345
  children: title
39341
39346
  }), !(isYamlForm || isDisabledChangeMode) ? /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.SegmentControl, {
39347
+ style: {
39348
+ fontWeight: "normal"
39349
+ },
39342
39350
  value: mode,
39343
39351
  options: [{
39344
39352
  value: "form",
@@ -40518,14 +40526,14 @@ WARNING: This link could potentially be dangerous`)) {
40518
40526
  return {
40519
40527
  key: "storage",
40520
40528
  display: true,
40521
- dataIndex: ["spec", "resources", "requests", "storage"],
40529
+ dataIndex: ["storageBytes"],
40522
40530
  title: i18n2.t("dovetail.distributed"),
40523
40531
  width: 120,
40524
40532
  sortable: true,
40525
40533
  align: "right",
40526
40534
  render(value2) {
40527
40535
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Units.Byte, {
40528
- rawValue: parseSi(value2),
40536
+ rawValue: value2,
40529
40537
  decimals: 1
40530
40538
  });
40531
40539
  }
@@ -40538,7 +40546,14 @@ WARNING: This link could potentially be dangerous`)) {
40538
40546
  dataIndex: ["pv"],
40539
40547
  title: i18n2.t("dovetail.pv"),
40540
40548
  width: 160,
40541
- sortable: true
40549
+ sortable: true,
40550
+ render(value2) {
40551
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
40552
+ resourceKind: "persistentvolumes",
40553
+ namespace: "",
40554
+ name: value2
40555
+ });
40556
+ }
40542
40557
  };
40543
40558
  };
40544
40559
  const PVStorageClassColumnRenderer = (i18n2) => {
package/lib/i18n.d.ts CHANGED
@@ -173,6 +173,7 @@ export declare const resources: {
173
173
  exec_pod: string;
174
174
  search: string;
175
175
  edit_label: string;
176
+ csi: string;
176
177
  };
177
178
  };
178
179
  'zh-CN': {
@@ -170,6 +170,7 @@ declare const _default: {
170
170
  exec_pod: string;
171
171
  search: string;
172
172
  edit_label: string;
173
+ csi: string;
173
174
  };
174
175
  };
175
176
  export default _default;
@@ -10,6 +10,7 @@ export declare class PersistentVolumeClaimModel extends ResourceModel {
10
10
  get phase(): string | undefined;
11
11
  get pv(): string | undefined;
12
12
  get stateDisplay(): ResourceState.FAILED | ResourceState.PENDING | ResourceState.BOUND | ResourceState.LOST | undefined;
13
+ get storageBytes(): number;
13
14
  updateDistributeStorage(distributeStorage: number): Unstructured;
14
15
  }
15
16
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.1.17-alpha.4",
3
+ "version": "0.1.17",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -1,18 +0,0 @@
1
- import { MetaQuery } from '@refinedev/core';
2
- import { IProviderPlugin, WatchEvent, GlobalStoreInitParams, Unstructured, UnstructuredList, CancelQueriesParams } from 'k8s-api-provider';
3
- export interface IGlobalStore {
4
- plugins: IProviderPlugin[];
5
- prefix?: string;
6
- fieldManager?: string;
7
- apiUrl: string;
8
- kubeApiTimeout: number | false | undefined;
9
- get<T = UnstructuredList>(resource: string, meta?: MetaQuery): Promise<T>;
10
- subscribe(resource: string, onEvent: (data: WatchEvent) => void): () => void;
11
- publish(resource: string, data: WatchEvent): void;
12
- init(params: GlobalStoreInitParams): void;
13
- loadPlugins(plugins?: IProviderPlugin[]): void;
14
- restoreItem(item: Unstructured): Unstructured;
15
- restoreData(list: UnstructuredList): UnstructuredList;
16
- destroy(): void;
17
- cancelQueries(params?: CancelQueriesParams): void;
18
- }