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

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-ae8ef32a.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
  }
@@ -10793,6 +10794,9 @@ class PersistentVolumeModel extends ResourceModel {
10793
10794
  var _a;
10794
10795
  return (_a = this._rawYaml.spec.claimRef) == null ? void 0 : _a.namespace;
10795
10796
  }
10797
+ get storageBytes() {
10798
+ return parseSi(get$3(this._rawYaml, ["spec", "capacity", "storage"]));
10799
+ }
10796
10800
  }
10797
10801
  class PersistentVolumeClaimModel extends ResourceModel {
10798
10802
  constructor(_rawYaml, _globalStore) {
@@ -10817,6 +10821,9 @@ class PersistentVolumeClaimModel extends ResourceModel {
10817
10821
  return ResourceState.FAILED;
10818
10822
  }
10819
10823
  }
10824
+ get storageBytes() {
10825
+ return parseSi(get$3(this._rawYaml, "spec.resources.requests.storage") || "0Gi");
10826
+ }
10820
10827
  updateDistributeStorage(distributeStorage) {
10821
10828
  const yaml2 = cloneDeep(this._globalStore.restoreItem(this));
10822
10829
  return set$1(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
@@ -11721,10 +11728,13 @@ const ResourceLink = (props) => {
11721
11728
  }
11722
11729
  });
11723
11730
  };
11724
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
11731
+ return resourceId ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
11725
11732
  className: LinkStyle,
11726
11733
  onClick,
11734
+ title: resourceId,
11727
11735
  children: resourceId
11736
+ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
11737
+ value: ""
11728
11738
  });
11729
11739
  };
11730
11740
  const IngressRulesTable = ({ ingress }) => {
@@ -38426,7 +38436,7 @@ const Separator = () => {
38426
38436
  });
38427
38437
  };
38428
38438
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
38429
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-41c433a2.js"));
38439
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-139710b4.js"));
38430
38440
  const YamlEditorComponent = forwardRef(
38431
38441
  function YamlEditorComponent2(props, ref) {
38432
38442
  const {
@@ -39333,6 +39343,9 @@ function FormModal(props) {
39333
39343
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39334
39344
  children: title
39335
39345
  }), !(isYamlForm || isDisabledChangeMode) ? /* @__PURE__ */ jsxRuntimeExports.jsx(SegmentControl, {
39346
+ style: {
39347
+ fontWeight: "normal"
39348
+ },
39336
39349
  value: mode,
39337
39350
  options: [{
39338
39351
  value: "form",
@@ -40495,15 +40508,15 @@ const PVCapacityColumnRenderer = (i18n2) => {
40495
40508
  return {
40496
40509
  key: "capacity",
40497
40510
  display: true,
40498
- dataIndex: ["spec", "capacity", "storage"],
40511
+ dataIndex: ["storageBytes"],
40499
40512
  title: i18n2.t("dovetail.capacity"),
40500
40513
  width: 120,
40501
40514
  sortable: true,
40502
40515
  align: "right",
40503
40516
  render(value2) {
40504
40517
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, {
40505
- rawValue: parseSi(value2),
40506
- decimals: 1
40518
+ rawValue: value2,
40519
+ decimals: 2
40507
40520
  });
40508
40521
  }
40509
40522
  };
@@ -40512,14 +40525,14 @@ const PVCStorageColumnRenderer = (i18n2) => {
40512
40525
  return {
40513
40526
  key: "storage",
40514
40527
  display: true,
40515
- dataIndex: ["spec", "resources", "requests", "storage"],
40528
+ dataIndex: ["storageBytes"],
40516
40529
  title: i18n2.t("dovetail.distributed"),
40517
40530
  width: 120,
40518
40531
  sortable: true,
40519
40532
  align: "right",
40520
40533
  render(value2) {
40521
40534
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, {
40522
- rawValue: parseSi(value2),
40535
+ rawValue: value2,
40523
40536
  decimals: 1
40524
40537
  });
40525
40538
  }
@@ -40532,7 +40545,14 @@ const PVRefColumnRenderer = (i18n2) => {
40532
40545
  dataIndex: ["pv"],
40533
40546
  title: i18n2.t("dovetail.pv"),
40534
40547
  width: 160,
40535
- sortable: true
40548
+ sortable: true,
40549
+ render(value2) {
40550
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
40551
+ resourceKind: "persistentvolumes",
40552
+ namespace: "",
40553
+ name: value2
40554
+ });
40555
+ }
40536
40556
  };
40537
40557
  };
40538
40558
  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-ae8ef32a.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
  }
@@ -10799,6 +10800,9 @@ var __publicField = (obj, key, value) => {
10799
10800
  var _a;
10800
10801
  return (_a = this._rawYaml.spec.claimRef) == null ? void 0 : _a.namespace;
10801
10802
  }
10803
+ get storageBytes() {
10804
+ return parseSi(lodashEs.get(this._rawYaml, ["spec", "capacity", "storage"]));
10805
+ }
10802
10806
  }
10803
10807
  class PersistentVolumeClaimModel extends ResourceModel {
10804
10808
  constructor(_rawYaml, _globalStore) {
@@ -10823,6 +10827,9 @@ var __publicField = (obj, key, value) => {
10823
10827
  return ResourceState.FAILED;
10824
10828
  }
10825
10829
  }
10830
+ get storageBytes() {
10831
+ return parseSi(lodashEs.get(this._rawYaml, "spec.resources.requests.storage") || "0Gi");
10832
+ }
10826
10833
  updateDistributeStorage(distributeStorage) {
10827
10834
  const yaml2 = lodashEs.cloneDeep(this._globalStore.restoreItem(this));
10828
10835
  return lodashEs.set(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
@@ -11727,10 +11734,13 @@ var __publicField = (obj, key, value) => {
11727
11734
  }
11728
11735
  });
11729
11736
  };
11730
- return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Link, {
11737
+ return resourceId ? /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Link, {
11731
11738
  className: LinkStyle,
11732
11739
  onClick,
11740
+ title: resourceId,
11733
11741
  children: resourceId
11742
+ }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
11743
+ value: ""
11734
11744
  });
11735
11745
  };
