@dovetail-v2/refine 0.1.8 → 0.1.10

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.
Files changed (58) hide show
  1. package/dist/{MonacoYamlDiffEditor-1593cfad.js → MonacoYamlDiffEditor-effbc940.js} +1 -1
  2. package/dist/{index-45031697.js → index-a2e0edc2.js} +1440 -739
  3. package/dist/refine.js +216 -196
  4. package/dist/refine.umd.cjs +1239 -538
  5. package/dist/style.css +44 -44
  6. package/lib/components/CreateButton/index.d.ts +5 -1
  7. package/lib/components/DropdownMenuItems/EditNodeTaintDropdownMenuItem.d.ts +12 -0
  8. package/lib/components/{CronJobDropdown → Dropdowns/CronJobDropdown}/index.d.ts +1 -1
  9. package/lib/components/{K8sDropdown → Dropdowns/K8sDropdown}/index.d.ts +1 -1
  10. package/lib/components/{PodDropdown → Dropdowns/PodDropdown}/index.d.ts +1 -1
  11. package/lib/components/{ReplicasDropdown → Dropdowns/ReplicasDropdown}/index.d.ts +1 -1
  12. package/lib/components/{WorkloadDropdown → Dropdowns/WorkloadDropdown}/index.d.ts +1 -1
  13. package/lib/components/EditField/index.d.ts +1 -1
  14. package/lib/components/EditMetadataForm/EditNodeTaintForm.d.ts +12 -0
  15. package/lib/components/Form/YamlForm.d.ts +1 -1
  16. package/lib/components/Form/useReactHookForm.d.ts +2 -1
  17. package/lib/components/Form/useYamlForm.d.ts +1 -1
  18. package/lib/components/InternalBaseTable/index.d.ts +43 -0
  19. package/lib/components/ListPage/index.d.ts +2 -2
  20. package/lib/components/NodeTaintsTable/NodeTaintsTable.d.ts +7 -0
  21. package/lib/components/NodeTaintsTable/index.d.ts +1 -0
  22. package/lib/components/PVCDistributeStorage/index.d.ts +16 -0
  23. package/lib/components/ResourceCRUD/list/index.d.ts +2 -2
  24. package/lib/components/ResourceFiledDisplays.d.ts +2 -3
  25. package/lib/components/ResourceLink/index.d.ts +2 -2
  26. package/lib/components/ResourceTable/index.d.ts +9 -0
  27. package/lib/components/ShowContent/fields.d.ts +10 -0
  28. package/lib/components/ShowContent/groups.d.ts +5 -2
  29. package/lib/components/StateTag/StateTag.d.ts +3 -3
  30. package/lib/components/Table/index.d.ts +11 -43
  31. package/lib/components/{Table/TableToolBar.d.ts → TableToolbar/index.d.ts} +1 -0
  32. package/lib/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +2 -0
  33. package/lib/components/index.d.ts +7 -5
  34. package/lib/constants/k8s.d.ts +36 -1
  35. package/lib/constants/state.d.ts +8 -3
  36. package/lib/contexts/component.d.ts +1 -1
  37. package/lib/hooks/useEagleTable/columns.d.ts +7 -1
  38. package/lib/hooks/useEagleTable/useEagleTable.d.ts +3 -3
  39. package/lib/hooks/useSubmitForm.d.ts +1 -1
  40. package/lib/hooks/useTableData.d.ts +1 -1
  41. package/lib/i18n.d.ts +41 -20
  42. package/lib/locales/en-US/index.d.ts +0 -1
  43. package/lib/locales/zh-CN/index.d.ts +41 -19
  44. package/lib/models/cronjob-model.d.ts +2 -2
  45. package/lib/models/daemonset-model.d.ts +2 -2
  46. package/lib/models/deployment-model.d.ts +2 -2
  47. package/lib/models/job-model.d.ts +2 -2
  48. package/lib/models/node-model.d.ts +2 -2
  49. package/lib/models/persistent-volume-claim.d.ts +6 -0
  50. package/lib/models/persistent-volume.d.ts +7 -0
  51. package/lib/models/statefulset-model.d.ts +2 -2
  52. package/lib/models/storage-class.d.ts +4 -0
  53. package/lib/pages/storageclasses/index.d.ts +7 -4
  54. package/lib/styles/tag.d.ts +1 -0
  55. package/lib/types/resource.d.ts +5 -6
  56. package/lib/utils/storage.d.ts +13 -0
  57. package/package.json +1 -1
  58. /package/lib/components/{Table → InternalBaseTable}/TableWidgets.d.ts +0 -0
@@ -7,12 +7,12 @@ var __publicField = (obj, key2, value2) => {
7
7
  import i18n from "i18next";
8
8
  import * as React from "react";
9
9
  import React__default, { createElement, isValidElement, cloneElement, Children, createContext, useContext, useState, useRef, useEffect, useCallback, useMemo, useImperativeHandle, memo, PureComponent, useLayoutEffect, forwardRef, Suspense } from "react";
10
- import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNavigation, useBreadcrumb, useList, useParsed, useGo, CanAccess, useUpdate, useCan, useTable, useDeleteMany, useShow, useDataProvider, useRefineContext, useTranslate, useWarnAboutChange, useForm as useForm$2, flattenObjectKeys, pickNotDeprecated, useMenu, Refine } from "@refinedev/core";
10
+ import { ResourceContext, matchResourceFromRoute, useResource, useDelete, useNavigation, useBreadcrumb, useList, CanAccess, useUpdate, useParsed, useGo, useCan, useTable, useDeleteMany, useShow, useDataProvider, useRefineContext, useTranslate, useWarnAboutChange, useForm as useForm$2, flattenObjectKeys, pickNotDeprecated, useMenu, Refine } from "@refinedev/core";
11
11
  import { parse, stringify } from "qs";
12
12
  import { useLocation, useHistory, useParams, matchPath, Link, Route, NavLink, Router } from "react-router-dom";
