@dovetail-v2/refine 0.3.28-alpha.1 → 0.3.29-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.
@@ -9,12 +9,12 @@ interface K8sDropdownProps {
9
9
  customButton?: React.ReactNode;
10
10
  resourceConfig?: Pick<ResourceConfig, 'name' | 'displayName' | 'kind' | 'initValue' | 'apiVersion' | 'basePath' | 'formConfig' | 'hideEdit'>;
11
11
  deleteDialogProps?: Partial<DeleteDialogProps>;
12
- /**
13
- * 为 true 时跳过基于路由上下文的操作隐藏逻辑,始终显示全部操作按钮(编辑、编辑 YAML、下载 YAML)。
14
- * 适用于在详情页或表单中嵌套渲染的子资源列表(如 AccessMethodForm 中的 Service/Ingress),
15
- * 这些场景下子资源需要独立的编辑和下载能力,不应被父资源详情页的隐藏规则影响。
16
- */
17
- forceShowAllActions?: boolean;
12
+ /** 隐藏「编辑」按钮 */
13
+ hideEdit?: boolean;
14
+ /** 隐藏「编辑 YAML」按钮 */
15
+ hideEditYaml?: boolean;
16
+ /** 隐藏「下载 YAML」按钮 */
17
+ hideDownloadYaml?: boolean;
18
18
  }
19
19
  export declare function K8sDropdown(props: React.PropsWithChildren<K8sDropdownProps>): JSX.Element;
20
20
  export default K8sDropdown;