11736
11746
  const IngressRulesTable = ({ ingress }) => {
@@ -39339,6 +39349,9 @@ WARNING: This link could potentially be dangerous`)) {
39339
39349
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39340
39350
  children: title
39341
39351
  }), !(isYamlForm || isDisabledChangeMode) ? /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.SegmentControl, {
39352
+ style: {
39353
+ fontWeight: "normal"
39354
+ },
39342
39355
  value: mode,
39343
39356
  options: [{
39344
39357
  value: "form",
@@ -40501,15 +40514,15 @@ WARNING: This link could potentially be dangerous`)) {
40501
40514
  return {
40502
40515
  key: "capacity",
40503
40516
  display: true,
40504
- dataIndex: ["spec", "capacity", "storage"],
40517
+ dataIndex: ["storageBytes"],
40505
40518
  title: i18n2.t("dovetail.capacity"),
40506
40519
  width: 120,
40507
40520
  sortable: true,
40508
40521
  align: "right",
40509
40522
  render(value2) {
40510
40523
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Units.Byte, {
40511
- rawValue: parseSi(value2),
40512
- decimals: 1
40524
+ rawValue: value2,
40525
+ decimals: 2
40513
40526
  });
40514
40527
  }
40515
40528
  };
@@ -40518,14 +40531,14 @@ WARNING: This link could potentially be dangerous`)) {
40518
40531
  return {
40519
40532
  key: "storage",
40520
40533
  display: true,
40521
- dataIndex: ["spec", "resources", "requests", "storage"],
40534
+ dataIndex: ["storageBytes"],
40522
40535
  title: i18n2.t("dovetail.distributed"),
40523
40536
  width: 120,
40524
40537
  sortable: true,
40525
40538
  align: "right",
40526
40539
  render(value2) {
40527
40540
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Units.Byte, {
40528
- rawValue: parseSi(value2),
40541
+ rawValue: value2,
40529
40542
  decimals: 1
40530
40543
  });
40531
40544
  }
@@ -40538,7 +40551,14 @@ WARNING: This link could potentially be dangerous`)) {
40538
40551
  dataIndex: ["pv"],
40539
40552
  title: i18n2.t("dovetail.pv"),
40540
40553
  width: 160,
40541
- sortable: true
40554
+ sortable: true,
40555
+ render(value2) {
40556
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
40557
+ resourceKind: "persistentvolumes",
40558
+ namespace: "",
40559
+ name: value2
40560
+ });
40561
+ }
40542
40562
  };
40543
40563
  };
40544
40564
  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 {};
@@ -12,5 +12,6 @@ export declare class PersistentVolumeModel extends ResourceModel {
12
12
  get csi(): string | undefined;
13
13
  get pvc(): string | undefined;
14
14
  get pvcNamespace(): string | undefined;
15
+ get storageBytes(): number;
15
16
  }
16
17
  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.18-alpha.0",
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
- }