13
- import { Typo, Tag, Input, Select, AntdOption, Button, Form, Space, TextArea, kitContext, Loading, Table as Table$1, Pagination, OverflowTooltip, StatusCapsule, Tooltip, usePushModal, Alert, usePopModal, Modal, TableForm, Menu as Menu$1, Icon as Icon$1, Dropdown, Divider, Link as Link$1, Tabs as Tabs$1, TabsTabPane, Row, Col, Fields, DonutChart, Units, SegmentControl, Checkbox, DropdownMenu, SearchInput, Token, AntdSelectOptGroup, MenuItemGroup, Layout as Layout$1, Time as Time$1, useMessage, ModalStack, KitStoreProvider, ConfigProvider } from "@cloudtower/eagle";
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, TableForm, Menu as Menu$1, Icon as Icon$1, Dropdown, Divider, Link as Link$1, Tabs as Tabs$1, TabsTabPane, Row, Col, 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 { EditPen16BlueIcon, EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, EditPen16GradientBlueIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, FontSize16GrayIcon, FontSize16BlueIcon, LogCollection16GrayIcon, LogCollection16GradientBlueIcon, TrashBinDeletePermanently16GrayIcon, TrashBinDeletePermanently16BlueIcon, Loading24GradientBlueIcon, OpenTerminal16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon } from "@cloudtower/icons-react";
15
- import { first, omit as omit$1, merge, get as get$3, debounce, last, isObject as isObject$4, uniq, keyBy } from "lodash-es";
15
+ import { first, isNil, 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";
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";
@@ -1014,8 +1014,8 @@ const already_reset$1 = "Already reset";
1014
1014
  const fetch_schema_fail$1 = "获取 schema 失败。";
1015
1015
  const obtain_data_error$1 = "Having trouble getting data.";
1016
1016
  const retry$1 = "Retry";
1017
- const create_resource$1 = "Create {{resource}}";
1018
- const edit_resource$1 = "Edit {{resource}}";
1017
+ const create_resource$1 = "Create{{resource}}";
1018
+ const edit_resource$1 = "Edit{{resource}}";
1019
1019
  const state$1 = "Status";
1020
1020
  const name$1 = "Name";
1021
1021
  const pod$1 = "Pod";
@@ -1049,18 +1049,18 @@ const data$1 = "Data";
1049
1049
  const resume$1 = "Resume";
1050
1050
  const sessionAffinity$1 = "Session Affinity";
1051
1051
  const log$1 = "Log";
1052
- const ready$1 = "Ready";
1053
- const updating$1 = "Updating";
1054
- const completed$1 = "Completed";
1055
- const failed$1 = "Failed";
1056
- const suspended$1 = "Suspended";
1057
- const running$1 = "Running";
1058
- const terminating$1 = "Terminating";
1059
- const terminated$1 = "Terminated";
1060
- const succeeded$1 = "Succeeded";
1061
- const unknown$1 = "Unknown";
1062
- const pending$1 = "Pending";
1063
- const waiting$1 = "Waiting";
1052
+ const ready = "Ready";
1053
+ const updating = "Updating";
1054
+ const completed = "Completed";
1055
+ const failed = "Failed";
1056
+ const suspended = "Suspended";
1057
+ const running = "Running";
1058
+ const terminating = "Terminating";
1059
+ const terminated = "Terminated";
1060
+ const succeeded = "Succeeded";
1061
+ const unknown = "Unknown";
1062
+ const pending = "Pending";
1063
+ const waiting = "Waiting";
1064
1064
  const expand$1 = "Expand";
1065
1065
  const fold$1 = "Collapse";
1066
1066
  const rule$1 = "Rule";
@@ -1151,22 +1151,21 @@ const pod_port$1 = "Pod port";
1151
1151
  const path_type$1 = "Path type";
1152
1152
  const only_support_one_yaml$1 = "Only one YAML configuration is supported at a time.";
1153
1153
  const not_support$1 = "Not supported";
1154
- const stopped$1 = "Stopped";
1154
+ const stopped = "Stopped";
1155
1155
  const any_node_ip$1 = "Any node IP";
1156
1156
  const storage_class$1 = "Storage class";
1157
1157
  const persistent_volume$1 = "Persistent volume";
1158
1158
  const provisioner$1 = "Provisioner";
1159
1159
  const file_system$1 = "File system";
1160
1160
  const capacity$1 = "Capacity";
1161
- const phase$1 = "Phase";
1162
1161
  const volume_mode$1 = "Volume mode";
1163
1162
  const access_mode$1 = "Access mode";
1164
1163
  const block$1 = "Block";
1165
- const pv_phase_available$1 = "Available";
1166
- const pv_phase_bound$1 = "Bound";
1167
- const pv_phase_released$1 = "Released";
1168
- const pv_phase_failed$1 = "Failed";
1169
- const pv_phase_pending$1 = "Pending";
1164
+ const pv_phase_available = "Available";
1165
+ const pv_phase_bound = "Bound";
1166
+ const pv_phase_released = "Released";
1167
+ const pv_phase_failed = "Failed";
1168
+ const pv_phase_pending = "Pending";
1170
1169
  const exec_pod = "Execute shell";
1171
1170
  const search$1 = "Search";
1172
1171
  const edit_label$1 = "Edit label";
@@ -1220,18 +1219,18 @@ const dovetail$1 = {
1220
1219
  resume: resume$1,
1221
1220
  sessionAffinity: sessionAffinity$1,
1222
1221
  log: log$1,
1223
- ready: ready$1,
1224
- updating: updating$1,
1225
- completed: completed$1,
1226
- failed: failed$1,
1227
- suspended: suspended$1,
1228
- running: running$1,
1229
- terminating: terminating$1,
1230
- terminated: terminated$1,
1231
- succeeded: succeeded$1,
1232
- unknown: unknown$1,
1233
- pending: pending$1,
1234
- waiting: waiting$1,
1222
+ ready,
1223
+ updating,
1224
+ completed,
1225
+ failed,
1226
+ suspended,
1227
+ running,
1228
+ terminating,
1229
+ terminated,
1230
+ succeeded,
1231
+ unknown,
1232
+ pending,
1233
+ waiting,
1235
1234
  expand: expand$1,
1236
1235
  fold: fold$1,
1237
1236
  rule: rule$1,
@@ -1324,22 +1323,21 @@ const dovetail$1 = {
1324
1323
  path_type: path_type$1,
1325
1324
  only_support_one_yaml: only_support_one_yaml$1,
1326
1325
  not_support: not_support$1,
1327
- stopped: stopped$1,
1326
+ stopped,
1328
1327
  any_node_ip: any_node_ip$1,
1329
1328
  storage_class: storage_class$1,
1330
1329
  persistent_volume: persistent_volume$1,
1331
1330
  provisioner: provisioner$1,
1332
1331
  file_system: file_system$1,
1333
1332
  capacity: capacity$1,
1334
- phase: phase$1,
1335
1333
  volume_mode: volume_mode$1,
1336
1334
  access_mode: access_mode$1,
1337
1335
  block: block$1,
1338
- pv_phase_available: pv_phase_available$1,
1339
- pv_phase_bound: pv_phase_bound$1,
1340
- pv_phase_released: pv_phase_released$1,
1341
- pv_phase_failed: pv_phase_failed$1,
1342
- pv_phase_pending: pv_phase_pending$1,
1336
+ pv_phase_available,
1337
+ pv_phase_bound,
1338
+ pv_phase_released,
1339
+ pv_phase_failed,
1340
+ pv_phase_pending,
1343
1341
  exec_pod,
1344
1342
  search: search$1,
1345
1343
  edit_label: edit_label$1
@@ -1403,20 +1401,20 @@ const select_container = "选择容器";
1403
1401
  const fetch_schema_fail = "获取 schema 失败。";
1404
1402
  const obtain_data_error = "获取数据时遇到问题。";
1405
1403
  const retry = "重试";
1406
- const ready = "已就绪";
1407
- const updating = "更新中";
1408
- const completed = "已完成";
1409
- const failed = "异常";
1410
- const suspended = "已挂起";
1411
- const running = "运行中";
1412
- const terminating = "终止中";
1413
- const succeeded = "已成功终止";
1414
- const terminated = "已终止";
1415
- const unknown = "未知";
1416
- const pending = "待处理";
1417
- const waiting = "等待中";
1418
- const create_resource = "创建 {{resource}}";
1419
- const edit_resource = "编辑 {{resource}}";
1404
+ const ready_state = "已就绪";
1405
+ const updating_state = "更新中";
1406
+ const completed_state = "已完成";
1407
+ const abnormal_state = "异常";
1408
+ const suspended_state = "已挂起";
1409
+ const running_state = "运行中";
1410
+ const terminating_state = "终止中";
1411
+ const succeeded_state = "已成功终止";
1412
+ const terminated_state = "已终止";
1413
+ const unknown_state = "未知";
1414
+ const pending_state = "待处理";
1415
+ const waiting_state = "等待中";
1416
+ const create_resource = "创建{{resource}}";
1417
+ const edit_resource = "编辑{{resource}}";
1420
1418
  const sec = "秒";
1421
1419
  const min = "分";
1422
1420
  const hr = "小时";
@@ -1451,6 +1449,7 @@ const node_port = "NodePort";
1451
1449
  const protocol = "协议";
1452
1450
  const key = "键";
1453
1451
  const value = "值";
1452
+ const effect = "效果";
1454
1453
  const show_data_value = "显示数值";
1455
1454
  const hide_data_value = "隐藏数值";
1456
1455
  const path_type = "路径类型";
@@ -1497,23 +1496,24 @@ const out_cluster_node_port_desc = "NodePort 展示<strong>节点 IP:nodeport<
1497
1496
  const out_cluster_lb_desc = "LoadBalancer 展示 <strong>ingress[*].ip</strong>。";
1498
1497
  const out_external_name_desc = "ExternalName 展示 <strong>external-ip</strong>。";
1499
1498
  const only_support_one_yaml = "一次仅支持输入一个 YAML 配置。";
1499
+ const support = "支持";
1500
1500
  const not_support = "不支持";
1501
- const stopped = "已停止";
1501
+ const stopped_state = "已停止";
1502
1502
  const any_node_ip = "任意节点 IP";
1503
1503
  const storage_class = "存储类";
1504
1504
  const persistent_volume = "持久卷";
1505
1505
  const provisioner = "制备器";
1506
1506
  const file_system = "文件系统";
1507
1507
  const capacity = "容量";
1508
- const phase = "阶段";
1508
+ const distributed = "分配量";
1509
1509
  const volume_mode = "卷模式";
1510
1510
  const access_mode = "访问模式";
1511
1511
  const block = "块";
1512
- const pv_phase_available = "可用";
1513
- const pv_phase_bound = "已绑定";
1514
- const pv_phase_released = "已释放";
1515
- const pv_phase_failed = "失败";
1516
- const pv_phase_pending = "等待中";
1512
+ const available_state = "可用";
1513
+ const bound_state = "已绑定";
1514
+ const released_state = "已释放";
1515
+ const failed_state = "失败";
1516
+ const lost_state = "卷不可用";
1517
1517
  const font_size = "字体大小";
1518
1518
  const download_shell_content = "下载控制台日志";
1519
1519
  const clear_shell = "清空命令行";
@@ -1529,6 +1529,26 @@ const edit_label = "编辑标签";
1529
1529
  const edit_label_success_toast = "编辑资源 {{name}} 的标签成功";
1530
1530
  const edit_annotation = "编辑注解";
1531
1531
  const edit_annotation_success_toast = "编辑资源 {{name}} 的注解成功";
1532
+ const pvc = "持久卷申领";
1533
+ const pv = "持久卷";
1534
+ const csi = "CSI";
1535
+ const retain = "保留";
1536
+ const default_sc = "默认存储类";
1537
+ const reclaim_policy = "回收策略";
1538
+ const allow_expand = "卷扩容";
1539
+ const edit_distribute_storage = "编辑分配量";
1540
+ const edit_distribute_storage_success_toast = "编辑分配量成功";
1541
+ const edit_distribute_storage_failed_toast = "编辑分配量失败";
1542
+ const edit_node_taint = "编辑节点污点";
1543
+ const edit_node_taint_success_toast = "编辑节点 {{name}} 的污点成功";
1544
+ const node_taint_NoSchedule = "仅阻止调度";
1545
+ const node_taint_PreferNoSchedule = "尽可能阻止调度";
1546
+ const node_taint_NoExecute = "阻止调度并驱逐 Pod";
1547
+ const taint = "污点";
1548
+ const change_form_mode_alert = "从编辑 YAML 切回表单编辑,将无法保留对 YAML 文件做出的所有更改。";
1549
+ const pvc_storage_required = "请填写分配量。";
1550
+ const pvc_storage_min = "请输入正整数。";
1551
+ const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1532
1552
  const dovetail = {
1533
1553
  copy: copy$1,
1534
1554
  reset_arguments,
@@ -1587,18 +1607,18 @@ const dovetail = {
1587
1607
  fetch_schema_fail,
1588
1608
  obtain_data_error,
1589
1609
  retry,
1590
- ready,
1591
- updating,
1592
- completed,
1593
- failed,
1594
- suspended,
1595
- running,
1596
- terminating,
1597
- succeeded,
1598
- terminated,
1599
- unknown,
1600
- pending,
1601
- waiting,
1610
+ ready_state,
1611
+ updating_state,
1612
+ completed_state,
1613
+ abnormal_state,
1614
+ suspended_state,
1615
+ running_state,
1616
+ terminating_state,
1617
+ succeeded_state,
1618
+ terminated_state,
1619
+ unknown_state,
1620
+ pending_state,
1621
+ waiting_state,
1602
1622
  create_resource,
1603
1623
  edit_resource,
1604
1624
  sec,
@@ -1635,6 +1655,7 @@ const dovetail = {
1635
1655
  protocol,
1636
1656
  key,
1637
1657
  value,
1658
+ effect,
1638
1659
  show_data_value,
1639
1660
  hide_data_value,
1640
1661
  path_type,
@@ -1683,23 +1704,24 @@ const dovetail = {
1683
1704
  out_cluster_lb_desc,
1684
1705
  out_external_name_desc,
1685
1706
  only_support_one_yaml,
1707
+ support,
1686
1708
  not_support,
1687
- stopped,
1709
+ stopped_state,
1688
1710
  any_node_ip,
1689
1711
  storage_class,
1690
1712
  persistent_volume,
1691
1713
  provisioner,
1692
1714
  file_system,
1693
1715
  capacity,
1694
- phase,
1716
+ distributed,
1695
1717
  volume_mode,
1696
1718
  access_mode,
1697
1719
  block,
1698
- pv_phase_available,
1699
- pv_phase_bound,
1700
- pv_phase_released,
1701
- pv_phase_failed,
1702
- pv_phase_pending,
1720
+ available_state,
1721
+ bound_state,
1722
+ released_state,
1723
+ failed_state,
1724
+ lost_state,
1703
1725
  font_size,
1704
1726
  download_shell_content,
1705
1727
  clear_shell,
@@ -1714,7 +1736,27 @@ const dovetail = {
1714
1736
  edit_label,
1715
1737
  edit_label_success_toast,
1716
1738
  edit_annotation,
1717
- edit_annotation_success_toast
1739
+ edit_annotation_success_toast,
1740
+ pvc,
1741
+ pv,
1742
+ csi,
1743
+ retain,
1744
+ default_sc,
1745
+ reclaim_policy,
1746
+ allow_expand,
1747
+ edit_distribute_storage,
1748
+ edit_distribute_storage_success_toast,
1749
+ edit_distribute_storage_failed_toast,
1750
+ edit_node_taint,
1751
+ edit_node_taint_success_toast,
1752
+ node_taint_NoSchedule,
1753
+ node_taint_PreferNoSchedule,
1754
+ node_taint_NoExecute,
1755
+ taint,
1756
+ change_form_mode_alert,
1757
+ pvc_storage_required,
1758
+ pvc_storage_min,
1759
+ pvc_storage_reduce_limit
1718
1760
  };
1719
1761
  const ZH = {
1720
1762
  dovetail
@@ -6532,7 +6574,7 @@ lodash.exports;
6532
6574
  customizer = typeof customizer == "function" ? customizer : undefined$1;
6533
6575
  return baseClone(value2, CLONE_SYMBOLS_FLAG, customizer);
6534
6576
  }
6535
- function cloneDeep(value2) {
6577
+ function cloneDeep2(value2) {
6536
6578
  return baseClone(value2, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
6537
6579
  }
6538
6580
  function cloneDeepWith(value2, customizer) {
@@ -6649,7 +6691,7 @@ lodash.exports;
6649
6691
  function isNull(value2) {
6650
6692
  return value2 === null;
6651
6693
  }
6652
- function isNil(value2) {
6694
+ function isNil2(value2) {
6653
6695
  return value2 == null;
6654
6696
  }
6655
6697
  function isNumber(value2) {
@@ -7658,7 +7700,7 @@ lodash.exports;
7658
7700
  lodash2.ceil = ceil;
7659
7701
  lodash2.clamp = clamp;
7660
7702
  lodash2.clone = clone;
7661
- lodash2.cloneDeep = cloneDeep;
7703
+ lodash2.cloneDeep = cloneDeep2;
7662
7704
  lodash2.cloneDeepWith = cloneDeepWith;
7663
7705
  lodash2.cloneWith = cloneWith;
7664
7706
  lodash2.conformsTo = conformsTo;
@@ -7716,7 +7758,7 @@ lodash.exports;
7716
7758
  lodash2.isMatchWith = isMatchWith;
7717
7759
  lodash2.isNaN = isNaN2;
7718
7760
  lodash2.isNative = isNative;
7719
- lodash2.isNil = isNil;
7761
+ lodash2.isNil = isNil2;
7720
7762
  lodash2.isNull = isNull;
7721
7763
  lodash2.isNumber = isNumber;
7722
7764
  lodash2.isObject = isObject2;
@@ -8817,15 +8859,15 @@ const WidgetErrorContent = (props) => {
8817
8859
  })
8818
8860
  });
8819
8861
  };
8820
- const TableWidgets_sc2nyo = "";
8862
+ const TableWidgets_zbqkvj = "";
8821
8863
  const AuxiliaryLine = /* @__PURE__ */ styled_default("div")({
8822
8864
  name: "AuxiliaryLine",
8823
- class: "ax1qopv",
8865
+ class: "a60f3dj",
8824
8866
  propsAsIs: false
8825
8867
  });
8826
- const index_dp43sd = "";
8827
- const TableContainerStyle = "t1upn1sz";
8828
- function Table(props) {
8868
+ const index_17chkj7 = "";
8869
+ const TableContainerStyle = "t47xc8k";
8870
+ function Table$1(props) {
8829
8871
  const {
8830
8872
  t: t2
8831
8873
  } = useTranslation();
@@ -8890,7 +8932,7 @@ function Table(props) {
8890
8932
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
8891
8933
  ref: wrapperRef,
8892
8934
  className: cx_default(TableContainerStyle, props.className, "table-wrapper"),
8893
- children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Table$1, {
8935
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Table$2, {
8894
8936
  tableLayout: "fixed",
8895
8937
  columns: finalColumns,
8896
8938
  dataSource,
@@ -8942,7 +8984,7 @@ function useTableData({ data: data2, columns, pageSize = 10, defaultSorters }) {
8942
8984
  const PodSelectorTable = ({ podSelectors = {} }) => {
8943
8985
  const { t: t2 } = useTranslation();
8944
8986
  const component = useContext(ComponentContext);
8945
- const Table$12 = component.Table || Table;
8987
+ const Table2 = component.Table || Table$1;
8946
8988
  const currentSize = 10;
8947
8989
  const datas = Object.keys(podSelectors).map((key2) => ({
8948
8990
  id: key2,
@@ -8987,7 +9029,7 @@ const PodSelectorTable = ({ podSelectors = {} }) => {
8987
9029
  );
8988
9030
  }
8989
9031
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
8990
- Table$12,
9032
+ Table2,
8991
9033
  {
8992
9034
  tableKey: "podSelector",
8993
9035
  loading: false,
@@ -9007,7 +9049,7 @@ const PodSelectorTable = ({ podSelectors = {} }) => {
9007
9049
  const PortsTable = ({ service }) => {
9008
9050
  const { t: t2 } = useTranslation();
9009
9051
  const component = useContext(ComponentContext);
9010
- const Table$12 = component.Table || Table;
9052
+ const Table2 = component.Table || Table$1;
9011
9053
  const currentSize = 10;
9012
9054
  const columns = [
9013
9055
  {
@@ -9075,7 +9117,7 @@ const PortsTable = ({ service }) => {
9075
9117
  );
9076
9118
  }
9077
9119
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
9078
- Table$12,
9120
+ Table2,
9079
9121
  {
9080
9122
  tableKey: "ports",
9081
9123
  loading: false,
@@ -9092,6 +9134,409 @@ const PortsTable = ({ service }) => {
9092
9134
  }
9093
9135
  );
9094
9136
  };
9137
+ function FormErrorAlert(props) {
9138
+ const { title, errorMsgs, style, className, isEdit } = props;
9139
+ const { i18n: i18n2 } = useTranslation();
9140
+ return errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(
9141
+ Alert,
9142
+ {
9143
+ message: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
9144
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title || i18n2.t(isEdit ? "dovetail.save_failed_tip" : "dovetail.create_failed_tip") }),
9145
+ errorMsgs.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errorMsgs.map((errorMsg, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
9146
+ index2 + 1 + ". ",
9147
+ " ",
9148
+ errorMsg
9149
+ ] }, errorMsg)) }) : first(errorMsgs)
9150
+ ] }),
9151
+ type: "error",
9152
+ style,
9153
+ className
9154
+ }
9155
+ ) : null;
9156
+ }
9157
+ var AccessControlAuth = /* @__PURE__ */ ((AccessControlAuth2) => {
9158
+ AccessControlAuth2["Edit"] = "Edit";
9159
+ AccessControlAuth2["Delete"] = "Delete";
9160
+ AccessControlAuth2["Create"] = "Create";
9161
+ return AccessControlAuth2;
9162
+ })(AccessControlAuth || {});
9163
+ function getCommonErrors(responseBody, i18n2) {
9164
+ var _a;
9165
+ if (!((responseBody == null ? void 0 : responseBody.message) || (responseBody == null ? void 0 : responseBody.code) || (responseBody == null ? void 0 : responseBody.reason) || (responseBody == null ? void 0 : responseBody.details) || (responseBody == null ? void 0 : responseBody.graphQLErrors))) {
9166
+ return [];
9167
+ }
9168
+ const causes = ((_a = responseBody.details) == null ? void 0 : _a.causes) || responseBody.graphQLErrors || [];
9169
+ if (causes.length) {
9170
+ return causes.map((cause) => {
9171
+ let params = {};
9172
+ let message2 = cause.message;
9173
+ try {
9174
+ const info = JSON.parse(cause.message);
9175
+ params = info.params;
9176
+ message2 = info.message;
9177
+ } catch {
9178
+ return i18n2.t(
9179
+ [
9180
+ `error.${cause.reason}`,
9181
+ `error.${cause.code}`,
9182
+ `${cause.field ? `${cause.field}: ` : ""}${message2}`
9183
+ ],
9184
+ {
9185
+ ...params,
9186
+ fallbackLng: ""
9187
+ }
9188
+ );
9189
+ }
9190
+ return i18n2.t(
9191
+ [
9192
+ `error.${cause.reason}`,
9193
+ `error.${cause.code}`,
9194
+ `${cause.field ? `${cause.field}: ` : ""}${message2}`
9195
+ ],
9196
+ {
9197
+ ...params,
9198
+ fallbackLng: ""
9199
+ }
9200
+ );
9201
+ });
9202
+ }
9203
+ return [
9204
+ i18n2.t(
9205
+ [`error.${responseBody.code}`, `error.${responseBody.reason}`, responseBody.message || ""],
9206
+ { fallbackLng: "" }
9207
+ )
9208
+ ];
9209
+ }
9210
+ function useSubmitForm(options) {
9211
+ const { formRef, onSubmitSuccess } = options;
9212
+ const { i18n: i18n2 } = useTranslation();
9213
+ const [submitting, setSubmitting] = useState(false);
9214
+ const [errorMsgs, setErrorMsgs] = useState([]);
9215
+ const reset = useCallback(() => {
9216
+ setSubmitting(false);
9217
+ setErrorMsgs([]);
9218
+ }, []);
9219
+ const onSubmit = useCallback(async () => {
9220
+ var _a;
9221
+ try {
9222
+ setSubmitting(true);
9223
+ const isFalsy = await ((_a = formRef.current) == null ? void 0 : _a.submit()) === false;
9224
+ if (isFalsy) {
9225
+ return;
9226
+ }
9227
+ onSubmitSuccess == null ? void 0 : onSubmitSuccess();
9228
+ reset();
9229
+ } catch (error) {
9230
+ if (error instanceof Object) {
9231
+ if ("response" in error && error.response instanceof Response) {
9232
+ const response = error.response;
9233
+ const body = await response.json();
9234
+ setErrorMsgs(getCommonErrors(body, i18n2));
9235
+ } else if ("message" in error && typeof error.message === "string") {
9236
+ setErrorMsgs([error.message]);
9237
+ }
9238
+ }
9239
+ } finally {
9240
+ setSubmitting(false);
9241
+ }
9242
+ }, [formRef, i18n2, reset, onSubmitSuccess]);
9243
+ return {
9244
+ submitting,
9245
+ errorMsgs,
9246
+ reset,
9247
+ onSubmit
9248
+ };
9249
+ }
9250
+ const index_10dq51k = "";
9251
+ const EditButtonStyle = "esoz3jw";
9252
+ function EditFieldModal(props) {
9253
+ const {
9254
+ title,
9255
+ formRef: form2,
9256
+ renderContent,
9257
+ fullscreen
9258
+ } = props;
9259
+ const {
9260
+ i18n: i18n2
9261
+ } = useTranslation();
9262
+ const popModal = usePopModal();
9263
+ const {
9264
+ submitting,
9265
+ errorMsgs,
9266
+ reset,
9267
+ onSubmit
9268
+ } = useSubmitForm({
9269
+ formRef: form2,
9270
+ onSubmitSuccess: () => {
9271
+ popModal();
9272
+ }
9273
+ });
9274
+ const close = useCallback(() => {
9275
+ popModal();
9276
+ reset();
9277
+ }, [reset]);
9278
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal, {
9279
+ className: fullscreen ? FullscreenModalStyle : SmallModalStyle,
9280
+ title: title || i18n2.t("dovetail.edit"),
9281
+ confirmLoading: submitting,
9282
+ onOk: onSubmit,
9283
+ onCancel: close,
9284
+ okText: i18n2.t("dovetail.save"),
9285
+ normal: true,
9286
+ destroyOnClose: true,
9287
+ fullscreen,
9288
+ children: [renderContent(), /* @__PURE__ */ jsxRuntimeExports.jsx(FormErrorAlert, {
9289
+ style: {
9290
+ marginTop: 16
9291
+ },
9292
+ errorMsgs,
9293
+ isEdit: true
9294
+ })]
9295
+ });
9296
+ }
9297
+ function EditField(props) {
9298
+ const {
9299
+ modalProps
9300
+ } = props;
9301
+ const {
9302
+ i18n: i18n2
9303
+ } = useTranslation();
9304
+ const {
9305
+ resource
9306
+ } = useResource();
9307
+ const pushModal = usePushModal();
9308
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
9309
+ resource: resource == null ? void 0 : resource.name,
9310
+ action: AccessControlAuth.Edit,
9311
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
9312
+ className: cx_default(EditButtonStyle, Typo.Label.l4_regular_title),
9313
+ type: "link",
9314
+ onClick: () => {
9315
+ pushModal({
9316
+ component: EditFieldModal,
9317
+ props: modalProps
9318
+ });
9319
+ },
9320
+ children: i18n2.t("dovetail.edit")
9321
+ })
9322
+ });
9323
+ }
9324
+ var StorageUnit = /* @__PURE__ */ ((StorageUnit2) => {
9325
+ StorageUnit2["Pi"] = "Pi";
9326
+ StorageUnit2["PiB"] = "PiB";
9327
+ StorageUnit2["Ti"] = "Ti";
9328
+ StorageUnit2["TiB"] = "TiB";
9329
+ StorageUnit2["Gi"] = "Gi";
9330
+ StorageUnit2["GiB"] = "GiB";
9331
+ StorageUnit2["Mi"] = "Mi";
9332
+ StorageUnit2["MiB"] = "MiB";
9333
+ StorageUnit2["Ki"] = "Ki";
9334
+ StorageUnit2["KiB"] = "KiB";
9335
+ return StorageUnit2;
9336
+ })(StorageUnit || {});
9337
+ const UNIT_FACTORS = {
9338
+ Pi: 1024 ** 5,
9339
+ PiB: 1024 ** 5,
9340
+ Ti: 1024 ** 4,
9341
+ TiB: 1024 ** 4,
9342
+ Gi: 1024 ** 3,
9343
+ GiB: 1024 ** 3,
9344
+ Mi: 1024 ** 2,
9345
+ MiB: 1024 ** 2,
9346
+ Ki: 1024,
9347
+ KiB: 1024,
9348
+ B: 1
9349
+ };
9350
+ function transformStorageUnit(value2, toUnit = "Gi") {
9351
+ const num = parseFloat(value2);
9352
+ const unit = Object.values(StorageUnit).find((u) => value2.includes(u)) || "Ki";
9353
+ return num / UNIT_FACTORS[unit] * UNIT_FACTORS[toUnit];
9354
+ }
9355
+ const UNITS = ["", "K", "M", "G", "T", "P"];
9356
+ const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
9357
+ function formatSi(inValue, options) {
9358
+ const {
9359
+ increment = 1e3,
9360
+ suffix = null,
9361
+ firstSuffix = null,
9362
+ startingExponent = 0,
9363
+ minExponent = 0,
9364
+ maxPrecision = 2,
9365
+ atLeastOne = true
9366
+ } = options || {};
9367
+ let val = inValue;
9368
+ let exp = startingExponent;
9369
+ while (val >= increment && exp + 1 < UNITS.length || exp < minExponent) {
9370
+ val = val / increment;
9371
+ exp++;
9372
+ }
9373
+ let out = 0;
9374
+ if (val < 10 && maxPrecision >= 2) {
9375
+ out = Math.round(val * 100) / 100;
9376
+ } else if (val < 100 && maxPrecision >= 1) {
9377
+ out = Math.round(val * 10) / 10;
9378
+ } else {
9379
+ out = Math.round(val);
9380
+ }
9381
+ if (atLeastOne && out === 0) {
9382
+ out = 1;
9383
+ }
9384
+ let outStr = String(out);
9385
+ if (exp === 0 && firstSuffix !== null) {
9386
+ outStr += `${firstSuffix}`;
9387
+ } else {
9388
+ outStr += `${UNITS[exp]}${suffix}` || "";
9389
+ }
9390
+ return outStr;
9391
+ }
9392
+ function parseSi(inValue, increment = null, allowFractional = true) {
9393
+ if (!inValue || typeof inValue !== "string" || !inValue.length) {
9394
+ return NaN;
9395
+ }
9396
+ inValue = inValue.replace(/,/g, "");
9397
+ let [, valStr, unit, incStr] = inValue.match(/^([0-9.-]+)\s*([^0-9.-]?)([^0-9.-]?)/) || [];
9398
+ const val = parseFloat(valStr);
9399
+ if (!unit) {
9400
+ return val;
9401
+ }
9402
+ if (unit.charCodeAt(0) === 181) {
9403
+ unit = "u";
9404
+ }
9405
+ const divide = FRACTIONAL.includes(unit);
9406
+ const multiply = UNITS.includes(unit.toUpperCase());
9407
+ if (increment === null) {
9408
+ if ((multiply || divide) && incStr === "i") {
9409
+ increment = 1024;
9410
+ } else {
9411
+ increment = 1e3;
9412
+ }
9413
+ }
9414
+ if (divide && allowFractional) {
9415
+ const exp = FRACTIONAL.indexOf(unit);
9416
+ return val / Math.pow(increment, exp);
9417
+ }
9418
+ if (multiply) {
9419
+ const exp = UNITS.indexOf(unit.toUpperCase());
9420
+ return val * Math.pow(increment, exp);
9421
+ }
9422
+ return val;
9423
+ }
9424
+ const DistributeStorageForm = React__default.forwardRef(function DistributeStorageForm2(props, ref) {
9425
+ const { defaultValue, pvc: pvc2 } = props;
9426
+ const { resource } = useResource();
9427
+ const { mutateAsync } = useUpdate();
9428
+ const { t: t2 } = useTranslation();
9429
+ const [distributeStorage, setDistributeStorage] = useState(defaultValue);
9430
+ const [validateResult, setValidateResult] = useState({
9431
+ distributeStorage: ""
9432
+ });
9433
+ const validators = useMemo(() => {
9434
+ return {
9435
+ distributeStorage(value2) {
9436
+ if (isNil(value2)) {
9437
+ return t2("dovetail.pvc_storage_required");
9438
+ } else if (value2 < 1) {
9439
+ return t2("dovetail.pvc_storage_min");
9440
+ } else if (value2 < defaultValue) {
9441
+ return t2("dovetail.pvc_storage_reduce_limit");
9442
+ }
9443
+ return "";
9444
+ }
9445
+ };
9446
+ }, [t2, defaultValue]);
9447
+ const submit = useCallback(() => {
9448
+ const isInvalid = !!validators.distributeStorage(distributeStorage);
9449
+ if (isInvalid) {
9450
+ return false;
9451
+ }
9452
+ const v = pvc2.updateDistributeStorage(distributeStorage);
9453
+ const id = pvc2.id;
9454
+ pruneBeforeEdit(v);
9455
+ return mutateAsync({
9456
+ id,
9457
+ resource: (resource == null ? void 0 : resource.name) || "",
9458
+ values: v,
9459
+ successNotification() {
9460
+ return {
9461
+ message: t2("dovetail.edit_distribute_storage_success_toast", {
9462
+ kind: pvc2.kind,
9463
+ name: pvc2.id,
9464
+ interpolation: {
9465
+ escapeValue: false
9466
+ }
9467
+ }),
9468
+ type: "success"
9469
+ };
9470
+ },
9471
+ errorNotification: false
9472
+ });
9473
+ }, [pvc2, distributeStorage, resource == null ? void 0 : resource.name, validators, mutateAsync, t2]);
9474
+ useImperativeHandle(ref, () => ({
9475
+ submit
9476
+ }), [submit]);
9477
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
9478
+ Form.Item,
9479
+ {
9480
+ label: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { width: "134px" }, children: t2("dovetail.distributed") }),
9481
+ colon: false,
9482
+ help: validateResult.distributeStorage,
9483
+ validateStatus: validateResult.distributeStorage ? "error" : "",
9484
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
9485
+ Fields.Integer,
9486
+ {
9487
+ style: { width: "142px" },
9488
+ input: {
9489
+ name: "distributeStorage",
9490
+ value: distributeStorage,
9491
+ onChange: (value2) => {
9492
+ const v = Number(value2);
9493
+ setDistributeStorage(v);
9494
+ setValidateResult({
9495
+ distributeStorage: validators.distributeStorage(v)
9496
+ });
9497
+ },
9498
+ onBlur: () => {
9499
+ },
9500
+ onFocus: () => {
9501
+ }
9502
+ },
9503
+ min: 1,
9504
+ meta: {},
9505
+ suffix: "GiB",
9506
+ controls: true
9507
+ }
9508
+ )
9509
+ }
9510
+ );
9511
+ });
9512
+ function PVCDistributeStorage({ pvc: pvc2, editable }) {
9513
+ var _a, _b;
9514
+ const { t: t2 } = useTranslation();
9515
+ const formRef = useRef(null);
9516
+ const value2 = (_b = (_a = pvc2.spec.resources) == null ? void 0 : _a.requests) == null ? void 0 : _b.storage;
9517
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
9518
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, { rawValue: parseSi(value2), decimals: 1 }),
9519
+ editable && /* @__PURE__ */ jsxRuntimeExports.jsx(
9520
+ EditField,
9521
+ {
9522
+ modalProps: {
9523
+ formRef,
9524
+ title: t2("dovetail.edit_replicas"),
9525
+ renderContent() {
9526
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
9527
+ DistributeStorageForm,
9528
+ {
9529
+ ref: formRef,
9530
+ defaultValue: value2 ? transformStorageUnit(value2, StorageUnit.Gi) : 0,
9531
+ pvc: pvc2
9532
+ }
9533
+ );
9534
+ }
9535
+ }
9536
+ }
9537
+ )
9538
+ ] });
9539
+ }
9095
9540
  class ResourceModel {
9096
9541
  constructor(_rawYaml, _globalStore) {
9097
9542
  __publicField(this, "id");
@@ -9728,34 +10173,72 @@ const NODE_INIT_VALUE = {
9728
10173
  const STORAGE_CLASS_INIT_VALUE = {
9729
10174
  "apiVersion": "storage.k8s.io/v1",
9730
10175
  "kind": "StorageClass",
10176
+ "metadata": {
10177
+ "name": "example"
10178
+ },
10179
+ "parameters": {},
10180
+ "provisioner": "example",
10181
+ "reclaimPolicy": "Delete",
10182
+ "allowVolumeExpansion": true,
10183
+ "volumeBindingMode": "Immediate"
10184
+ };
10185
+ const PV_INIT_VALUE = {
10186
+ "apiVersion": "v1",
10187
+ "kind": "PersistentVolume",
10188
+ "metadata": {
10189
+ "name": "example"
10190
+ },
10191
+ "spec": {
10192
+ "accessModes": [
10193
+ "ReadWriteOnce"
10194
+ ],
10195
+ "capacity": {
10196
+ "storage": "40Gi"
10197
+ },
10198
+ "persistentVolumeReclaimPolicy": "Delete",
10199
+ "volumeMode": "Filesystem"
10200
+ }
10201
+ };
10202
+ const PVC_INIT_VALUE = {
10203
+ "apiVersion": "v1",
10204
+ "kind": "PersistentVolumeClaim",
9731
10205
  "metadata": {
9732
10206
  "name": "example",
9733
10207
  "namespace": "default"
9734
10208
  },
9735
- "spec": {}
10209
+ "spec": {
10210
+ "accessModes": [
10211
+ "ReadWriteOnce"
10212
+ ],
10213
+ "resources": {
10214
+ "requests": {
10215
+ "storage": "40Gi"
10216
+ }
10217
+ },
10218
+ "storageClassName": "example"
10219
+ }
9736
10220
  };
9737
- var WorkloadState = /* @__PURE__ */ ((WorkloadState2) => {
9738
- WorkloadState2["Terminated"] = "terminated";
9739
- WorkloadState2["UPDATING"] = "updating";
9740
- WorkloadState2["READY"] = "ready";
9741
- WorkloadState2["COMPLETED"] = "completed";
9742
- WorkloadState2["FAILED"] = "failed";
9743
- WorkloadState2["SUSPENDED"] = "suspended";
9744
- WorkloadState2["RUNNING"] = "running";
9745
- WorkloadState2["SUCCEEDED"] = "succeeded";
9746
- WorkloadState2["UNKNOWN"] = "unknown";
9747
- WorkloadState2["TERMINATING"] = "terminating";
9748
- WorkloadState2["PENDING"] = "pending";
9749
- WorkloadState2["WAITING"] = "waiting";
9750
- WorkloadState2["STOPPED"] = "stopped";
9751
- return WorkloadState2;
9752
- })(WorkloadState || {});
9753
- var AccessControlAuth = /* @__PURE__ */ ((AccessControlAuth2) => {
9754
- AccessControlAuth2["Edit"] = "Edit";
9755
- AccessControlAuth2["Delete"] = "Delete";
9756
- AccessControlAuth2["Create"] = "Create";
9757
- return AccessControlAuth2;
9758
- })(AccessControlAuth || {});
10221
+ var ResourceState = /* @__PURE__ */ ((ResourceState2) => {
10222
+ ResourceState2["TERMINATED"] = "terminated";
10223
+ ResourceState2["UPDATING"] = "updating";
10224
+ ResourceState2["READY"] = "ready";
10225
+ ResourceState2["COMPLETED"] = "completed";
10226
+ ResourceState2["ABNORMAL"] = "abnormal";
10227
+ ResourceState2["FAILED"] = "failed";
10228
+ ResourceState2["SUSPENDED"] = "suspended";
10229
+ ResourceState2["RUNNING"] = "running";
10230
+ ResourceState2["SUCCEEDED"] = "succeeded";
10231
+ ResourceState2["UNKNOWN"] = "unknown";
10232
+ ResourceState2["TERMINATING"] = "terminating";
10233
+ ResourceState2["PENDING"] = "pending";
10234
+ ResourceState2["WAITING"] = "waiting";
10235
+ ResourceState2["STOPPED"] = "stopped";
10236
+ ResourceState2["AVAILABLE"] = "available";
10237
+ ResourceState2["BOUND"] = "bound";
10238
+ ResourceState2["RELEASED"] = "released";
10239
+ ResourceState2["LOST"] = "lost";
10240
+ return ResourceState2;
10241
+ })(ResourceState || {});
9759
10242
  function matchSelector(pod2, selector, namespace2 = "default") {
9760
10243
  var _a, _b, _c;
9761
10244
  let match = true;
@@ -9841,18 +10324,18 @@ class JobModel extends WorkloadBaseModel {
9841
10324
  get stateDisplay() {
9842
10325
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9843
10326
  if (!((_a = this.spec) == null ? void 0 : _a.completions) && !((_b = this.status) == null ? void 0 : _b.succeeded)) {
9844
- return WorkloadState.RUNNING;
10327
+ return ResourceState.RUNNING;
9845
10328
  }
9846
10329
  if (((_c = this.spec) == null ? void 0 : _c.completions) === ((_d = this.status) == null ? void 0 : _d.succeeded) || ((_f = (_e = this.status) == null ? void 0 : _e.conditions) == null ? void 0 : _f.some((c2) => c2.type === "Complete" && c2.status === "True"))) {
9847
- return WorkloadState.COMPLETED;
10330
+ return ResourceState.COMPLETED;
9848
10331
  }
9849
10332
  if ((_h = (_g = this.status) == null ? void 0 : _g.conditions) == null ? void 0 : _h.some((c2) => c2.type === "Failed" && c2.status === "True")) {
9850
- return WorkloadState.FAILED;
10333
+ return ResourceState.ABNORMAL;
9851
10334
  }
9852
10335
  if ((_j = (_i = this.status) == null ? void 0 : _i.conditions) == null ? void 0 : _j.some((c2) => c2.type === "Suspended" && c2.status === "True")) {
9853
- return WorkloadState.SUSPENDED;
10336
+ return ResourceState.SUSPENDED;
9854
10337
  }
9855
- return WorkloadState.RUNNING;
10338
+ return ResourceState.RUNNING;
9856
10339
  }
9857
10340
  }
9858
10341
  class WorkloadModel extends WorkloadBaseModel {
@@ -9904,75 +10387,6 @@ class WorkloadModel extends WorkloadBaseModel {
9904
10387
  return newOne;
9905
10388
  }
9906
10389
  }
9907
- const UNITS = ["", "K", "M", "G", "T", "P"];
9908
- const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
9909
- function formatSi(inValue, options) {
9910
- const {
9911
- increment = 1e3,
9912
- suffix = null,
9913
- firstSuffix = null,
9914
- startingExponent = 0,
9915
- minExponent = 0,
9916
- maxPrecision = 2,
9917
- atLeastOne = true
9918
- } = options || {};
9919
- let val = inValue;
9920
- let exp = startingExponent;
9921
- while (val >= increment && exp + 1 < UNITS.length || exp < minExponent) {
9922
- val = val / increment;
9923
- exp++;
9924
- }
9925
- let out = 0;
9926
- if (val < 10 && maxPrecision >= 2) {
9927
- out = Math.round(val * 100) / 100;
9928
- } else if (val < 100 && maxPrecision >= 1) {
9929
- out = Math.round(val * 10) / 10;
9930
- } else {
9931
- out = Math.round(val);
9932
- }
9933
- if (atLeastOne && out === 0) {
9934
- out = 1;
9935
- }
9936
- let outStr = String(out);
9937
- if (exp === 0 && firstSuffix !== null) {
9938
- outStr += `${firstSuffix}`;
9939
- } else {
9940
- outStr += `${UNITS[exp]}${suffix}` || "";
9941
- }
9942
- return outStr;
9943
- }
9944
- function parseSi(inValue, increment = null, allowFractional = true) {
9945
- if (!inValue || typeof inValue !== "string" || !inValue.length) {
9946
- return NaN;
9947
- }
9948
- inValue = inValue.replace(/,/g, "");
9949
- let [, valStr, unit, incStr] = inValue.match(/^([0-9.-]+)\s*([^0-9.-]?)([^0-9.-]?)/) || [];
9950
- const val = parseFloat(valStr);
9951
- if (!unit) {
9952
- return val;
9953
- }
9954
- if (unit.charCodeAt(0) === 181) {
9955
- unit = "u";
9956
- }
9957
- const divide = FRACTIONAL.includes(unit);
9958
- const multiply = UNITS.includes(unit.toUpperCase());
9959
- if (increment === null) {
9960
- if ((multiply || divide) && incStr === "i") {
9961
- increment = 1024;
9962
- } else {
9963
- increment = 1e3;
9964
- }
9965
- }
9966
- if (divide && allowFractional) {
9967
- const exp = FRACTIONAL.indexOf(unit);
9968
- return val / Math.pow(increment, exp);
9969
- }
9970
- if (multiply) {
9971
- const exp = UNITS.indexOf(unit.toUpperCase());
9972
- return val * Math.pow(increment, exp);
9973
- }
9974
- return val;
9975
- }
9976
10390
  class PodModel extends WorkloadBaseModel {
9977
10391
  constructor(_rawYaml, _globalStore) {
9978
10392
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
@@ -10050,9 +10464,9 @@ class PodModel extends WorkloadBaseModel {
10050
10464
  get stateDisplay() {
10051
10465
  var _a, _b;
10052
10466
  if (this.metadata.deletionTimestamp) {
10053
- return WorkloadState.TERMINATING;
10467
+ return ResourceState.TERMINATING;
10054
10468
  }
10055
- return ((_b = (_a = this.status) == null ? void 0 : _a.phase) == null ? void 0 : _b.toLowerCase()) || WorkloadState.UNKNOWN;
10469
+ return ((_b = (_a = this.status) == null ? void 0 : _a.phase) == null ? void 0 : _b.toLowerCase()) || ResourceState.UNKNOWN;
10056
10470
  }
10057
10471
  }
10058
10472
  class PodMetricsModel extends ResourceModel {
@@ -10092,9 +10506,9 @@ class CronJobModel extends WorkloadBaseModel {
10092
10506
  get stateDisplay() {
10093
10507
  var _a;
10094
10508
  if ((_a = this.spec) == null ? void 0 : _a.suspend) {
10095
- return WorkloadState.SUSPENDED;
10509
+ return ResourceState.SUSPENDED;
10096
10510
  }
10097
- return WorkloadState.RUNNING;
10511
+ return ResourceState.RUNNING;
10098
10512
  }
10099
10513
  suspend() {
10100
10514
  const newOne = lodashExports.cloneDeep(this._rawYaml);
@@ -10126,11 +10540,11 @@ class DeploymentModel extends WorkloadModel {
10126
10540
  get stateDisplay() {
10127
10541
  var _a, _b, _c;
10128
10542
  if (((_a = this.spec) == null ? void 0 : _a.replicas) === 0) {
10129
- return WorkloadState.STOPPED;
10543
+ return ResourceState.STOPPED;
10130
10544
  } else if (((_b = this.spec) == null ? void 0 : _b.replicas) !== ((_c = this.status) == null ? void 0 : _c.readyReplicas)) {
10131
- return WorkloadState.UPDATING;
10545
+ return ResourceState.UPDATING;
10132
10546
  }
10133
- return WorkloadState.READY;
10547
+ return ResourceState.READY;
10134
10548
  }
10135
10549
  }
10136
10550
  class DaemonSetModel extends WorkloadModel {
@@ -10141,9 +10555,9 @@ class DaemonSetModel extends WorkloadModel {
10141
10555
  get stateDisplay() {
10142
10556
  var _a, _b;
10143
10557
  if (((_a = this.status) == null ? void 0 : _a.desiredNumberScheduled) !== ((_b = this.status) == null ? void 0 : _b.numberReady)) {
10144
- return WorkloadState.UPDATING;
10558
+ return ResourceState.UPDATING;
10145
10559
  }
10146
- return WorkloadState.READY;
10560
+ return ResourceState.READY;
10147
10561
  }
10148
10562
  get replicas() {
10149
10563
  return this.status && "desiredNumberScheduled" in this.status ? this.status.desiredNumberScheduled : 0;
@@ -10160,11 +10574,11 @@ class StatefulSetModel extends WorkloadModel {
10160
10574
  get stateDisplay() {
10161
10575
  var _a, _b, _c;
10162
10576
  if (((_a = this.spec) == null ? void 0 : _a.replicas) === 0) {
10163
- return WorkloadState.STOPPED;
10577
+ return ResourceState.STOPPED;
10164
10578
  } else if (((_b = this.spec) == null ? void 0 : _b.replicas) !== ((_c = this.status) == null ? void 0 : _c.readyReplicas)) {
10165
- return WorkloadState.UPDATING;
10579
+ return ResourceState.UPDATING;
10166
10580
  }
10167
- return WorkloadState.READY;
10581
+ return ResourceState.READY;
10168
10582
  }
10169
10583
  }
10170
10584
  var ServiceTypeEnum = /* @__PURE__ */ ((ServiceTypeEnum2) => {
@@ -10213,7 +10627,7 @@ var NodeRole = /* @__PURE__ */ ((NodeRole2) => {
10213
10627
  NodeRole2["Worker"] = "Worker";
10214
10628
  return NodeRole2;
10215
10629
  })(NodeRole || {});
10216
- class NodeModel extends WorkloadBaseModel {
10630
+ class NodeModel extends ResourceModel {
10217
10631
  constructor(_rawYaml, _globalStore) {
10218
10632
  super(_rawYaml, _globalStore);
10219
10633
  this._rawYaml = _rawYaml;
@@ -10248,24 +10662,85 @@ class StorageClassModel extends ResourceModel {
10248
10662
  kind: "PersistentVolume"
10249
10663
  });
10250
10664
  this.pvs = pvs.items.filter(
10251
- (pv) => {
10252
- var _a;
10253
- return ((_a = pv.spec) == null ? void 0 : _a.storageClassName) === this.metadata.name;
10254
- }
10665
+ (pv2) => this.filterPV(pv2, this.metadata.name)
10255
10666
  );
10256
10667
  }
10668
+ filterPV(pv2, scName) {
10669
+ var _a;
10670
+ return ((_a = pv2.spec) == null ? void 0 : _a.storageClassName) === scName;
10671
+ }
10672
+ get isDefaultSC() {
10673
+ var _a, _b;
10674
+ return (_b = (_a = this._rawYaml.metadata) == null ? void 0 : _a.annotations) == null ? void 0 : _b["storageclass.kubernetes.io/is-default-class"];
10675
+ }
10676
+ get reclaimPolicy() {
10677
+ return this._rawYaml.reclaimPolicy;
10678
+ }
10257
10679
  }
10258
10680
  class PersistentVolumeModel extends ResourceModel {
10259
10681
  constructor(_rawYaml, _globalStore) {
10260
10682
  super(_rawYaml, _globalStore);
10261
10683
  this._rawYaml = _rawYaml;
10262
10684
  }
10685
+ get phase() {
10686
+ return this._rawYaml.status.phase;
10687
+ }
10688
+ get stateDisplay() {
10689
+ switch (this.phase) {
10690
+ case "Pending":
10691
+ return ResourceState.PENDING;
10692
+ case "Bound":
10693
+ return ResourceState.BOUND;
10694
+ case "Failed":
10695
+ return ResourceState.FAILED;
10696
+ case "Available":
10697
+ return ResourceState.AVAILABLE;
10698
+ case "Released":
10699
+ return ResourceState.RELEASED;
10700
+ default:
10701
+ return ResourceState.UNKNOWN;
10702
+ }
10703
+ }
10704
+ get csi() {
10705
+ var _a;
10706
+ return (_a = this._rawYaml.spec.csi) == null ? void 0 : _a.driver;
10707
+ }
10708
+ get pvc() {
10709
+ var _a;
10710
+ return (_a = this._rawYaml.spec.claimRef) == null ? void 0 : _a.name;
10711
+ }
10712
+ get pvcNamespace() {
10713
+ var _a;
10714
+ return (_a = this._rawYaml.spec.claimRef) == null ? void 0 : _a.namespace;
10715
+ }
10263
10716
  }
10264
10717
  class PersistentVolumeClaimModel extends ResourceModel {
10265
10718
  constructor(_rawYaml, _globalStore) {
10266
10719
  super(_rawYaml, _globalStore);
10267
10720
  this._rawYaml = _rawYaml;
10268
10721
  }
10722
+ get phase() {
10723
+ return this._rawYaml.status.phase;
10724
+ }
10725
+ get pv() {
10726
+ return this._rawYaml.spec.volumeName;
10727
+ }
10728
+ get stateDisplay() {
10729
+ switch (this.phase) {
10730
+ case "Pending":
10731
+ return ResourceState.PENDING;
10732
+ case "Bound":
10733
+ return ResourceState.BOUND;
10734
+ case "Lost":
10735
+ return ResourceState.LOST;
10736
+ case "Failed":
10737
+ return ResourceState.FAILED;
10738
+ }
10739
+ }
10740
+ updateDistributeStorage(distributeStorage) {
10741
+ const yaml2 = cloneDeep(this._globalStore.restoreItem(this));
10742
+ return set$1(yaml2, "spec.resources.requests.storage", `${distributeStorage}Gi`);
10743
+ }
10269
10744
  }
10270
10745
  const index_1iq0dq9 = "";
10271
10746
  const ServiceInClusterAccessComponent = ({
@@ -10373,38 +10848,8 @@ const Tags = (props) => {
10373
10848
  children: tags
10374
10849
  });
10375
10850
  };
10376
- const StateTag_1o2atxo = "";
10377
- const StateTagStyle = "s8qkbck";
10378
- const StateTag = ({
10379
- state: state2 = WorkloadState.UPDATING,
10380
- hideBackground,
10381
- className
10382
- }) => {
10383
- const {
10384
- t: t2
10385
- } = useTranslation();
10386
- const statusMap = {
10387
- updating: "loading",
10388
- ready: "green",
10389
- completed: "gray",
10390
- failed: "red",
10391
- suspended: "warning",
10392
- running: "green",
10393
- succeeded: "blue",
10394
- unknown: "gray",
10395
- terminating: "loading",
10396
- pending: "warning",
10397
- waiting: "warning",
10398
- terminated: "red",
10399
- stopped: "gray"
10400
- };
10401
- return /* @__PURE__ */ jsxRuntimeExports.jsx(StatusCapsule, {
10402
- className: cx_default(className, StateTagStyle, hideBackground && "no-background"),
10403
- color: statusMap[state2] !== "loading" ? statusMap[state2] : void 0,
10404
- loading: statusMap[state2] === "loading",
10405
- children: t2(`dovetail.${state2 || "updating"}`)
10406
- });
10407
- };
10851
+ const tag_how7no = "";
10852
+ const StateTagStyle = "s82411";
10408
10853
  function addId(arr, idKey) {
10409
10854
  return arr.map((e2) => {
10410
10855
  return {
@@ -10522,7 +10967,7 @@ const Time = (props) => {
10522
10967
  const ConditionsTable = ({ conditions = [] }) => {
10523
10968
  const { t: t2 } = useTranslation();
10524
10969
  const component = useContext(ComponentContext);
10525
- const Table$12 = component.Table || Table;
10970
+ const Table2 = component.Table || Table$1;
10526
10971
  const conditionsWithId = addId(conditions, "type");
10527
10972
  const columns = [
10528
10973
  {
@@ -10598,7 +11043,7 @@ const ConditionsTable = ({ conditions = [] }) => {
10598
11043
  );
10599
11044
  }
10600
11045
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
10601
- Table$12,
11046
+ Table2,
10602
11047
  {
10603
11048
  tableKey: "condition",
10604
11049
  loading: false,
@@ -10715,184 +11160,6 @@ function useOpenForm(options) {
10715
11160
  }
10716
11161
  };
10717
11162
  }
10718
- function FormErrorAlert(props) {
10719
- const { title, errorMsgs, style, className, isEdit } = props;
10720
- const { i18n: i18n2 } = useTranslation();
10721
- return errorMsgs.length ? /* @__PURE__ */ jsxRuntimeExports.jsx(
10722
- Alert,
10723
- {
10724
- message: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10725
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title || i18n2.t(isEdit ? "dovetail.save_failed_tip" : "dovetail.create_failed_tip") }),
10726
- errorMsgs.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errorMsgs.map((errorMsg, index2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
10727
- index2 + 1 + ". ",
10728
- " ",
10729
- errorMsg
10730
- ] }, errorMsg)) }) : first(errorMsgs)
10731
- ] }),
10732
- type: "error",
10733
- style,
10734
- className
10735
- }
10736
- ) : null;
10737
- }
10738
- function getCommonErrors(responseBody, i18n2) {
10739
- var _a;
10740
- if (!((responseBody == null ? void 0 : responseBody.message) || (responseBody == null ? void 0 : responseBody.code) || (responseBody == null ? void 0 : responseBody.reason) || (responseBody == null ? void 0 : responseBody.details) || (responseBody == null ? void 0 : responseBody.graphQLErrors))) {
10741
- return [];
10742
- }
10743
- const causes = ((_a = responseBody.details) == null ? void 0 : _a.causes) || responseBody.graphQLErrors || [];
10744
- if (causes.length) {
10745
- return causes.map((cause) => {
10746
- let params = {};
10747
- let message2 = cause.message;
10748
- try {
10749
- const info = JSON.parse(cause.message);
10750
- params = info.params;
10751
- message2 = info.message;
10752
- } catch {
10753
- return i18n2.t(
10754
- [
10755
- `error.${cause.reason}`,
10756
- `error.${cause.code}`,
10757
- `${cause.field ? `${cause.field}: ` : ""}${message2}`
10758
- ],
10759
- {
10760
- ...params,
10761
- fallbackLng: ""
10762
- }
10763
- );
10764
- }
10765
- return i18n2.t(
10766
- [
10767
- `error.${cause.reason}`,
10768
- `error.${cause.code}`,
10769
- `${cause.field ? `${cause.field}: ` : ""}${message2}`
10770
- ],
10771
- {
10772
- ...params,
10773
- fallbackLng: ""
10774
- }
10775
- );
10776
- });
10777
- }
10778
- return [
10779
- i18n2.t(
10780
- [`error.${responseBody.code}`, `error.${responseBody.reason}`, responseBody.message || ""],
10781
- { fallbackLng: "" }
10782
- )
10783
- ];
10784
- }
10785
- function useSubmitForm(options) {
10786
- const { formRef, onSubmitSuccess } = options;
10787
- const { i18n: i18n2 } = useTranslation();
10788
- const [submitting, setSubmitting] = useState(false);
10789
- const [errorMsgs, setErrorMsgs] = useState([]);
10790
- const reset = useCallback(() => {
10791
- setSubmitting(false);
10792
- setErrorMsgs([]);
10793
- }, []);
10794
- const onSubmit = useCallback(async () => {
10795
- var _a;
10796
- try {
10797
- setSubmitting(true);
10798
- await ((_a = formRef.current) == null ? void 0 : _a.submit());
10799
- onSubmitSuccess == null ? void 0 : onSubmitSuccess();
10800
- reset();
10801
- } catch (error) {
10802
- if (error instanceof Object) {
10803
- if ("response" in error && error.response instanceof Response) {
10804
- const response = error.response;
10805
- const body = await response.json();
10806
- setErrorMsgs(getCommonErrors(body, i18n2));
10807
- } else if ("message" in error && typeof error.message === "string") {
10808
- setErrorMsgs([error.message]);
10809
- }
10810
- }
10811
- } finally {
10812
- setSubmitting(false);
10813
- }
10814
- }, [formRef, i18n2, reset, onSubmitSuccess]);
10815
- return {
10816
- submitting,
10817
- errorMsgs,
10818
- reset,
10819
- onSubmit
10820
- };
10821
- }
10822
- const index_130sdg8 = "";
10823
- const EditButtonStyle = "esoz3jw";
10824
- function EditFieldModal(props) {
10825
- const {
10826
- title,
10827
- formRef: form2,
10828
- renderContent,
10829
- fullscreen
10830
- } = props;
10831
- const {
10832
- i18n: i18n2
10833
- } = useTranslation();
10834
- const popModal = usePopModal();
10835
- const {
10836
- submitting,
10837
- errorMsgs,
10838
- reset,
10839
- onSubmit
10840
- } = useSubmitForm({
10841
- formRef: form2,
10842
- onSubmitSuccess: () => {
10843
- popModal();
10844
- }
10845
- });
10846
- const close = useCallback(() => {
10847
- popModal();
10848
- reset();
10849
- }, [reset]);
10850
- return /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal, {
10851
- className: fullscreen ? FullscreenModalStyle : SmallModalStyle,
10852
- title: title || i18n2.t("dovetail.edit"),
10853
- confirmLoading: submitting,
10854
- onOk: onSubmit,
10855
- onCancel: close,
10856
- okText: i18n2.t("dovetail.save"),
10857
- normal: true,
10858
- destroyOnClose: true,
10859
- fullscreen,
10860
- children: [renderContent(), /* @__PURE__ */ jsxRuntimeExports.jsx(FormErrorAlert, {
10861
- style: {
10862
- marginTop: 16
10863
- },
10864
- errorMsgs,
10865
- isEdit: true
10866
- })]
10867
- });
10868
- }
10869
- function EditField(props) {
10870
- const {
10871
- modalProps
10872
- } = props;
10873
- const {
10874
- i18n: i18n2
10875
- } = useTranslation();
10876
- const {
10877
- resource
10878
- } = useResource();
10879
- const pushModal = usePushModal();
10880
- return /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
10881
- resource: resource == null ? void 0 : resource.name,
10882
- action: AccessControlAuth.Edit,
10883
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
10884
- className: EditButtonStyle,
10885
- type: "link",
10886
- onClick: () => {
10887
- pushModal({
10888
- component: EditFieldModal,
10889
- props: modalProps
10890
- });
10891
- },
10892
- children: i18n2.t("dovetail.edit")
10893
- })
10894
- });
10895
- }
10896
11163
  const EditLabelForm = React__default.forwardRef(
10897
11164
  function EditLabelForm2(props, ref) {
10898
11165
  var _a;
@@ -10953,12 +11220,12 @@ const EditLabelForm = React__default.forwardRef(
10953
11220
  columns: [
10954
11221
  {
10955
11222
  key: "key",
10956
- title: "Key",
11223
+ title: t2("dovetail.key"),
10957
11224
  type: "input"
10958
11225
  },
10959
11226
  {
10960
11227
  key: "value",
10961
- title: "Value",
11228
+ title: t2("dovetail.value"),
10962
11229
  type: "input"
10963
11230
  }
10964
11231
  ],
@@ -11025,7 +11292,7 @@ const EditAnnotationForm = React__default.forwardRef(
11025
11292
  value2.forEach(({ key: key2, value: value22 }) => {
11026
11293
  newAnnotations[key2] = value22;
11027
11294
  });
11028
- const newYaml = resourceModel.updateLabel(newAnnotations);
11295
+ const newYaml = resourceModel.updateAnnotation(newAnnotations);
11029
11296
  pruneBeforeEdit(newYaml);
11030
11297
  return mutateAsync({
11031
11298
  id: resourceModel.id,
@@ -11066,12 +11333,12 @@ const EditAnnotationForm = React__default.forwardRef(
11066
11333
  columns: [
11067
11334
  {
11068
11335
  key: "key",
11069
- title: "Key",
11336
+ title: t2("dovetail.key"),
11070
11337
  type: "input"
11071
11338
  },
11072
11339
  {
11073
11340
  key: "value",
11074
- title: "Value",
11341
+ title: t2("dovetail.value"),
11075
11342
  type: "input"
11076
11343
  }
11077
11344
  ],
@@ -11224,21 +11491,23 @@ function addDefaultRenderToColumns(columns) {
11224
11491
  }));
11225
11492
  }
11226
11493
  const useEagleTable = (params) => {
11227
- var _a, _b;
11494
+ var _a, _b, _c;
11228
11495
  const { columns, tableProps, formatter, Dropdown: Dropdown2 = K8sDropdown } = params;
11229
11496
  const [selectedKeys, setSelectedKeys] = useState([]);
11230
11497
  const [currentPage, setCurrentPage] = useState((tableProps == null ? void 0 : tableProps.currentPage) || 1);
11231
11498
  const { resource } = useResource();
11232
11499
  const currentSize = (tableProps == null ? void 0 : tableProps.defaultSize) || 10;
11233
11500
  const useTableParams = useMemo(() => {
11501
+ var _a2;
11234
11502
  const mergedParams = merge(params.useTableParams, {
11235
11503
  pagination: {
11236
11504
  pageSize: currentSize,
11237
11505
  mode: "server"
11238
- }
11506
+ },
11507
+ resource: ((_a2 = params.useTableParams) == null ? void 0 : _a2.resource) || (resource == null ? void 0 : resource.name)
11239
11508
  });
11240
11509
  return mergedParams;
11241
- }, [params.useTableParams, currentSize]);
11510
+ }, [params.useTableParams, currentSize, resource]);
11242
11511
  const finalColumns = useMemo(
11243
11512
  () => addDefaultRenderToColumns(columns),
11244
11513
  [columns]
@@ -11268,7 +11537,7 @@ const useEagleTable = (params) => {
11268
11537
  const total = ((_b = table.tableQueryResult.data) == null ? void 0 : _b.total) || 0;
11269
11538
  const finalDataSource = formatter ? data2 == null ? void 0 : data2.map(formatter) : data2;
11270
11539
  const finalProps = {
11271
- tableKey: (resource == null ? void 0 : resource.name) || "table",
11540
+ tableKey: ((_c = params.useTableParams) == null ? void 0 : _c.resource) || (resource == null ? void 0 : resource.name) || "table",
11272
11541
  loading: table.tableQueryResult.isLoading,
11273
11542
  data: finalDataSource || [],
11274
11543
  columns: finalColumns,
@@ -11293,18 +11562,19 @@ const useEagleTable = (params) => {
11293
11562
  }, []);
11294
11563
  return { tableProps: finalProps, selectedKeys, ...table };
11295
11564
  };
11296
- function CreateButton() {
11565
+ function CreateButton(props) {
11297
11566
  var _a;
11298
11567
  const { t: t2 } = useTranslation();
11299
11568
  const openForm = useOpenForm();
11300
11569
  const { resource } = useResource();
11570
+ const label2 = props.label || ((_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind);
11301
11571
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11302
11572
  Button,
11303
11573
  {
11304
11574
  prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(PlusAddCreateNew16BoldOntintIcon, {}),
11305
11575
  type: "primary",
11306
11576
  onClick: openForm,
11307
- children: t2("dovetail.create_resource", { resource: (_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind })
11577
+ children: t2("dovetail.create_resource", { resource: /^[a-zA-Z]/.test(label2) ? ` ${label2}` : label2 })
11308
11578
  }
11309
11579
  );
11310
11580
  }
@@ -11351,12 +11621,13 @@ const DeleteManyButton = (props) => {
11351
11621
  visible ? /* @__PURE__ */ jsxRuntimeExports.jsx(Modal, { ...modalProps }) : null
11352
11622
  ] });
11353
11623
  };
11354
- const TableToolBar_nvjftd = "";
11355
- const ToolbarWrapperStyle = "t1v3ienx";
11356
- const ToolbarStyle$3 = "tgejfwe";
11357
- const TitleStyle$2 = "tq6dc79";
11358
- const DescriptionStyle = "d1wqyhgc";
11624
+ const index_1wo1wv1 = "";
11625
+ const ToolbarWrapperStyle = "t1908hhn";
11626
+ const ToolbarStyle$3 = "t1ym1gqo";
11627
+ const TitleStyle$2 = "t38ugwl";
11628
+ const DescriptionStyle = "d13nfex0";
11359
11629
  const TableToolBar = ({
11630
+ title,
11360
11631
  description,
11361
11632
  selectedKeys,
11362
11633
  hideCreate
@@ -11371,14 +11642,16 @@ const TableToolBar = ({
11371
11642
  className: ToolbarStyle$3,
11372
11643
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx("span", {
11373
11644
  className: cx_default(Typo.Display.d2_regular_title, TitleStyle$2),
11374
- children: (_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind
11645
+ children: title || ((_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind)
11375
11646
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, {
11376
11647
  children: [selectedKeys.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteManyButton, {
11377
11648
  ids: selectedKeys
11378
11649
  }) : void 0, /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
11379
11650
  resource: resource == null ? void 0 : resource.name,
11380
11651
  action: AccessControlAuth.Create,
11381
- children: !hideCreate ? /* @__PURE__ */ jsxRuntimeExports.jsx(CreateButton, {}) : null
11652
+ children: !hideCreate ? /* @__PURE__ */ jsxRuntimeExports.jsx(CreateButton, {
11653
+ label: title
11654
+ }) : null
11382
11655
  })]
11383
11656
  })]
11384
11657
  }), description ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
@@ -11409,7 +11682,7 @@ const CronjobJobsTable = ({
11409
11682
  } = useTranslation();
11410
11683
  const [selectedKeys] = useState([]);
11411
11684
  const component = useContext(ComponentContext);
11412
- const Table$12 = component.Table || Table;
11685
+ const Table2 = component.Table || Table$1;
11413
11686
  const columns = useMemo(() => [NameColumnRenderer(i18n2, "jobs"), StateDisplayColumnRenderer(i18n2), NameSpaceColumnRenderer(i18n2), {
11414
11687
  ...WorkloadImageColumnRenderer(i18n2),
11415
11688
  width: 238
@@ -11450,7 +11723,7 @@ const CronjobJobsTable = ({
11450
11723
  children: [hideToolBar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
11451
11724
  selectedKeys,
11452
11725
  hideCreate: true
11453
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Table$12, {
11726
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Table2, {
11454
11727
  ...tableProps,
11455
11728
  tableKey: "cronjobs",
11456
11729
  showMenuColumn: false
@@ -11524,7 +11797,7 @@ const EventsTable = ({ uid }) => {
11524
11797
  }), [columns, uid]);
11525
11798
  const { tableProps } = useEagleTable(params);
11526
11799
  const component = useContext(ComponentContext);
11527
- const Table$12 = component.Table || Table;
11800
+ const Table2 = component.Table || Table$1;
11528
11801
  if (!((_a = tableProps.data) == null ? void 0 : _a.length) && !tableProps.loading) {
11529
11802
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11530
11803
  WidgetErrorContent,
@@ -11534,7 +11807,7 @@ const EventsTable = ({ uid }) => {
11534
11807
  );
11535
11808
  }
11536
11809
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11537
- Table$12,
11810
+ Table2,
11538
11811
  {
11539
11812
  ...tableProps,
11540
11813
  tableKey: "events",
@@ -11577,9 +11850,9 @@ const index_x36tts = "";
11577
11850
  const LinkStyle = "l1vnw9x0";
11578
11851
  const ResourceLink = (props) => {
11579
11852
  const {
11580
- resourceName,
11853
+ resourceKind: resourceName,
11581
11854
  namespace: namespace2,
11582
- resourceId
11855
+ name: resourceId
11583
11856
  } = props;
11584
11857
  const navigation = useNavigation();
11585
11858
  const go = useGo();
@@ -11606,7 +11879,7 @@ const IngressRulesTable = ({ ingress }) => {
11606
11879
  return addId(ingress.flattenedRules || [], "fullPath");
11607
11880
  }, [ingress.flattenedRules]);
11608
11881
  const component = useContext(ComponentContext);
11609
- const Table$12 = component.Table || Table;
11882
+ const Table2 = component.Table || Table$1;
11610
11883
  const currentSize = 10;
11611
11884
  const columns = [
11612
11885
  {
@@ -11639,9 +11912,9 @@ const IngressRulesTable = ({ ingress }) => {
11639
11912
  return record.serviceName ? /* @__PURE__ */ jsxRuntimeExports.jsx(
11640
11913
  ResourceLink,
11641
11914
  {
11642
- resourceName: "services",
11915
+ resourceKind: "services",
11643
11916
  namespace: ingress.metadata.namespace || "default",
11644
- resourceId: serviceName
11917
+ name: serviceName
11645
11918
  }
11646
11919
  ) : record.resourceName;
11647
11920
  }
@@ -11666,9 +11939,9 @@ const IngressRulesTable = ({ ingress }) => {
11666
11939
  return secretName ? /* @__PURE__ */ jsxRuntimeExports.jsx(
11667
11940
  ResourceLink,
11668
11941
  {
11669
- resourceName: "secrets",
11942
+ resourceKind: "secrets",
11670
11943
  namespace: ingress.metadata.namespace || "default",
11671
- resourceId: secretName
11944
+ name: secretName
11672
11945
  }
11673
11946
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, { value: "" });
11674
11947
  },
@@ -11695,7 +11968,7 @@ const IngressRulesTable = ({ ingress }) => {
11695
11968
  );
11696
11969
  }
11697
11970
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
11698
- Table$12,
11971
+ Table2,
11699
11972
  {
11700
11973
  tableKey: "ingressRules",
11701
11974
  loading: false,
@@ -11712,7 +11985,7 @@ const IngressRulesTable = ({ ingress }) => {
11712
11985
  }
11713
11986
  );
11714
11987
  };
11715
- const KeyValue_18l1y97 = "";
11988
+ const KeyValue_1cqk7i8 = "";
11716
11989
  const ContentBlockStyle = "c8jy7dc";
11717
11990
  const KeyStyle = "k2sddxl";
11718
11991
  const ValueStyle$2 = "v16vicsr";
@@ -11792,6 +12065,40 @@ function Tabs(props) {
11792
12065
  return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsTabPane, { tab: tab.title, children: tab.children }, tab.title);
11793
12066
  }) });
11794
12067
  }
12068
+ const StateTag = (props) => {
12069
+ const { state: state2 = ResourceState.UPDATING, hideBackground, className, resourceKind } = props;
12070
+ const { t: t2 } = useTranslation();
12071
+ const defaultStateMap = {
12072
+ [ResourceState.UPDATING]: "loading",
12073
+ [ResourceState.READY]: "green",
12074
+ [ResourceState.COMPLETED]: "gray",
12075
+ [ResourceState.FAILED]: "red",
12076
+ [ResourceState.SUSPENDED]: "warning",
12077
+ [ResourceState.RUNNING]: "green",
12078
+ [ResourceState.SUCCEEDED]: "blue",
12079
+ [ResourceState.UNKNOWN]: "gray",
12080
+ [ResourceState.TERMINATING]: "loading",
12081
+ [ResourceState.PENDING]: "warning",
12082
+ [ResourceState.WAITING]: "warning",
12083
+ [ResourceState.TERMINATED]: "red",
12084
+ [ResourceState.STOPPED]: "gray",
12085
+ [ResourceState.AVAILABLE]: "blue",
12086
+ [ResourceState.BOUND]: "green",
12087
+ [ResourceState.RELEASED]: "gray",
12088
+ [ResourceState.LOST]: "red"
12089
+ };
12090
+ const resourceStateMap = {};
12091
+ const finalStateMap = resourceStateMap[resourceKind || ""] || defaultStateMap;
12092
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12093
+ StatusCapsule,
12094
+ {
12095
+ className: cx_default(className, StateTagStyle, hideBackground && "no-background"),
12096
+ color: finalStateMap[state2] !== "loading" ? finalStateMap[state2] : void 0,
12097
+ loading: finalStateMap[state2] === "loading",
12098
+ children: t2(`dovetail.${state2 || "updating"}_state`)
12099
+ }
12100
+ );
12101
+ };
11795
12102
  const ShowContent_11g4jr2 = "";
11796
12103
  const ShowContentWrapperStyle = "s9agep2";
11797
12104
  const BackButton = "bo89gfi";
@@ -11824,7 +12131,7 @@ function ShowGroupComponent(props) {
11824
12131
  });
11825
12132
  }
11826
12133
  const ShowContent = (props) => {
11827
- var _a, _b, _c, _d;
12134
+ var _a, _b, _c, _d, _e;
11828
12135
  const {
11829
12136
  showConfig,
11830
12137
  formatter,
@@ -11853,6 +12160,8 @@ const ShowContent = (props) => {
11853
12160
  id
11854
12161
  });
11855
12162
  const Component = useContext(ComponentContext);
12163
+ const configs = useContext(ConfigsContext);
12164
+ const config = configs[(resource == null ? void 0 : resource.name) || ""];
11856
12165
  const Tabs$12 = Component.Tabs || Tabs;
11857
12166
  if (!(data2 == null ? void 0 : data2.data)) {
11858
12167
  return null;
@@ -11924,7 +12233,7 @@ const ShowContent = (props) => {
11924
12233
  },
11925
12234
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
11926
12235
  className: "button-text",
11927
- children: (_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind
12236
+ children: (config == null ? void 0 : config.displayName) || ((_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind)
11928
12237
  })
11929
12238
  })
11930
12239
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, {
@@ -11937,10 +12246,11 @@ const ShowContent = (props) => {
11937
12246
  className: cx_default(Typo.Display.d2_regular_title, NameStyle),
11938
12247
  children: (_c = record == null ? void 0 : record.metadata) == null ? void 0 : _c.name
11939
12248
  }), stateDisplay ? /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, {
11940
- state: stateDisplay
12249
+ state: stateDisplay,
12250
+ resourceKind: (_d = resource == null ? void 0 : resource.meta) == null ? void 0 : _d.kind
11941
12251
  }) : void 0]
11942
12252
  }), /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, {
11943
- children: [(_d = showConfig.renderExtraButton) == null ? void 0 : _d.call(showConfig, record), !showConfig.hideEditYamlButton ? /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
12253
+ children: [(_e = showConfig.renderExtraButton) == null ? void 0 : _e.call(showConfig, record), !showConfig.hideEditYamlButton ? /* @__PURE__ */ jsxRuntimeExports.jsx(CanAccess, {
11944
12254
  resource: resource == null ? void 0 : resource.name,
11945
12255
  action: AccessControlAuth.Edit,
11946
12256
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
@@ -12037,18 +12347,84 @@ function KeyValueSecret(props) {
12037
12347
  })
12038
12348
  });
12039
12349
  }
12040
- function PVPhaseDisplay(props) {
12041
- const { value: value2 } = props;
12042
- const i18n2 = useTranslation();
12043
- const map = {
12044
- Available: i18n2.t("dovetail.pv_phase_available"),
12045
- Bound: i18n2.t("dovetail.pv_phase_bound"),
12046
- Failed: i18n2.t("dovetail.pv_phase_released"),
12047
- Pending: i18n2.t("dovetail.pv_phase_failed"),
12048
- Released: i18n2.t("dovetail.pv_phase_pending")
12049
- };
12050
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: map[value2] || value2 });
12051
- }
12350
+ const NodeTaintsTable = ({ taints = [] }) => {
12351
+ const { t: t2 } = useTranslation();
12352
+ const component = useContext(ComponentContext);
12353
+ const Table2 = component.Table || Table$1;
12354
+ const taintsWithId = addId(taints, "key");
12355
+ const columns = [
12356
+ {
12357
+ key: "key",
12358
+ display: true,
12359
+ dataIndex: "key",
12360
+ title: t2("dovetail.key"),
12361
+ width: 120,
12362
+ sortable: true
12363
+ },
12364
+ {
12365
+ key: "value",
12366
+ display: true,
12367
+ dataIndex: "value",
12368
+ title: t2("dovetail.value"),
12369
+ width: 120,
12370
+ sortable: true
12371
+ },
12372
+ {
12373
+ key: "effect",
12374
+ display: true,
12375
+ dataIndex: "effect",
12376
+ title: t2("dovetail.effect"),
12377
+ width: 120,
12378
+ sortable: true,
12379
+ render: (value2) => {
12380
+ return t2(`dovetail.node_taint_${value2}`);
12381
+ }
12382
+ }
12383
+ ];
12384
+ const {
12385
+ data: finalData,
12386
+ currentPage,
12387
+ onPageChange,
12388
+ onSorterChange
12389
+ } = useTableData({
12390
+ data: taintsWithId,
12391
+ columns,
12392
+ defaultSorters: [
12393
+ {
12394
+ field: "lastUpdateTime",
12395
+ order: "desc"
12396
+ }
12397
+ ]
12398
+ });
12399
+ const currentSize = 10;
12400
+ if (taintsWithId.length === 0) {
12401
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12402
+ WidgetErrorContent,
12403
+ {
12404
+ errorText: t2("dovetail.no_resource", { kind: t2("dovetail.taint") }),
12405
+ style: { padding: "15px 0" },
12406
+ type: ErrorContentType.Card
12407
+ }
12408
+ );
12409
+ }
12410
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12411
+ Table2,
12412
+ {
12413
+ tableKey: "condition",
12414
+ loading: false,
12415
+ data: finalData,
12416
+ total: taintsWithId.length,
12417
+ columns: addDefaultRenderToColumns(columns),
12418
+ rowKey: "key",
12419
+ empty: t2("dovetail.empty"),
12420
+ defaultSize: currentSize,
12421
+ currentPage,
12422
+ onPageChange,
12423
+ onSorterChange,
12424
+ showMenuColumn: false
12425
+ }
12426
+ );
12427
+ };
12052
12428
  function PVVolumeModeDisplay(props) {
12053
12429
  const { value: value2 } = props;
12054
12430
  const i18n2 = useTranslation();
@@ -12058,11 +12434,72 @@ function PVVolumeModeDisplay(props) {
12058
12434
  };
12059
12435
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: map[value2] || value2 });
12060
12436
  }