package/dist/i18n.d.ts CHANGED
@@ -201,9 +201,9 @@ export declare const resources: {
201
201
  default_sc: string;
202
202
  reclaim_policy: string;
203
203
  allow_expand: string;
204
- edit_distribute_storage: string;
205
- edit_distribute_storage_success_toast: string;
206
- edit_distribute_storage_failed_toast: string;
204
+ request_capacity: string;
205
+ edit_request_capacity: string;
206
+ edit_request_capacity_success_toast: string;
207
207
  edit_taint: string;
208
208
  edit_node_taint: string;
209
209
  edit_node_taint_success_toast: string;
@@ -478,9 +478,9 @@ export declare const resources: {
478
478
  default_sc: string;
479
479
  reclaim_policy: string;
480
480
  allow_expand: string;
481
- edit_distribute_storage: string;
482
- edit_distribute_storage_success_toast: string;
483
- edit_distribute_storage_failed_toast: string;
481
+ request_capacity: string;
482
+ edit_request_capacity: string;
483
+ edit_request_capacity_success_toast: string;
484
484
  edit_taint: string;
485
485
  edit_node_taint: string;
486
486
  edit_node_taint_success_toast: string;
@@ -198,9 +198,9 @@ declare const _default: {
198
198
  default_sc: string;
199
199
  reclaim_policy: string;
200
200
  allow_expand: string;
201
- edit_distribute_storage: string;
202
- edit_distribute_storage_success_toast: string;
203
- edit_distribute_storage_failed_toast: string;
201
+ request_capacity: string;
202
+ edit_request_capacity: string;
203
+ edit_request_capacity_success_toast: string;
204
204
  edit_taint: string;
205
205
  edit_node_taint: string;
206
206
  edit_node_taint_success_toast: string;
@@ -196,9 +196,9 @@ declare const _default: {
196
196
  default_sc: string;
197
197
  reclaim_policy: string;
198
198
  allow_expand: string;
199
- edit_distribute_storage: string;
200
- edit_distribute_storage_success_toast: string;
201
- edit_distribute_storage_failed_toast: string;
199
+ request_capacity: string;
200
+ edit_request_capacity: string;
201
+ edit_request_capacity_success_toast: string;
202
202
  edit_taint: string;
203
203
  edit_node_taint: string;
204
204
  edit_node_taint_success_toast: string;
@@ -11,6 +11,7 @@ export declare class PersistentVolumeClaimModel extends ResourceModel {
11
11
  get pv(): string | undefined;
12
12
  get stateDisplay(): ResourceState.FAILED | ResourceState.PENDING | ResourceState.BOUND | ResourceState.LOST | undefined;
13
13
  get storageBytes(): number;
14
+ get allocatedStorageBytes(): number;
14
15
  updateDistributeStorage(distributeStorage: number): Unstructured;
15
16
  }
16
17
  export {};
package/dist/refine.cjs CHANGED
@@ -655,9 +655,9 @@ const retain$1 = "Retain";
655
655
  const default_sc$1 = "Default storage class";
656
656
  const reclaim_policy$1 = "Reclaim policy";
657
657
  const allow_expand$1 = "Volume expansion";
658
- const edit_distribute_storage$1 = "Edit capacity allocation";
659
- const edit_distribute_storage_success_toast$1 = "Successfully edited the capacity allocation";
660
- const edit_distribute_storage_failed_toast$1 = "Failed to edit the capacity allocation";
658
+ const request_capacity$1 = "Request capacity";
659
+ const edit_request_capacity$1 = "Edit request capacity";
660
+ const edit_request_capacity_success_toast$1 = "Successfully edited request capacity";
661
661
  const edit_taint$1 = "Edit taint";
662
662
  const edit_node_taint$1 = "Edit taint";
663
663
  const edit_node_taint_success_toast$1 = "Successfully edited the taint for the node {{name}}";
@@ -666,10 +666,10 @@ const node_taint_PreferNoSchedule$1 = "PreferNoSchedule";
666
666
  const node_taint_NoExecute$1 = "NoExecute";
667
667
  const taint$1 = "Taint";
668
668
  const change_form_mode_alert$1 = "Switching from YAML editing to form editing will discard all changes made to the YAML file.";
669
- const pvc_storage_required$1 = "Please specify the allocation.";
669
+ const pvc_storage_required$1 = "Please specify the request capacity.";
670
670
  const pvc_storage_min$1 = "Please enter a positive integer.";
671
671
  const pvc_storage_reduce_limit$1 = "The value cannot be less than the current value.";
672
- const pvc_storage_max_limit$1 = "The allocation cannot exceed 64 TiB.";
672
+ const pvc_storage_max_limit$1 = "The request capacity cannot exceed 64 TiB.";
673
673
  const key_empty_text$1 = "Please specify a key.";
674
674
  const format_error$1 = "Format error.";
675
675
  const taint_effect_empty_text$1 = "Please select an effect.";
@@ -931,9 +931,9 @@ const dovetail$1 = {
931
931
  default_sc: default_sc$1,
932
932
  reclaim_policy: reclaim_policy$1,
933
933
  allow_expand: allow_expand$1,
934
- edit_distribute_storage: edit_distribute_storage$1,
935
- edit_distribute_storage_success_toast: edit_distribute_storage_success_toast$1,
936
- edit_distribute_storage_failed_toast: edit_distribute_storage_failed_toast$1,
934
+ request_capacity: request_capacity$1,
935
+ edit_request_capacity: edit_request_capacity$1,
936
+ edit_request_capacity_success_toast: edit_request_capacity_success_toast$1,
937
937
  edit_taint: edit_taint$1,
938
938
  edit_node_taint: edit_node_taint$1,
939
939
  edit_node_taint_success_toast: edit_node_taint_success_toast$1,
@@ -1205,9 +1205,9 @@ const retain = "保留";
1205
1205
  const default_sc = "默认存储类";
1206
1206
  const reclaim_policy = "回收策略";
1207
1207
  const allow_expand = "卷扩容";
1208
- const edit_distribute_storage = "编辑分配量";
1209
- const edit_distribute_storage_success_toast = "编辑分配量成功";
1210
- const edit_distribute_storage_failed_toast = "编辑分配量失败";
1208
+ const request_capacity = "申请量";
1209
+ const edit_request_capacity = "编辑申请量";
1210
+ const edit_request_capacity_success_toast = "编辑申请量成功";
1211
1211
  const edit_taint = "编辑污点";
1212
1212
  const edit_node_taint = "编辑污点";
1213
1213
  const edit_node_taint_success_toast = "编辑节点 {{name}} 的污点成功";
@@ -1216,10 +1216,10 @@ const node_taint_PreferNoSchedule = "尽可能阻止调度";
1216
1216
  const node_taint_NoExecute = "阻止调度并驱逐 Pod";
1217
1217
  const taint = "污点";
1218
1218
  const change_form_mode_alert = "从编辑 YAML 切回表单编辑,将无法保留对 YAML 文件做出的所有更改。";
1219
- const pvc_storage_required = "请填写分配量。";
1219
+ const pvc_storage_required = "请填写申请量。";
1220
1220
  const pvc_storage_min = "请输入正整数。";
1221
1221
  const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1222
- const pvc_storage_max_limit = "分配量不能超过 64 TiB。";
1222
+ const pvc_storage_max_limit = "申请量不能超过 64 TiB。";
1223
1223
  const key_empty_text = "请填写键。";
1224
1224
  const format_error = "格式错误。";
1225
1225
  const taint_effect_empty_text = "请选择效果。";
@@ -1480,9 +1480,9 @@ const dovetail = {
1480
1480
  default_sc,
1481
1481
  reclaim_policy,
1482
1482
  allow_expand,
1483
- edit_distribute_storage,
1484
- edit_distribute_storage_success_toast,
1485
- edit_distribute_storage_failed_toast,
1483
+ request_capacity,
1484
+ edit_request_capacity,
1485
+ edit_request_capacity_success_toast,
1486
1486
  edit_taint,
1487
1487
  edit_node_taint,
1488
1488
  edit_node_taint_success_toast,
@@ -7646,7 +7646,6 @@ function ValueDisplay(props) {
7646
7646
  } = props;
7647
7647
  const htmlTitle = typeof value2 === "string" || typeof value2 === "number" ? String(value2) : void 0;
7648
7648
  const result = useOverflow ? /* @__PURE__ */ common.jsxRuntimeExports.jsx("div", {
7649
- title: htmlTitle,
7650
7649
  style,
7651
7650
  className: common.cx_default(className, ContentStyle$2),
7652
7651
  children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.OverflowTooltip, {
@@ -8666,7 +8665,7 @@ const DistributeStorageForm = React.forwardRef(function DistributeStorageForm2(p
8666
8665
  values: v,
8667
8666
  successNotification() {
8668
8667
  return {
8669
- message: t2("dovetail.edit_distribute_storage_success_toast", {
8668
+ message: t2("dovetail.edit_request_capacity_success_toast", {
8670
8669
  kind: pvc2.kind,
8671
8670
  name: pvc2.id,
8672
8671
  interpolation: {
@@ -8689,7 +8688,7 @@ const DistributeStorageForm = React.forwardRef(function DistributeStorageForm2(p
8689
8688
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
8690
8689
  eagle.Form.Item,
8691
8690
  {
8692
- label: /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", { style: { width: "134px" }, children: label2 || t2("dovetail.distributed") }),
8691
+ label: /* @__PURE__ */ common.jsxRuntimeExports.jsx("span", { style: { width: "134px" }, children: label2 || t2("dovetail.request_capacity") }),
8693
8692
  colon: false,
8694
8693
  help: validateResult.distributeStorage,
8695
8694
  validateStatus: validateResult.distributeStorage ? "error" : "",
@@ -8742,7 +8741,7 @@ function PVCDistributeStorage({
8742
8741
  {
8743
8742
  modalProps: {
8744
8743
  formRef,
8745
- title: t2("dovetail.edit_distribute_storage"),
8744
+ title: t2("dovetail.edit_request_capacity"),
8746
8745
  namespace: pvc2.namespace || "",
8747
8746
  renderContent() {
8748
8747
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(
@@ -10230,6 +10229,9 @@ class PersistentVolumeClaimModel extends ResourceModel {
10230
10229
  get storageBytes() {
10231
10230
  return parseSi(lodashEs.get(this._rawYaml, "spec.resources.requests.storage") || "0Gi");
10232
10231
  }
10232
+ get allocatedStorageBytes() {
10233
+ return parseSi(lodashEs.get(this._rawYaml, "status.capacity.storage") || "0Gi");
10234
+ }
10233
10235
  updateDistributeStorage(distributeStorage) {
10234
10236
  const yaml2 = lodashEs.cloneDeep(this._globalStore.restoreItem(this));
10235
10237
  return lodashEs.set(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
@@ -11999,17 +12001,18 @@ function validateNodePort(nodePort, allNodePorts, i18n2) {
11999
12001
  return { isValid: true };
12000
12002
  }
12001
12003
  function K8sDropdown(props) {
12002
- var _a, _b, _c;
12004
+ var _a, _b;
12003
12005
  const {
12004
12006
  record,
12005
12007
  size = "normal",
12006
12008
  resourceConfig,
12007
12009
  customButton,
12008
12010
  deleteDialogProps,
12009
- forceShowAllActions
12011
+ hideEdit: hideEditProp,
12012
+ hideEditYaml,
12013
+ hideDownloadYaml
12010
12014
  } = props;
12011
12015
  const globalStore = useGlobalStore();
12012
- const useResourceResult = core.useResource();
12013
12016
  const configs = React.useContext(ConfigsContext);
12014
12017
  const resourceName = (resourceConfig == null ? void 0 : resourceConfig.name) || getResourceNameByKind(record.kind || "", configs);
12015
12018
  const config = resourceConfig || configs[resourceName || ""];
@@ -12028,8 +12031,6 @@ function K8sDropdown(props) {
12028
12031
  });
12029
12032
  const download2 = useDownloadYAML();
12030
12033
  const openForm = useOpenForm();
12031
- const isInShowPage = forceShowAllActions ? false : useResourceResult.action === "show";
12032
- const isChildResource = forceShowAllActions ? false : isInShowPage && ((_b = useResourceResult.resource) == null ? void 0 : _b.name) !== resourceName;
12033
12034
  const { data: canEditData } = core.useCan({
12034
12035
  resource: resourceName,
12035
12036
  action: AccessControlAuth.Edit,
@@ -12044,12 +12045,12 @@ function K8sDropdown(props) {
12044
12045
  namespace: record.namespace
12045
12046
  }
12046
12047
  });
12047
- const formType = (_c = config == null ? void 0 : config.formConfig) == null ? void 0 : _c.formType;
12048
+ const formType = (_b = config == null ? void 0 : config.formConfig) == null ? void 0 : _b.formType;
12048
12049
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(common.jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12049
12050
  eagle.Dropdown,
12050
12051
  {
12051
12052
  overlay: /* @__PURE__ */ common.jsxRuntimeExports.jsxs(eagle.Menu, { children: [
12052
- isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12053
+ hideEditProp || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12053
12054
  eagle.Menu.Item,
12054
12055
  {
12055
12056
  onClick: () => openForm({ id: record.id, resourceName, resourceConfig: config }),
@@ -12059,7 +12060,7 @@ function K8sDropdown(props) {
12059
12060
  )}` : t2("dovetail.edit_yaml") })
12060
12061
  }
12061
12062
  ),
12062
- isChildResource || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12063
+ hideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12063
12064
  eagle.Menu.Item,
12064
12065
  {
12065
12066
  onClick: () => openForm({
@@ -12071,7 +12072,7 @@ function K8sDropdown(props) {
12071
12072
  children: /* @__PURE__ */ common.jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16PrimaryIcon, children: t2("dovetail.edit_yaml") })
12072
12073
  }
12073
12074
  ),
12074
- isChildResource ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12075
+ hideDownloadYaml ? null : /* @__PURE__ */ common.jsxRuntimeExports.jsx(
12075
12076
  eagle.Menu.Item,
12076
12077
  {
12077
12078
  onClick: () => {
@@ -14183,7 +14184,7 @@ const PVCStorageField = ({
14183
14184
  key: "storage",
14184
14185
  col: 12,
14185
14186
  path: ["spec", "resources", "requests", "storage"],
14186
- title: i18n2.t("dovetail.distributed"),
14187
+ title: i18n2.t("dovetail.request_capacity"),
14187
14188
  renderContent(value2, pvc2) {
14188
14189
  return /* @__PURE__ */ common.jsxRuntimeExports.jsx(PVCDistributeStorage, {
14189
14190
  pvc: pvc2,
@@ -19962,7 +19963,7 @@ const PVCStorageColumnRenderer = (i18n2) => {
19962
19963
  return {
19963
19964
  key: "storage",
19964
19965
  display: true,
19965
- dataIndex: ["storageBytes"],
19966
+ dataIndex: ["allocatedStorageBytes"],
19966
19967
  title: i18n2.t("dovetail.distributed"),
19967
19968
  width: 120,
19968
19969
  sortable: true,
package/dist/refine.js CHANGED
@@ -636,9 +636,9 @@ const retain$1 = "Retain";
636
636
  const default_sc$1 = "Default storage class";
637
637
  const reclaim_policy$1 = "Reclaim policy";
638
638
  const allow_expand$1 = "Volume expansion";
639
- const edit_distribute_storage$1 = "Edit capacity allocation";
640
- const edit_distribute_storage_success_toast$1 = "Successfully edited the capacity allocation";
641
- const edit_distribute_storage_failed_toast$1 = "Failed to edit the capacity allocation";
639
+ const request_capacity$1 = "Request capacity";
640
+ const edit_request_capacity$1 = "Edit request capacity";
641
+ const edit_request_capacity_success_toast$1 = "Successfully edited request capacity";
642
642
  const edit_taint$1 = "Edit taint";
643
643
  const edit_node_taint$1 = "Edit taint";
644
644
  const edit_node_taint_success_toast$1 = "Successfully edited the taint for the node {{name}}";
@@ -647,10 +647,10 @@ const node_taint_PreferNoSchedule$1 = "PreferNoSchedule";
647
647
  const node_taint_NoExecute$1 = "NoExecute";
648
648
  const taint$1 = "Taint";
649
649
  const change_form_mode_alert$1 = "Switching from YAML editing to form editing will discard all changes made to the YAML file.";
650
- const pvc_storage_required$1 = "Please specify the allocation.";
650
+ const pvc_storage_required$1 = "Please specify the request capacity.";
651
651
  const pvc_storage_min$1 = "Please enter a positive integer.";
652
652
  const pvc_storage_reduce_limit$1 = "The value cannot be less than the current value.";
653
- const pvc_storage_max_limit$1 = "The allocation cannot exceed 64 TiB.";
653
+ const pvc_storage_max_limit$1 = "The request capacity cannot exceed 64 TiB.";
654
654
  const key_empty_text$1 = "Please specify a key.";
655
655
  const format_error$1 = "Format error.";
656
656
  const taint_effect_empty_text$1 = "Please select an effect.";
@@ -912,9 +912,9 @@ const dovetail$1 = {
912
912
  default_sc: default_sc$1,
913
913
  reclaim_policy: reclaim_policy$1,
914
914
  allow_expand: allow_expand$1,
915
- edit_distribute_storage: edit_distribute_storage$1,
916
- edit_distribute_storage_success_toast: edit_distribute_storage_success_toast$1,
917
- edit_distribute_storage_failed_toast: edit_distribute_storage_failed_toast$1,
915
+ request_capacity: request_capacity$1,
916
+ edit_request_capacity: edit_request_capacity$1,
917
+ edit_request_capacity_success_toast: edit_request_capacity_success_toast$1,
918
918
  edit_taint: edit_taint$1,
919
919
  edit_node_taint: edit_node_taint$1,
920
920
  edit_node_taint_success_toast: edit_node_taint_success_toast$1,
@@ -1186,9 +1186,9 @@ const retain = "保留";
1186
1186
  const default_sc = "默认存储类";
1187
1187
  const reclaim_policy = "回收策略";
1188
1188
  const allow_expand = "卷扩容";
1189
- const edit_distribute_storage = "编辑分配量";
1190
- const edit_distribute_storage_success_toast = "编辑分配量成功";
1191
- const edit_distribute_storage_failed_toast = "编辑分配量失败";
1189
+ const request_capacity = "申请量";
1190
+ const edit_request_capacity = "编辑申请量";
1191
+ const edit_request_capacity_success_toast = "编辑申请量成功";
1192
1192
  const edit_taint = "编辑污点";
1193
1193
  const edit_node_taint = "编辑污点";
1194
1194
  const edit_node_taint_success_toast = "编辑节点 {{name}} 的污点成功";
@@ -1197,10 +1197,10 @@ const node_taint_PreferNoSchedule = "尽可能阻止调度";
1197
1197
  const node_taint_NoExecute = "阻止调度并驱逐 Pod";
1198
1198
  const taint = "污点";
1199
1199
  const change_form_mode_alert = "从编辑 YAML 切回表单编辑,将无法保留对 YAML 文件做出的所有更改。";
1200
- const pvc_storage_required = "请填写分配量。";
1200
+ const pvc_storage_required = "请填写申请量。";
1201
1201
  const pvc_storage_min = "请输入正整数。";
1202
1202
  const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1203
- const pvc_storage_max_limit = "分配量不能超过 64 TiB。";
1203
+ const pvc_storage_max_limit = "申请量不能超过 64 TiB。";
1204
1204
  const key_empty_text = "请填写键。";
1205
1205
  const format_error = "格式错误。";
1206
1206
  const taint_effect_empty_text = "请选择效果。";
@@ -1461,9 +1461,9 @@ const dovetail = {
1461
1461
  default_sc,
1462
1462
  reclaim_policy,
1463
1463
  allow_expand,
1464
- edit_distribute_storage,
1465
- edit_distribute_storage_success_toast,
1466
- edit_distribute_storage_failed_toast,
1464
+ request_capacity,
1465
+ edit_request_capacity,
1466
+ edit_request_capacity_success_toast,
1467
1467
  edit_taint,
1468
1468
  edit_node_taint,
1469
1469
  edit_node_taint_success_toast,
@@ -7627,7 +7627,6 @@ function ValueDisplay(props) {
7627
7627
  } = props;
7628
7628
  const htmlTitle = typeof value2 === "string" || typeof value2 === "number" ? String(value2) : void 0;
7629
7629
  const result = useOverflow ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
7630
- title: htmlTitle,
7631
7630
  style,
7632
7631
  className: cx_default(className, ContentStyle$2),
7633
7632
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTooltip, {
@@ -8647,7 +8646,7 @@ const DistributeStorageForm = React.forwardRef(function DistributeStorageForm2(p
8647
8646
  values: v,
8648
8647
  successNotification() {
8649
8648
  return {
8650
- message: t2("dovetail.edit_distribute_storage_success_toast", {
8649
+ message: t2("dovetail.edit_request_capacity_success_toast", {
8651
8650
  kind: pvc2.kind,
8652
8651
  name: pvc2.id,
8653
8652
  interpolation: {
@@ -8670,7 +8669,7 @@ const DistributeStorageForm = React.forwardRef(function DistributeStorageForm2(p
8670
8669
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8671
8670
  Form.Item,
8672
8671
  {
8673
- label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { width: "134px" }, children: label2 || t2("dovetail.distributed") }),
8672
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { width: "134px" }, children: label2 || t2("dovetail.request_capacity") }),
8674
8673
  colon: false,
8675
8674
  help: validateResult.distributeStorage,
8676
8675
  validateStatus: validateResult.distributeStorage ? "error" : "",
@@ -8723,7 +8722,7 @@ function PVCDistributeStorage({
8723
8722
  {
8724
8723
  modalProps: {
8725
8724
  formRef,
8726
- title: t2("dovetail.edit_distribute_storage"),
8725
+ title: t2("dovetail.edit_request_capacity"),
8727
8726
  namespace: pvc2.namespace || "",
8728
8727
  renderContent() {
8729
8728
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -10211,6 +10210,9 @@ class PersistentVolumeClaimModel extends ResourceModel {
10211
10210
  get storageBytes() {
10212
10211
  return parseSi(get$2(this._rawYaml, "spec.resources.requests.storage") || "0Gi");
10213
10212
  }
10213
+ get allocatedStorageBytes() {
10214
+ return parseSi(get$2(this._rawYaml, "status.capacity.storage") || "0Gi");
10215
+ }
10214
10216
  updateDistributeStorage(distributeStorage) {
10215
10217
  const yaml2 = cloneDeep(this._globalStore.restoreItem(this));
10216
10218
  return set(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
@@ -11980,17 +11982,18 @@ function validateNodePort(nodePort, allNodePorts, i18n2) {
11980
11982
  return { isValid: true };
11981
11983
  }
11982
11984
  function K8sDropdown(props) {
11983
- var _a, _b, _c;
11985
+ var _a, _b;
11984
11986
  const {
11985
11987
  record,
11986
11988
  size = "normal",
11987
11989
  resourceConfig,
11988
11990
  customButton,
11989
11991
  deleteDialogProps,
11990
- forceShowAllActions
11992
+ hideEdit: hideEditProp,
11993
+ hideEditYaml,
11994
+ hideDownloadYaml
11991
11995
  } = props;
11992
11996
  const globalStore = useGlobalStore();
11993
- const useResourceResult = useResource();
11994
11997
  const configs = useContext(ConfigsContext);
11995
11998
  const resourceName = (resourceConfig == null ? void 0 : resourceConfig.name) || getResourceNameByKind(record.kind || "", configs);
11996
11999
  const config = resourceConfig || configs[resourceName || ""];
@@ -12009,8 +12012,6 @@ function K8sDropdown(props) {
12009
12012
  });
12010
12013
  const download2 = useDownloadYAML();
12011
12014
  const openForm = useOpenForm();
12012
- const isInShowPage = forceShowAllActions ? false : useResourceResult.action === "show";
12013
- const isChildResource = forceShowAllActions ? false : isInShowPage && ((_b = useResourceResult.resource) == null ? void 0 : _b.name) !== resourceName;
12014
12015
  const { data: canEditData } = useCan({
12015
12016
  resource: resourceName,
12016
12017
  action: AccessControlAuth.Edit,
@@ -12025,12 +12026,12 @@ function K8sDropdown(props) {
12025
12026
  namespace: record.namespace
12026
12027
  }
12027
12028
  });
12028
- const formType = (_c = config == null ? void 0 : config.formConfig) == null ? void 0 : _c.formType;
12029
+ const formType = (_b = config == null ? void 0 : config.formConfig) == null ? void 0 : _b.formType;
12029
12030
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12030
12031
  Dropdown,
12031
12032
  {
12032
12033
  overlay: /* @__PURE__ */ jsxRuntimeExports.jsxs(Menu$1, { children: [
12033
- isInShowPage || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12034
+ hideEditProp || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12034
12035
  Menu$1.Item,
12035
12036
  {
12036
12037
  onClick: () => openForm({ id: record.id, resourceName, resourceConfig: config }),
@@ -12040,7 +12041,7 @@ function K8sDropdown(props) {
12040
12041
  )}` : t2("dovetail.edit_yaml") })
12041
12042
  }
12042
12043
  ),
12043
- isChildResource || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12044
+ hideEditYaml || (canEditData == null ? void 0 : canEditData.can) === false || (config == null ? void 0 : config.hideEdit) ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12044
12045
  Menu$1.Item,
12045
12046
  {
12046
12047
  onClick: () => openForm({
@@ -12052,7 +12053,7 @@ function K8sDropdown(props) {
12052
12053
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon, { src: EditPen16PrimaryIcon, children: t2("dovetail.edit_yaml") })
12053
12054
  }
12054
12055
  ),
12055
- isChildResource ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12056
+ hideDownloadYaml ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
12056
12057
  Menu$1.Item,
12057
12058
  {
12058
12059
  onClick: () => {
@@ -14164,7 +14165,7 @@ const PVCStorageField = ({
14164
14165
  key: "storage",
14165
14166
  col: 12,
14166
14167
  path: ["spec", "resources", "requests", "storage"],
14167
- title: i18n2.t("dovetail.distributed"),
14168
+ title: i18n2.t("dovetail.request_capacity"),
14168
14169
  renderContent(value2, pvc2) {
14169
14170
  return /* @__PURE__ */ jsxRuntimeExports.jsx(PVCDistributeStorage, {
14170
14171
  pvc: pvc2,
@@ -19943,7 +19944,7 @@ const PVCStorageColumnRenderer = (i18n2) => {
19943
19944
  return {
19944
19945
  key: "storage",
19945
19946
  display: true,
19946
- dataIndex: ["storageBytes"],
19947
+ dataIndex: ["allocatedStorageBytes"],
19947
19948
  title: i18n2.t("dovetail.distributed"),
19948
19949
  width: 120,
19949
19950
  sortable: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.3.28-alpha.1",
3
+ "version": "0.3.29-alpha.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",