12437
+ const GlobalStoreContext = createContext({});
12438
+ function Table(props) {
12439
+ var _a;
12440
+ const { tableProps, displayName, errorContentProps } = props;
12441
+ const { Table: TableComponent } = useContext(ComponentContext);
12442
+ const Table2 = TableComponent || Table$1;
12443
+ const { i18n: i18n2 } = useTranslation();
12444
+ const resourceType = /^[a-zA-Z]/.test(displayName) ? ` ${displayName}` : displayName;
12445
+ if (!((_a = tableProps.data) == null ? void 0 : _a.length) && !tableProps.loading) {
12446
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12447
+ WidgetErrorContent,
12448
+ {
12449
+ errorText: tableProps.empty || i18n2.t("dovetail.no_resource", { kind: resourceType }),
12450
+ ...errorContentProps
12451
+ }
12452
+ );
12453
+ }
12454
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12455
+ Table2,
12456
+ {
12457
+ ...tableProps,
12458
+ empty: tableProps.empty || i18n2.t("dovetail.no_resource", { kind: resourceType }),
12459
+ className: cx_default(tableProps.className)
12460
+ }
12461
+ );
12462
+ }
12463
+ function ResourceTable(props) {
12464
+ const { resource, useTableParams } = props;
12465
+ const configs = useContext(ConfigsContext);
12466
+ const config = configs[resource];
12467
+ const { formatter, columns, Dropdown: Dropdown2, noShow } = config;
12468
+ const { i18n: i18n2 } = useTranslation();
12469
+ const nameRenderer = noShow ? PlainTextNameColumnRenderer(i18n2) : NameColumnRenderer(i18n2);
12470
+ const { tableProps } = useEagleTable({
12471
+ useTableParams: {
12472
+ resource,
12473
+ ...useTableParams
12474
+ },
12475
+ columns: [nameRenderer, ...(columns == null ? void 0 : columns()) || []],
12476
+ tableProps: {
12477
+ defaultSize: 10,
12478
+ ...config.tableProps
12479
+ },
12480
+ formatter,
12481
+ Dropdown: Dropdown2
12482
+ });
12483
+ useEffect(() => {
12484
+ tableProps.onPageChange(1);
12485
+ }, []);
12486
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
12487
+ Table,
12488
+ {
12489
+ tableProps,
12490
+ displayName: config.displayName || config.kind,
12491
+ errorContentProps: {
12492
+ type: ErrorContentType.Card
12493
+ }
12494
+ }
12495
+ );
12496
+ }
12061
12497
  const WorkloadPodsTable_975j2t = "";
12062
12498
  const WorkloadPodsTable = ({
12063
12499
  namespace: namespace2,
12064
12500
  selector,
12065
- hideToolbar
12501
+ hideToolbar,
12502
+ filter
12066
12503
  }) => {
12067
12504
  var _a;
12068
12505
  const {
@@ -12070,7 +12507,7 @@ const WorkloadPodsTable = ({
12070
12507
  } = useTranslation();
12071
12508
  const [selectedKeys, setSelectedKeys] = useState([]);
12072
12509
  const component = useContext(ComponentContext);
12073
- const Table$12 = component.Table || Table;
12510
+ const Table2 = component.Table || Table$1;
12074
12511
  const currentSize = 10;
12075
12512
  const columns = [NameColumnRenderer(i18n2, "pods"), StateDisplayColumnRenderer(i18n2), {
12076
12513
  key: "ip",
@@ -12095,7 +12532,7 @@ const WorkloadPodsTable = ({
12095
12532
  field: "",
12096
12533
  value: "",
12097
12534
  fn(item) {
12098
- return matchSelector(item, selector, namespace2);
12535
+ return filter ? filter(item) : matchSelector(item, selector, namespace2);
12099
12536
  }
12100
12537
  }]
12101
12538
  }
@@ -12118,7 +12555,7 @@ const WorkloadPodsTable = ({
12118
12555
  children: [hideToolbar ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
12119
12556
  selectedKeys,
12120
12557
  hideCreate: true
12121
- }), /* @__PURE__ */ jsxRuntimeExports.jsx(Table$12, {
12558
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(Table2, {
12122
12559
  ...tableProps,
12123
12560
  tableKey: "pods",
12124
12561
  onSelect: (keys) => setSelectedKeys(keys),
@@ -12329,6 +12766,15 @@ const ConditionsField = () => {
12329
12766
  }
12330
12767
  };
12331
12768
  };
12769
+ const NodeTaintsField = () => {
12770
+ return {
12771
+ key: "NodeTaints",
12772
+ path: ["spec", "taints"],
12773
+ renderContent: (value2) => {
12774
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(NodeTaintsTable, { taints: value2 });
12775
+ }
12776
+ };
12777
+ };
12332
12778
  const PodsField = () => {
12333
12779
  return {
12334
12780
  key: "pods",
@@ -12551,15 +12997,26 @@ const StorageClassPvField = () => {
12551
12997
  return {
12552
12998
  key: "pvs",
12553
12999
  path: ["pvs"],
12554
- renderContent: (pvs) => {
12555
- return pvs.map((pv) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
12556
- ResourceLink,
13000
+ renderContent: (_, sc) => {
13001
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
13002
+ ResourceTable,
12557
13003
  {
12558
- resourceName: "persistentvolumes",
12559
- namespace: pv.metadata.namespace || "",
12560
- resourceId: pv.id
13004
+ resource: "persistentvolumes",
13005
+ useTableParams: {
13006
+ filters: {
13007
+ permanent: [
13008
+ {
13009
+ field: "",
13010
+ value: "",
13011
+ fn(pv2) {
13012
+ return sc.filterPV(pv2, sc.metadata.name);
13013
+ }
13014
+ }
13015
+ ]
13016
+ }
13017
+ }
12561
13018
  }
12562
- ) }, pv.metadata.name));
13019
+ );
12563
13020
  }
12564
13021
  };
12565
13022
  };
@@ -12577,29 +13034,43 @@ const PVCStorageField = (i18n2) => {
12577
13034
  return {
12578
13035
  key: "storage",
12579
13036
  path: ["spec", "resources", "requests", "storage"],
12580
- title: i18n2.t("dovetail.capacity"),
12581
- renderContent(value2) {
12582
- return /* @__PURE__ */ jsxRuntimeExports.jsx(Units.Byte, { rawValue: parseSi(value2), decimals: 1 });
13037
+ title: i18n2.t("dovetail.distributed"),
13038
+ renderContent(value2, pvc2) {
13039
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(PVCDistributeStorage, { pvc: pvc2, editable: true });
12583
13040
  }
12584
13041
  };
12585
13042
  };
13043
+ const PVRefField = (i18n2) => {
13044
+ return {
13045
+ key: "pv",
13046
+ path: ["pv"],
13047
+ title: i18n2.t("dovetail.pv")
13048
+ };
13049
+ };
12586
13050
  const PVStorageClassField = (i18n2) => {
12587
13051
  return {
12588
13052
  key: "storageClass",
12589
13053
  path: ["spec", "storageClassName"],
12590
13054
  title: i18n2.t("dovetail.storage_class"),
12591
13055
  renderContent(value2) {
12592
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, { resourceName: "storageclasses", namespace: "", resourceId: value2 });
13056
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
13057
+ ResourceLink,
13058
+ {
13059
+ resourceKind: "storageclasses",
13060
+ namespace: "",
13061
+ name: value2
13062
+ }
13063
+ );
12593
13064
  }
12594
13065
  };
12595
13066
  };
12596
13067
  const PVPhaseField = (i18n2) => {
12597
13068
  return {
12598
13069
  key: "phase",
12599
- path: ["status", "phase"],
12600
- title: i18n2.t("dovetail.phase"),
13070
+ path: ["stateDisplay"],
13071
+ title: i18n2.t("dovetail.state"),
12601
13072
  renderContent(value2) {
12602
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PVPhaseDisplay, { value: value2 });
13073
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, { state: value2, resourceKind: "PersistentVolume", hideBackground: true });
12603
13074
  }
12604
13075
  };
12605
13076
  };
@@ -12617,7 +13088,99 @@ const PVAccessModeField = (i18n2) => {
12617
13088
  return {
12618
13089
  key: "accessMode",
12619
13090
  path: ["spec", "accessModes"],
12620
- title: i18n2.t("dovetail.access_mode")
13091
+ title: i18n2.t("dovetail.access_mode"),
13092
+ renderContent(value2) {
13093
+ return value2.join(", ");
13094
+ }
13095
+ };
13096
+ };
13097
+ const PVCPodsField = () => {
13098
+ return {
13099
+ key: "pods",
13100
+ path: [],
13101
+ renderContent: (_, record) => {
13102
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
13103
+ WorkloadPodsTable,
13104
+ {
13105
+ filter: (item) => {
13106
+ var _a, _b;
13107
+ return !!((_b = (_a = item.spec) == null ? void 0 : _a.volumes) == null ? void 0 : _b.some((v) => {
13108
+ var _a2;
13109
+ return ((_a2 = v.persistentVolumeClaim) == null ? void 0 : _a2.claimName) === record.metadata.name;
13110
+ }));
13111
+ },
13112
+ namespace: record.metadata.namespace,
13113
+ hideToolbar: true
13114
+ }
13115
+ );
13116
+ }
13117
+ };
13118
+ };
13119
+ const PVCRefField = (i18n2) => {
13120
+ return {
13121
+ key: "pvc",
13122
+ path: ["pvc"],
13123
+ title: i18n2.t("dovetail.pvc"),
13124
+ renderContent(value2, pvc2) {
13125
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
13126
+ ResourceLink,
13127
+ {
13128
+ resourceKind: "persistentvolumeclaims",
13129
+ namespace: pvc2.pvcNamespace || "default",
13130
+ name: value2
13131
+ }
13132
+ );
13133
+ }
13134
+ };
13135
+ };
13136
+ const PVCSIRefField = (i18n2) => {
13137
+ return {
13138
+ key: "csi",
13139
+ path: ["csi"],
13140
+ title: i18n2.t("dovetail.csi")
13141
+ };
13142
+ };
13143
+ const IsDefaultSCField = (i18n2) => {
13144
+ return {
13145
+ key: "isDefaultSC",
13146
+ path: ["isDefaultSC"],
13147
+ title: i18n2.t("dovetail.default_sc"),
13148
+ renderContent(val) {
13149
+ return val ? i18n2.t("dovetail.true") : i18n2.t("dovetail.false");
13150
+ }
13151
+ };
13152
+ };
13153
+ const SCReclaimPolicyField = (i18n2) => {
13154
+ return {
13155
+ key: "reclaimPolicy",
13156
+ path: ["reclaimPolicy"],
13157
+ title: i18n2.t("dovetail.reclaim_policy"),
13158
+ renderContent(val) {
13159
+ const map = {
13160
+ Delete: i18n2.t("dovetail.delete"),
13161
+ Retain: i18n2.t("dovetail.retain")
13162
+ };
13163
+ return map[val] || val;
13164
+ }
13165
+ };
13166
+ };
13167
+ const IsSCAllowVolumeExpansionField = (i18n2) => {
13168
+ return {
13169
+ key: "​​allowVolumeExpansion",
13170
+ path: ["​allowVolumeExpansion"],
13171
+ title: i18n2.t("dovetail.allow_expand"),
13172
+ renderContent(val) {
13173
+ return val ? i18n2.t("dovetail.support") : i18n2.t("dovetail.not_support");
13174
+ }
13175
+ };
13176
+ };
13177
+ const ResourceTableField = (resource, useTableParams) => {
13178
+ return {
13179
+ key: resource,
13180
+ path: [],
13181
+ renderContent() {
13182
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceTable, { resource, useTableParams });
13183
+ }
12621
13184
  };
12622
13185
  };
12623
13186
  function __rest(s2, e2) {
@@ -18655,7 +19218,7 @@ const PodContainersTable = ({
18655
19218
  }) => {
18656
19219
  const { i18n: i18n2 } = useTranslation();
18657
19220
  const component = useContext(ComponentContext);
18658
- const Table$12 = component.Table || Table;
19221
+ const Table2 = component.Table || Table$1;
18659
19222
  const currentSize = 10;
18660
19223
  const columns = useMemo(
18661
19224
  () => [
@@ -18750,7 +19313,7 @@ const PodContainersTable = ({
18750
19313
  );
18751
19314
  }
18752
19315
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
18753
- Table$12,
19316
+ Table2,
18754
19317
  {
18755
19318
  tableKey: "podContainers",
18756
19319
  loading: false,
@@ -18771,18 +19334,17 @@ const BasicGroup = (i18n2, {
18771
19334
  upAreas = [],
18772
19335
  downAreas = [],
18773
19336
  basicFields = []
18774
- } = {}) => ({
19337
+ } = {}, isShowNamespace = true) => ({
18775
19338
  title: i18n2.t("dovetail.basic_info"),
18776
19339
  areas: [
18777
19340
  ...upAreas,
18778
19341
  {
18779
- fields: [
18780
- NamespaceField(i18n2),
19342
+ fields: (isShowNamespace ? [NamespaceField(i18n2)] : []).concat([
18781
19343
  ...basicFields,
18782
19344
  LabelsField(i18n2),
18783
19345
  AnnotationsField(i18n2),
18784
19346
  AgeField(i18n2)
18785
- ]
19347
+ ])
18786
19348
  },
18787
19349
  ...downAreas
18788
19350
  ]
@@ -18826,6 +19388,14 @@ const ServicePodsGroup = () => ({
18826
19388
  }
18827
19389
  ]
18828
19390
  });
19391
+ const PVCPodsGroup = () => ({
19392
+ title: "Pod",
19393
+ areas: [
19394
+ {
19395
+ fields: [PVCPodsField()]
19396
+ }
19397
+ ]
19398
+ });
18829
19399
  const ConditionsGroup = (i18n2) => ({
18830
19400
  title: i18n2.t("dovetail.condition"),
18831
19401
  areas: [
@@ -18834,6 +19404,14 @@ const ConditionsGroup = (i18n2) => ({
18834
19404
  }
18835
19405
  ]
18836
19406
  });
19407
+ const NodeTaintsGroup = (i18n2) => ({
19408
+ title: i18n2.t("dovetail.taint"),
19409
+ areas: [
19410
+ {
19411
+ fields: [NodeTaintsField()]
19412
+ }
19413
+ ]
19414
+ });
18837
19415
  const SecretDataGroup = () => ({
18838
19416
  areas: [
18839
19417
  {
@@ -18933,6 +19511,14 @@ const StorageClassPvGroup = (i18n2) => ({
18933
19511
  }
18934
19512
  ]
18935
19513
  });
19514
+ const ResourceTableGroup = (resource, title) => ({
19515
+ title,
19516
+ areas: [
19517
+ {
19518
+ fields: [ResourceTableField(resource)]
19519
+ }
19520
+ ]
19521
+ });
18936
19522
  const PageShow = (props) => {
18937
19523
  var _a;
18938
19524
  const parsed = useParsed();
@@ -32663,7 +33249,6 @@ const Shell = React__default.forwardRef(function Shell2(props, ref) {
32663
33249
  })]
32664
33250
  });
32665
33251
  });
32666
- const GlobalStoreContext = createContext({});
32667
33252
  var buffer = {};
32668
33253
  var base64Js = {};
32669
33254
  base64Js.byteLength = byteLength;
@@ -35120,13 +35705,7 @@ function ListPage(props) {
35120
35705
  tableProps,
35121
35706
  contentClassName
35122
35707
  } = props;
35123
- const {
35124
- Table: TableComponent
35125
- } = useContext(ComponentContext);
35126
- const {
35127
- t: t2
35128
- } = useTranslation();
35129
- const Table$12 = TableComponent || Table;
35708
+ useTranslation();
35130
35709
  const {
35131
35710
  resource
35132
35711
  } = useResource();
@@ -35137,6 +35716,7 @@ function ListPage(props) {
35137
35716
  children: [!config.hideListToolBar ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
35138
35717
  children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TableToolBar, {
35139
35718
  selectedKeys,
35719
+ title: config == null ? void 0 : config.displayName,
35140
35720
  description: config == null ? void 0 : config.description
35141
35721
  }), /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, {
35142
35722
  style: {
@@ -35148,23 +35728,21 @@ function ListPage(props) {
35148
35728
  })]
35149
35729
  }) : void 0, /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
35150
35730
  className: cx_default(ListContentStyle, contentClassName),
35731
+ style: config.hideNamespacesFilter ? {
35732
+ paddingTop: 0
35733
+ } : {},
35151
35734
  children: [!config.hideNamespacesFilter ? /* @__PURE__ */ jsxRuntimeExports.jsx(NamespacesFilter, {
35152
35735
  className: NamespaceFilterStyle
35153
35736
  }) : void 0, /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
35154
35737
  className: TableStyle,
35155
- children: !(tableProps.data.length || tableProps.loading) ? /* @__PURE__ */ jsxRuntimeExports.jsx(WidgetErrorContent, {
35156
- errorText: tableProps.empty || t2("dovetail.no_resource", {
35157
- kind: ` ${config.kind}`
35158
- })
35159
- }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Table$12, {
35160
- ...tableProps,
35161
- empty: tableProps.empty || t2("dovetail.no_resource", {
35162
- kind: ` ${config.kind}`
35163
- }),
35164
- className: cx_default(tableProps.className),
35165
- scroll: {
35166
- y: "calc(100% - 48px)"
35167
- }
35738
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Table, {
35739
+ tableProps: {
35740
+ ...tableProps,
35741
+ scroll: {
35742
+ y: "calc(100% - 48px)"
35743
+ }
35744
+ },
35745
+ displayName: (config == null ? void 0 : config.displayName) || config.kind
35168
35746
  })
35169
35747
  })]
35170
35748
  })]
@@ -37437,6 +38015,7 @@ const useForm = ({
37437
38015
  refineCoreProps,
37438
38016
  warnWhenUnsavedChanges: warnWhenUnsavedChangesProp,
37439
38017
  disableServerSideValidation: disableServerSideValidationProp = false,
38018
+ transformApplyValues,
37440
38019
  ...rest
37441
38020
  } = {}) => {
37442
38021
  const { options } = useRefineContext();
@@ -37538,7 +38117,10 @@ const useForm = ({
37538
38117
  const saveButtonProps = {
37539
38118
  disabled: formLoading,
37540
38119
  onClick: (e2) => {
37541
- handleSubmit(onFinish, () => false)(e2);
38120
+ handleSubmit(
38121
+ (v) => onFinish(transformApplyValues ? transformApplyValues(v) : v),
38122
+ () => false
38123
+ )(e2);
37542
38124
  }
37543
38125
  };
37544
38126
  return {
@@ -37549,7 +38131,7 @@ const useForm = ({
37549
38131
  };
37550
38132
  };
37551
38133
  const useRefineForm = (props) => {
37552
- var _a;
38134
+ var _a, _b;
37553
38135
  const { config, id, refineProps } = props;
37554
38136
  const [responseErrorMsg, setResponseErrorMsg] = useState("");
37555
38137
  const i18n2 = useTranslation();
@@ -37580,15 +38162,16 @@ const useRefineForm = (props) => {
37580
38162
  ...refineProps
37581
38163
  },
37582
38164
  defaultValues: config == null ? void 0 : config.initValue,
37583
- ...(_a = config.formConfig) == null ? void 0 : _a.useFormProps
38165
+ transformApplyValues: (_a = config.formConfig) == null ? void 0 : _a.transformApplyValues,
38166
+ ...(_b = config.formConfig) == null ? void 0 : _b.useFormProps
37584
38167
  });
37585
38168
  useEffect(() => {
37586
- var _a2, _b;
38169
+ var _a2, _b2;
37587
38170
  const response = (_a2 = result.refineCore.mutationResult.error) == null ? void 0 : _a2.response;
37588
38171
  if (response && !(response == null ? void 0 : response.bodyUsed)) {
37589
- (_b = response.json) == null ? void 0 : _b.call(response).then((body) => {
37590
- var _a3, _b2;
37591
- setResponseErrorMsg(((_b2 = (_a3 = config.formConfig) == null ? void 0 : _a3.formatError) == null ? void 0 : _b2.call(_a3, body)) || body.message);
38172
+ (_b2 = response.json) == null ? void 0 : _b2.call(response).then((body) => {
38173
+ var _a3, _b3;
38174
+ setResponseErrorMsg(((_b3 = (_a3 = config.formConfig) == null ? void 0 : _a3.formatError) == null ? void 0 : _b3.call(_a3, body)) || body.message);
37592
38175
  });
37593
38176
  }
37594
38177
  }, [config.formConfig, result]);
@@ -37602,7 +38185,7 @@ const Separator = () => {
37602
38185
  });
37603
38186
  };
37604
38187
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
37605
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-1593cfad.js"));
38188
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-effbc940.js"));
37606
38189
  const YamlEditorComponent = forwardRef(
37607
38190
  function YamlEditorComponent2(props, ref) {
37608
38191
  const {
@@ -38393,12 +38976,13 @@ function FormModal(props) {
38393
38976
  });
38394
38977
  const yamlFormProps = useMemo(() => {
38395
38978
  var _a2, _b2, _c2;
38979
+ const transformApplyValues = ((_a2 = config.formConfig) == null ? void 0 : _a2.transformApplyValues) || ((v) => v);
38396
38980
  return {
38397
38981
  ...props.formProps,
38398
- transformInitValues: (_a2 = config.formConfig) == null ? void 0 : _a2.transformInitValues,
38399
- transformApplyValues: (_b2 = config.formConfig) == null ? void 0 : _b2.transformApplyValues,
38400
- initialValuesForCreate: isYamlMode ? refineFormResult.formResult.getValues() : ((_c2 = props.formProps) == null ? void 0 : _c2.initialValuesForCreate) || (config == null ? void 0 : config.initValue),
38401
- initialValuesForEdit: isYamlMode ? refineFormResult.formResult.getValues() : void 0,
38982
+ transformInitValues: (_b2 = config.formConfig) == null ? void 0 : _b2.transformInitValues,
38983
+ transformApplyValues,
38984
+ initialValuesForCreate: isYamlMode ? transformApplyValues(refineFormResult.formResult.getValues()) : ((_c2 = props.formProps) == null ? void 0 : _c2.initialValuesForCreate) || (config == null ? void 0 : config.initValue),
38985
+ initialValuesForEdit: isYamlMode ? transformApplyValues(refineFormResult.formResult.getValues()) : void 0,
38402
38986
  id,
38403
38987
  action,
38404
38988
  isShowLayout: false,
@@ -38470,10 +39054,11 @@ function FormModal(props) {
38470
39054
  if (typeof ((_c2 = config.formConfig) == null ? void 0 : _c2.formTitle) === "function") {
38471
39055
  return (_d2 = config.formConfig) == null ? void 0 : _d2.formTitle(action);
38472
39056
  }
39057
+ const label2 = config.displayName || (config == null ? void 0 : config.kind);
38473
39058
  return i18n2.t(id ? "dovetail.edit_resource" : "dovetail.create_resource", {
38474
- resource: config == null ? void 0 : config.kind
39059
+ resource: /^[a-zA-Z]/.test(label2) ? ` ${label2}` : label2
38475
39060
  });
38476
- }, [action, config.formConfig, config == null ? void 0 : config.kind, i18n2, id]);
39061
+ }, [action, config.formConfig, config.displayName, config == null ? void 0 : config.kind, i18n2, id]);
38477
39062
  const desc = useMemo(() => {
38478
39063
  var _a2, _b2, _c2, _d2;
38479
39064
  if (typeof ((_a2 = config.formConfig) == null ? void 0 : _a2.formDesc) === "string")
@@ -38524,6 +39109,12 @@ function FormModal(props) {
38524
39109
  children: [desc ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
38525
39110
  className: FormDescStyle,
38526
39111
  children: desc
39112
+ }) : void 0, !isYamlForm && mode === "form" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, {
39113
+ type: "warning",
39114
+ message: i18n2.t("dovetail.change_form_mode_alert"),
39115
+ style: {
39116
+ marginBottom: "16px"
39117
+ }
38527
39118
  }) : void 0, formEle]
38528
39119
  });
38529
39120
  }
@@ -38836,8 +39427,8 @@ const ReferenceLink = (props) => {
38836
39427
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
38837
39428
  ResourceLink,
38838
39429
  {
38839
- resourceId: ownerReference.name,
38840
- resourceName: resource.name || "",
39430
+ name: ownerReference.name,
39431
+ resourceKind: resource.name || "",
38841
39432
  namespace: namespace2
38842
39433
  }
38843
39434
  );
@@ -38891,9 +39482,9 @@ const IngressRulesComponent = ({ ingress }) => {
38891
39482
  /* @__PURE__ */ jsxRuntimeExports.jsx(
38892
39483
  ResourceLink,
38893
39484
  {
38894
- resourceName: "services",
39485
+ resourceKind: "services",
38895
39486
  namespace: ingress.metadata.namespace || "default",
38896
- resourceId: r2.serviceName
39487
+ name: r2.serviceName
38897
39488
  }
38898
39489
  ),
38899
39490
  /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
@@ -39466,7 +40057,7 @@ const PVCStorageColumnRenderer = (i18n2) => {
39466
40057
  key: "storage",
39467
40058
  display: true,
39468
40059
  dataIndex: ["spec", "resources", "requests", "storage"],
39469
- title: i18n2.t("dovetail.capacity"),
40060
+ title: i18n2.t("dovetail.distributed"),
39470
40061
  width: 120,
39471
40062
  sortable: true,
39472
40063
  align: "right",
@@ -39478,19 +40069,29 @@ const PVCStorageColumnRenderer = (i18n2) => {
39478
40069
  }
39479
40070
  };
39480
40071
  };
40072
+ const PVRefColumnRenderer = (i18n2) => {
40073
+ return {
40074
+ key: "pv",
40075
+ display: true,
40076
+ dataIndex: ["pv"],
40077
+ title: i18n2.t("dovetail.pv"),
40078
+ width: 160,
40079
+ sortable: true
40080
+ };
40081
+ };
39481
40082
  const PVStorageClassColumnRenderer = (i18n2) => {
39482
40083
  return {
39483
40084
  key: "storageClass",
39484
40085
  display: true,
39485
40086
  dataIndex: ["spec", "storageClassName"],
39486
40087
  title: i18n2.t("dovetail.storage_class"),
39487
- width: 120,
40088
+ width: 160,
39488
40089
  sortable: true,
39489
40090
  render(value2) {
39490
40091
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
39491
- resourceName: "storageclasses",
40092
+ resourceKind: "storageclasses",
39492
40093
  namespace: "",
39493
- resourceId: value2
40094
+ name: value2
39494
40095
  });
39495
40096
  }
39496
40097
  };
@@ -39499,17 +40100,46 @@ const PVPhaseColumnRenderer = (i18n2) => {
39499
40100
  return {
39500
40101
  key: "phase",
39501
40102
  display: true,
39502
- dataIndex: ["status", "phase"],
39503
- title: i18n2.t("dovetail.phase"),
40103
+ dataIndex: ["stateDisplay"],
40104
+ title: i18n2.t("dovetail.state"),
39504
40105
  width: 120,
39505
40106
  sortable: true,
39506
40107
  render(value2) {
39507
- return /* @__PURE__ */ jsxRuntimeExports.jsx(PVPhaseDisplay, {
39508
- value: value2
40108
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(StateTag, {
40109
+ state: value2,
40110
+ resourceKind: "PersistentVolume",
40111
+ hideBackground: true
39509
40112
  });
39510
40113
  }
39511
40114
  };
39512
40115
  };
40116
+ const PVCRefColumnRenderer = (i18n2) => {
40117
+ return {
40118
+ key: "pvc",
40119
+ display: true,
40120
+ dataIndex: ["pvc"],
40121
+ title: i18n2.t("dovetail.pvc"),
40122
+ width: 160,
40123
+ sortable: true,
40124
+ render(value2, pv2) {
40125
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
40126
+ resourceKind: "persistentvolumeclaims",
40127
+ namespace: pv2.pvcNamespace || "default",
40128
+ name: value2
40129
+ });
40130
+ }
40131
+ };
40132
+ };
40133
+ const PVCSIRefColumnRenderer = (i18n2) => {
40134
+ return {
40135
+ key: "csi",
40136
+ display: true,
40137
+ dataIndex: ["csi"],
40138
+ title: i18n2.t("dovetail.csi"),
40139
+ width: 160,
40140
+ sortable: true
40141
+ };
40142
+ };
39513
40143
  const PVVolumeModeColumnRenderer = (i18n2) => {
39514
40144
  return {
39515
40145
  key: "mode",
@@ -39532,7 +40162,58 @@ const PVAccessModeColumnRenderer = (i18n2) => {
39532
40162
  dataIndex: ["spec", "accessModes"],
39533
40163
  title: i18n2.t("dovetail.access_mode"),
39534
40164
  width: 120,
39535
- sortable: true
40165
+ sortable: true,
40166
+ render(value2) {
40167
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
40168
+ style: {
40169
+ whiteSpace: "pre-wrap"
40170
+ },
40171
+ children: value2.join("\n")
40172
+ });
40173
+ }
40174
+ };
40175
+ };
40176
+ const IsDefaultSCColumnRenderer = (i18n2) => {
40177
+ return {
40178
+ key: "isDefaultSC",
40179
+ display: true,
40180
+ dataIndex: ["isDefaultSC"],
40181
+ title: i18n2.t("dovetail.default_sc"),
40182
+ width: 120,
40183
+ sortable: true,
40184
+ render(val) {
40185
+ return val ? i18n2.t("dovetail.true") : i18n2.t("dovetail.false");
40186
+ }
40187
+ };
40188
+ };
40189
+ const SCReclaimPolicyColumnRenderer = (i18n2) => {
40190
+ return {
40191
+ key: "reclaimPolicy",
40192
+ display: true,
40193
+ dataIndex: ["reclaimPolicy"],
40194
+ title: i18n2.t("dovetail.reclaim_policy"),
40195
+ width: 120,
40196
+ sortable: true,
40197
+ render(val) {
40198
+ const map = {
40199
+ Delete: i18n2.t("dovetail.delete"),
40200
+ Retain: i18n2.t("dovetail.retain")
40201
+ };
40202
+ return map[val] || val;
40203
+ }
40204
+ };
40205
+ };
40206
+ const SCAllowExpandColumnRenderer = (i18n2) => {
40207
+ return {
40208
+ key: "​​allowVolumeExpansion",
40209
+ display: true,
40210
+ dataIndex: ["​​allowVolumeExpansion"],
40211
+ title: i18n2.t("dovetail.allow_expand"),
40212
+ width: 120,
40213
+ sortable: true,
40214
+ render(val) {
40215
+ return val ? i18n2.t("dovetail.support") : i18n2.t("dovetail.not_support");
40216
+ }
39536
40217
  };
39537
40218
  };
39538
40219
  const styles = "";
@@ -39773,215 +40454,235 @@ const relationPlugin = new RelationPlugin();
39773
40454
  const ProviderPlugins = [relationPlugin, modelPlugin];
39774
40455
  const dovetailRefineI18n = i18n;
39775
40456
  export {
39776
- NamespaceSelectWidget as $,
40457
+ index as $,
39777
40458
  AgeColumnRenderer as A,
39778
40459
  PVCStorageColumnRenderer as B,
39779
40460
  CommonSorter as C,
39780
40461
  DurationColumnRenderer as D,
39781
- PVStorageClassColumnRenderer as E,
39782
- PVPhaseColumnRenderer as F,
39783
- PVVolumeModeColumnRenderer as G,
39784
- PVAccessModeColumnRenderer as H,
40462
+ PVRefColumnRenderer as E,
40463
+ PVStorageClassColumnRenderer as F,
40464
+ PVPhaseColumnRenderer as G,
40465
+ PVCRefColumnRenderer as H,
39785
40466
  IngressRulesColumnRenderer as I,
39786
- ColumnKeys as J,
39787
- addDefaultRenderToColumns as K,
39788
- useEagleTable as L,
39789
- useDownloadYAML as M,
40467
+ PVCSIRefColumnRenderer as J,
40468
+ PVVolumeModeColumnRenderer as K,
40469
+ PVAccessModeColumnRenderer as L,
40470
+ IsDefaultSCColumnRenderer as M,
39790
40471
  NameColumnRenderer as N,
39791
- useEdit as O,
40472
+ SCReclaimPolicyColumnRenderer as O,
39792
40473
  PlainTextNameColumnRenderer as P,
39793
- useGlobalStore as Q,
40474
+ SCAllowExpandColumnRenderer as Q,
39794
40475
  ReplicasColumnRenderer as R,
39795
40476
  StateDisplayColumnRenderer as S,
39796
- useOpenForm as T,
39797
- index as U,
39798
- Breadcrumb as V,
40477
+ ColumnKeys as T,
40478
+ addDefaultRenderToColumns as U,
40479
+ useEagleTable as V,
39799
40480
  WorkloadImageColumnRenderer as W,
39800
- NameInputWidget as X,
39801
- dnsSubDomainRules as Y,
39802
- rfc1123LabelRules as Z,
39803
- rfc1035LabelRules as _,
40481
+ useDownloadYAML as X,
40482
+ useEdit as Y,
40483
+ useGlobalStore as Z,
40484
+ useOpenForm as _,
39804
40485
  useApiGroupSchema as a,
39805
- PVVolumeModeField as a$,
39806
- namespaceRules as a0,
39807
- KeyValueListWidget as a1,
39808
- MetadataForm as a2,
39809
- PageShow as a3,
39810
- Time as a4,
39811
- ConditionsTable as a5,
39812
- FormErrorAlert as a6,
39813
- PodContainersTable as a7,
39814
- WorkloadDropdown as a8,
39815
- ReplicasDropdown as a9,
39816
- ConditionsField as aA,
39817
- PodsField as aB,
39818
- JobsField as aC,
39819
- DataField as aD,
39820
- SecretDataField as aE,
39821
- StartTimeField as aF,
39822
- ServiceTypeField as aG,
39823
- ClusterIpField as aH,
39824
- SessionAffinityField as aI,
39825
- ServicePodsField as aJ,
39826
- IngressRulesTableTabField as aK,
39827
- EventsTableTabField as aL,
39828
- NamespaceField as aM,
39829
- AgeField as aN,
39830
- LabelsField as aO,
39831
- AnnotationsField as aP,
39832
- ServiceInnerClusterAccessField as aQ,
39833
- ServiceOutClusterAccessField as aR,
39834
- PodSelectorField as aS,
39835
- PortsTableField as aT,
39836
- DurationField as aU,
39837
- StorageClassProvisionerField as aV,
39838
- StorageClassPvField as aW,
39839
- PVCapacityField as aX,
39840
- PVCStorageField as aY,
39841
- PVStorageClassField as aZ,
39842
- PVPhaseField as a_,
39843
- PodDropdown as aa,
39844
- CreateButton as ab,
39845
- ImageNames as ac,
39846
- ResourceList as ad,
39847
- ResourceShow as ae,
39848
- ResourceForm as af,
39849
- ResourceCRUD as ag,
39850
- WorkloadPodsTable as ah,
39851
- CronJobDropdown as ai,
39852
- K8sDropdown as aj,
39853
- EditLabelDropdownMenuItem as ak,
39854
- EditAnnotationDropdownMenuItem as al,
39855
- ResourceUsageBar as am,
39856
- WorkloadReplicasForm as an,
39857
- WorkloadReplicas as ao,
39858
- CronjobJobsTable as ap,
39859
- KeyValue as aq,
39860
- KeyValueAnnotation as ar,
39861
- KeyValueSecret as as,
39862
- Separator as at,
39863
- YamlEditorComponent as au,
39864
- DeleteButton as av,
39865
- Layout as aw,
39866
- AreaType as ax,
39867
- ImageField as ay,
39868
- ReplicaField as az,
40486
+ DurationField as a$,
40487
+ Breadcrumb as a0,
40488
+ NameInputWidget as a1,
40489
+ dnsSubDomainRules as a2,
40490
+ rfc1123LabelRules as a3,
40491
+ rfc1035LabelRules as a4,
40492
+ NamespaceSelectWidget as a5,
40493
+ namespaceRules as a6,
40494
+ KeyValueListWidget as a7,
40495
+ MetadataForm as a8,
40496
+ PageShow as a9,
40497
+ YamlEditorComponent as aA,
40498
+ DeleteButton as aB,
40499
+ Layout as aC,
40500
+ AreaType as aD,
40501
+ ImageField as aE,
40502
+ ReplicaField as aF,
40503
+ ConditionsField as aG,
40504
+ NodeTaintsField as aH,
40505
+ PodsField as aI,
40506
+ JobsField as aJ,
40507
+ DataField as aK,
40508
+ SecretDataField as aL,
40509
+ StartTimeField as aM,
40510
+ ServiceTypeField as aN,
40511
+ ClusterIpField as aO,
40512
+ SessionAffinityField as aP,
40513
+ ServicePodsField as aQ,
40514
+ IngressRulesTableTabField as aR,
40515
+ EventsTableTabField as aS,
40516
+ NamespaceField as aT,
40517
+ AgeField as aU,
40518
+ LabelsField as aV,
40519
+ AnnotationsField as aW,
40520
+ ServiceInnerClusterAccessField as aX,
40521
+ ServiceOutClusterAccessField as aY,
40522
+ PodSelectorField as aZ,
40523
+ PortsTableField as a_,
40524
+ Time as aa,
40525
+ ConditionsTable as ab,
40526
+ FormErrorAlert as ac,
40527
+ PodContainersTable as ad,
40528
+ WorkloadDropdown as ae,
40529
+ ReplicasDropdown as af,
40530
+ PodDropdown as ag,
40531
+ CreateButton as ah,
40532
+ ImageNames as ai,
40533
+ ResourceList as aj,
40534
+ ResourceShow as ak,
40535
+ ResourceForm as al,
40536
+ ResourceCRUD as am,
40537
+ WorkloadPodsTable as an,
40538
+ CronJobDropdown as ao,
40539
+ K8sDropdown as ap,
40540
+ EditLabelDropdownMenuItem as aq,
40541
+ EditAnnotationDropdownMenuItem as ar,
40542
+ ResourceUsageBar as as,
40543
+ WorkloadReplicasForm as at,
40544
+ WorkloadReplicas as au,
40545
+ CronjobJobsTable as av,
40546
+ KeyValue as aw,
40547
+ KeyValueAnnotation as ax,
40548
+ KeyValueSecret as ay,
40549
+ Separator as az,
39869
40550
  useSchema as b,
39870
- SERVICE_HEADLESS_INIT_VALUE as b$,
39871
- PVAccessModeField as b0,
39872
- EventsTab as b1,
39873
- PodLogTab as b2,
39874
- BasicGroup as b3,
39875
- PodsGroup as b4,
39876
- PodContainersGroup as b5,
39877
- ServicePodsGroup as b6,
39878
- ConditionsGroup as b7,
39879
- SecretDataGroup as b8,
39880
- JobsGroup as b9,
39881
- YamlForm as bA,
39882
- useRefineForm as bB,
39883
- ServiceInClusterAccessComponent as bC,
39884
- ServiceOutClusterAccessComponent as bD,
39885
- Tags as bE,
39886
- TextTags as bF,
39887
- PodLog as bG,
39888
- NetworkPolicyRulesViewer as bH,
39889
- PVPhaseDisplay as bI,
39890
- PVVolumeModeDisplay as bJ,
39891
- Tabs as bK,
39892
- ResourceSelect as bL,
39893
- SocketStatus as bM,
39894
- Shell as bN,
39895
- PodShellModal as bO,
39896
- PodShell as bP,
39897
- BASE_INIT_VALUE as bQ,
39898
- DEPLOYMENT_INIT_VALUE as bR,
39899
- CRONJOB_INIT_VALUE as bS,
39900
- DAEMONSET_INIT_VALUE as bT,
39901
- JOB_INIT_VALUE as bU,
39902
- STATEFULSET_INIT_VALUE as bV,
39903
- POD_INIT_VALUE as bW,
39904
- SERVICE_CLUSTER_IP_INIT_VALUE as bX,
39905
- SERVICE_NODE_PORT_INIT_VALUE as bY,
39906
- SERVICE_LOAD_BALANCER_INIT_VALUE as bZ,
39907
- SERVICE_EXTERNAL_NAME_INIT_VALUE as b_,
39908
- IngressRulesGroup as ba,
39909
- PodSelectorGroup as bb,
39910
- PortsGroup as bc,
39911
- DataGroup as bd,
39912
- NetworkPolicyIngressRulesGroup as be,
39913
- NetworkPolicyEgressRulesGroup as bf,
39914
- StorageClassPvGroup as bg,
39915
- ShowGroupComponent as bh,
39916
- ShowContent as bi,
39917
- DeleteManyButton as bj,
39918
- ListPage as bk,
39919
- StateTagStyle as bl,
39920
- StateTag as bm,
39921
- DrawerShow as bn,
39922
- Menu as bo,
39923
- EditButton as bp,
39924
- ReferenceLink as bq,
39925
- ResourceLink as br,
39926
- NS_STORE_KEY as bs,
39927
- ALL_NS as bt,
39928
- useNamespacesFilter as bu,
39929
- NamespacesFilter as bv,
39930
- FormModal as bw,
39931
- RefineFormContent as bx,
39932
- RefineFormPage as by,
39933
- SchemaStrategy as bz,
40551
+ Tabs as b$,
40552
+ StorageClassProvisionerField as b0,
40553
+ StorageClassPvField as b1,
40554
+ PVCapacityField as b2,
40555
+ PVCStorageField as b3,
40556
+ PVRefField as b4,
40557
+ PVStorageClassField as b5,
40558
+ PVPhaseField as b6,
40559
+ PVVolumeModeField as b7,
40560
+ PVAccessModeField as b8,
40561
+ PVCPodsField as b9,
40562
+ ShowContent as bA,
40563
+ DeleteManyButton as bB,
40564
+ ListPage as bC,
40565
+ StateTag as bD,
40566
+ DrawerShow as bE,
40567
+ Menu as bF,
40568
+ Table as bG,
40569
+ EditButton as bH,
40570
+ ReferenceLink as bI,
40571
+ ResourceLink as bJ,
40572
+ NS_STORE_KEY as bK,
40573
+ ALL_NS as bL,
40574
+ useNamespacesFilter as bM,
40575
+ NamespacesFilter as bN,
40576
+ FormModal as bO,
40577
+ RefineFormContent as bP,
40578
+ RefineFormPage as bQ,
40579
+ SchemaStrategy as bR,
40580
+ YamlForm as bS,
40581
+ useRefineForm as bT,
40582
+ ServiceInClusterAccessComponent as bU,
40583
+ ServiceOutClusterAccessComponent as bV,
40584
+ Tags as bW,
40585
+ TextTags as bX,
40586
+ PodLog as bY,
40587
+ NetworkPolicyRulesViewer as bZ,
40588
+ PVVolumeModeDisplay as b_,
40589
+ PVCRefField as ba,
40590
+ PVCSIRefField as bb,
40591
+ IsDefaultSCField as bc,
40592
+ SCReclaimPolicyField as bd,
40593
+ IsSCAllowVolumeExpansionField as be,
40594
+ ResourceTableField as bf,
40595
+ EventsTab as bg,
40596
+ PodLogTab as bh,
40597
+ BasicGroup as bi,
40598
+ PodsGroup as bj,
40599
+ PodContainersGroup as bk,
40600
+ ServicePodsGroup as bl,
40601
+ PVCPodsGroup as bm,
40602
+ ConditionsGroup as bn,
40603
+ NodeTaintsGroup as bo,
40604
+ SecretDataGroup as bp,
40605
+ JobsGroup as bq,
40606
+ IngressRulesGroup as br,
40607
+ PodSelectorGroup as bs,
40608
+ PortsGroup as bt,
40609
+ DataGroup as bu,
40610
+ NetworkPolicyIngressRulesGroup as bv,
40611
+ NetworkPolicyEgressRulesGroup as bw,
40612
+ StorageClassPvGroup as bx,
40613
+ ResourceTableGroup as by,
40614
+ ShowGroupComponent as bz,
39934
40615
  useDeleteModal as c,
39935
- INGRESS_INIT_VALUE as c0,
39936
- NETWORK_POLICY_INIT_VALUE as c1,
39937
- CONFIG_MAP_INIT_VALUE as c2,
39938
- SERVER_INSTANCE_INIT_VALUE as c3,
39939
- REDEPLOY_TIMESTAMP_KEY as c4,
39940
- SECRET_OPAQUE_INIT_VALUE as c5,
39941
- SECRET_IMAGE_REPO_INIT_VALUE as c6,
39942
- SECRET_BASIC_AUTH_INIT_VALUE as c7,
39943
- SECRET_SSH_AUTH_INIT_VALUE as c8,
39944
- SECRET_TLS_INIT_VALUE as c9,
39945
- NodeRole as cA,
39946
- NodeModel as cB,
39947
- StorageClassModel as cC,
39948
- PersistentVolumeModel as cD,
39949
- PersistentVolumeClaimModel as cE,
39950
- ProviderPlugins as cF,
39951
- ModelPlugin as cG,
39952
- modelPlugin as cH,
39953
- RelationPlugin as cI,
39954
- relationPlugin as cJ,
39955
- generateValueFromSchema as cK,
39956
- generateSchemaTypeValue as cL,
39957
- resolveRef as cM,
39958
- SECRET_CUSTOM_INIT_VALUE as ca,
39959
- NODE_INIT_VALUE as cb,
39960
- STORAGE_CLASS_INIT_VALUE as cc,
39961
- WorkloadState as cd,
39962
- AccessControlAuth as ce,
39963
- Dovetail as cf,
39964
- RESOURCE_GROUP as cg,
39965
- FormType as ch,
39966
- ComponentContext as ci,
39967
- GlobalStoreContext as cj,
39968
- ConfigsContext as ck,
39969
- IngressModel as cl,
39970
- NetworkPolicyModel as cm,
39971
- JobModel as cn,
39972
- WorkloadModel as co,
39973
- WorkloadBaseModel as cp,
39974
- PodModel as cq,
39975
- PodMetricsModel as cr,
39976
- ResourceModel as cs,
39977
- CronJobModel as ct,
39978
- EventModel as cu,
39979
- DeploymentModel as cv,
39980
- DaemonSetModel as cw,
39981
- StatefulSetModel as cx,
39982
- ServiceTypeEnum as cy,
39983
- ServiceModel as cz,
40616
+ modelPlugin as c$,
40617
+ ResourceSelect as c0,
40618
+ SocketStatus as c1,
40619
+ Shell as c2,
40620
+ PodShellModal as c3,
40621
+ PodShell as c4,
40622
+ ResourceTable as c5,
40623
+ BASE_INIT_VALUE as c6,
40624
+ DEPLOYMENT_INIT_VALUE as c7,
40625
+ CRONJOB_INIT_VALUE as c8,
40626
+ DAEMONSET_INIT_VALUE as c9,
40627
+ RESOURCE_GROUP as cA,
40628
+ FormType as cB,
40629
+ ComponentContext as cC,
40630
+ GlobalStoreContext as cD,
40631
+ ConfigsContext as cE,
40632
+ IngressModel as cF,
40633
+ NetworkPolicyModel as cG,
40634
+ JobModel as cH,
40635
+ WorkloadModel as cI,
40636
+ WorkloadBaseModel as cJ,
40637
+ PodModel as cK,
40638
+ PodMetricsModel as cL,
40639
+ ResourceModel as cM,
40640
+ CronJobModel as cN,
40641
+ EventModel as cO,
40642
+ DeploymentModel as cP,
40643
+ DaemonSetModel as cQ,
40644
+ StatefulSetModel as cR,
40645
+ ServiceTypeEnum as cS,
40646
+ ServiceModel as cT,
40647
+ NodeRole as cU,
40648
+ NodeModel as cV,
40649
+ StorageClassModel as cW,
40650
+ PersistentVolumeModel as cX,
40651
+ PersistentVolumeClaimModel as cY,
40652
+ ProviderPlugins as cZ,
40653
+ ModelPlugin as c_,
40654
+ JOB_INIT_VALUE as ca,
40655
+ STATEFULSET_INIT_VALUE as cb,
40656
+ POD_INIT_VALUE as cc,
40657
+ SERVICE_CLUSTER_IP_INIT_VALUE as cd,
40658
+ SERVICE_NODE_PORT_INIT_VALUE as ce,
40659
+ SERVICE_LOAD_BALANCER_INIT_VALUE as cf,
40660
+ SERVICE_EXTERNAL_NAME_INIT_VALUE as cg,
40661
+ SERVICE_HEADLESS_INIT_VALUE as ch,
40662
+ INGRESS_INIT_VALUE as ci,
40663
+ NETWORK_POLICY_INIT_VALUE as cj,
40664
+ CONFIG_MAP_INIT_VALUE as ck,
40665
+ SERVER_INSTANCE_INIT_VALUE as cl,
40666
+ REDEPLOY_TIMESTAMP_KEY as cm,
40667
+ SECRET_OPAQUE_INIT_VALUE as cn,
40668
+ SECRET_IMAGE_REPO_INIT_VALUE as co,
40669
+ SECRET_BASIC_AUTH_INIT_VALUE as cp,
40670
+ SECRET_SSH_AUTH_INIT_VALUE as cq,
40671
+ SECRET_TLS_INIT_VALUE as cr,
40672
+ SECRET_CUSTOM_INIT_VALUE as cs,
40673
+ NODE_INIT_VALUE as ct,
40674
+ STORAGE_CLASS_INIT_VALUE as cu,
40675
+ PV_INIT_VALUE as cv,
40676
+ PVC_INIT_VALUE as cw,
40677
+ ResourceState as cx,
40678
+ AccessControlAuth as cy,
40679
+ Dovetail as cz,
39984
40680
  dovetailRefineI18n as d,
40681
+ RelationPlugin as d0,
40682
+ relationPlugin as d1,
40683
+ generateValueFromSchema as d2,
40684
+ generateSchemaTypeValue as d3,
40685
+ resolveRef as d4,
39985
40686
  NameSpaceColumnRenderer as e,
39986
40687
  WorkloadRestartsColumnRenderer as f,
39987
40688
  NodeNameColumnRenderer as g,