@dovetail-v2/refine 0.1.11-alpha.2 → 0.1.11

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 (233) hide show
  1. package/dist/{MonacoYamlDiffEditor-42ab72d2.js → MonacoYamlDiffEditor-10d71161.js} +1 -1
  2. package/dist/{index-8ae38abf.js → index-bf5bacd7.js} +324 -121
  3. package/dist/refine.js +3 -1
  4. package/dist/refine.umd.cjs +322 -119
  5. package/dist/style.css +135 -0
  6. package/lib/components/EditField/index.d.ts +3 -0
  7. package/lib/components/EditMetadataForm/KeyValueTableForm.d.ts +15 -0
  8. package/lib/components/EditMetadataForm/LabelFormatPopover.d.ts +3 -0
  9. package/lib/i18n.d.ts +20 -0
  10. package/lib/locales/zh-CN/index.d.ts +20 -0
  11. package/lib/utils/index.d.ts +1 -0
  12. package/lib/utils/validation.d.ts +8 -0
  13. package/package.json +6 -6
  14. package/lib/components/CronJobDropdown/index.d.ts +0 -9
  15. package/lib/components/K8sDropdown/index.d.ts +0 -9
  16. package/lib/components/PodDropdown/index.d.ts +0 -9
  17. package/lib/components/ReplicasDropdown/index.d.ts +0 -9
  18. package/lib/components/Table/TableToolBar.d.ts +0 -9
  19. package/lib/components/Table/TableWidgets.d.ts +0 -6
  20. package/lib/components/WorkloadDropdown/index.d.ts +0 -9
  21. package/lib/src/App.d.ts +0 -3
  22. package/lib/src/Dovetail.d.ts +0 -18
  23. package/lib/src/components/Breadcrumb/index.d.ts +0 -6
  24. package/lib/src/components/ConditionsTable/ConditionsTable.d.ts +0 -7
  25. package/lib/src/components/ConditionsTable/index.d.ts +0 -1
  26. package/lib/src/components/CreateButton/index.d.ts +0 -2
  27. package/lib/src/components/CronJobDropdown/index.d.ts +0 -9
  28. package/lib/src/components/CronjobJobsTable/index.d.ts +0 -8
  29. package/lib/src/components/DeleteButton/index.d.ts +0 -2
  30. package/lib/src/components/DeleteManyButton/index.d.ts +0 -4
  31. package/lib/src/components/DrawerShow/DrawerShow.d.ts +0 -9
  32. package/lib/src/components/DrawerShow/index.d.ts +0 -1
  33. package/lib/src/components/DurationTime/index.d.ts +0 -6
  34. package/lib/src/components/EditButton/index.d.ts +0 -2
  35. package/lib/src/components/EditField/index.d.ts +0 -15
  36. package/lib/src/components/ErrorContent/index.d.ts +0 -17
  37. package/lib/src/components/EventsTable/EventsTable.d.ts +0 -6
  38. package/lib/src/components/EventsTable/index.d.ts +0 -1
  39. package/lib/src/components/Form/FormModal.d.ts +0 -9
  40. package/lib/src/components/Form/RefineFormContent.d.ts +0 -12
  41. package/lib/src/components/Form/RefineFormPage.d.ts +0 -7
  42. package/lib/src/components/Form/YamlForm.d.ts +0 -29
  43. package/lib/src/components/Form/index.d.ts +0 -7
  44. package/lib/src/components/Form/type.d.ts +0 -17
  45. package/lib/src/components/Form/useFieldsConfig.d.ts +0 -4
  46. package/lib/src/components/Form/useReactHookForm.d.ts +0 -30
  47. package/lib/src/components/Form/useRefineForm.d.ts +0 -13
  48. package/lib/src/components/Form/useYamlForm.d.ts +0 -50
  49. package/lib/src/components/FormErrorAlert/index.d.ts +0 -9
  50. package/lib/src/components/FormLayout/index.d.ts +0 -7
  51. package/lib/src/components/FormWidgets/KeyValueListWidget.d.ts +0 -6
  52. package/lib/src/components/FormWidgets/MetadataForm.d.ts +0 -2
  53. package/lib/src/components/FormWidgets/NameInputWidget.d.ts +0 -51
  54. package/lib/src/components/FormWidgets/NamespaceSelectWidget.d.ts +0 -9
  55. package/lib/src/components/FormWidgets/index.d.ts +0 -4
  56. package/lib/src/components/FormWidgets/widget.d.ts +0 -5
  57. package/lib/src/components/ImageNames/index.d.ts +0 -5
  58. package/lib/src/components/IngressRulesComponent/index.d.ts +0 -5
  59. package/lib/src/components/IngressRulesTable/IngressRulesTable.d.ts +0 -7
  60. package/lib/src/components/IngressRulesTable/index.d.ts +0 -1
  61. package/lib/src/components/K8sDropdown/index.d.ts +0 -9
  62. package/lib/src/components/KeyValue/KeyValue.d.ts +0 -7
  63. package/lib/src/components/KeyValue/KeyValueAnnotation.d.ts +0 -6
  64. package/lib/src/components/KeyValue/KeyValueSecret.d.ts +0 -5
  65. package/lib/src/components/KeyValue/index.d.ts +0 -3
  66. package/lib/src/components/Layout/index.d.ts +0 -3
  67. package/lib/src/components/LinkFallback/index.d.ts +0 -4
  68. package/lib/src/components/ListPage/index.d.ts +0 -10
  69. package/lib/src/components/Menu/index.d.ts +0 -2
  70. package/lib/src/components/NamespacesFilter/index.d.ts +0 -11
  71. package/lib/src/components/NetworkPolicyRulesViewer/NetworkPolicyRulesViewer.d.ts +0 -8
  72. package/lib/src/components/NetworkPolicyRulesViewer/index.d.ts +0 -1
  73. package/lib/src/components/PVCDistributeStorage/index.d.ts +0 -16
  74. package/lib/src/components/PageShow/PageShow.d.ts +0 -12
  75. package/lib/src/components/PageShow/index.d.ts +0 -1
  76. package/lib/src/components/PodContainersTable/PodContainersTable.d.ts +0 -8
  77. package/lib/src/components/PodContainersTable/index.d.ts +0 -1
  78. package/lib/src/components/PodDropdown/index.d.ts +0 -9
  79. package/lib/src/components/PodLog/index.d.ts +0 -6
  80. package/lib/src/components/PodSelectorTable/index.d.ts +0 -6
  81. package/lib/src/components/PodShellModal/PodShell.d.ts +0 -18
  82. package/lib/src/components/PodShellModal/index.d.ts +0 -10
  83. package/lib/src/components/PortsTable/index.d.ts +0 -7
  84. package/lib/src/components/ReferenceLink/index.d.ts +0 -8
  85. package/lib/src/components/ReplicasDropdown/index.d.ts +0 -9
  86. package/lib/src/components/ResourceCRUD/ResourceCRUD.d.ts +0 -8
  87. package/lib/src/components/ResourceCRUD/create/index.d.ts +0 -8
  88. package/lib/src/components/ResourceCRUD/index.d.ts +0 -4
  89. package/lib/src/components/ResourceCRUD/list/index.d.ts +0 -9
  90. package/lib/src/components/ResourceCRUD/show/index.d.ts +0 -9
  91. package/lib/src/components/ResourceFiledDisplays.d.ts +0 -7
  92. package/lib/src/components/ResourceLink/index.d.ts +0 -8
  93. package/lib/src/components/ResourceSelect/index.d.ts +0 -12
  94. package/lib/src/components/ResourceTable/index.d.ts +0 -9
  95. package/lib/src/components/ResourceUsageBar/index.d.ts +0 -8
  96. package/lib/src/components/Separator/index.d.ts +0 -2
  97. package/lib/src/components/ServiceComponents/index.d.ts +0 -10
  98. package/lib/src/components/Shell/ShellToolbar.d.ts +0 -16
  99. package/lib/src/components/Shell/index.d.ts +0 -74
  100. package/lib/src/components/ShowContent/ShowContent.d.ts +0 -18
  101. package/lib/src/components/ShowContent/fields.d.ts +0 -76
  102. package/lib/src/components/ShowContent/groups.d.ts +0 -24
  103. package/lib/src/components/ShowContent/index.d.ts +0 -4
  104. package/lib/src/components/ShowContent/tabs.d.ts +0 -5
  105. package/lib/src/components/StateTag/StateTag.d.ts +0 -10
  106. package/lib/src/components/StateTag/index.d.ts +0 -1
  107. package/lib/src/components/Table/TableToolBar.d.ts +0 -8
  108. package/lib/src/components/Table/TableWidgets.d.ts +0 -6
  109. package/lib/src/components/Table/index.d.ts +0 -43
  110. package/lib/src/components/Tabs/index.d.ts +0 -10
  111. package/lib/src/components/Tags/index.d.ts +0 -6
  112. package/lib/src/components/TextTags/index.d.ts +0 -6
  113. package/lib/src/components/Time/index.d.ts +0 -8
  114. package/lib/src/components/ValueDisplay/index.d.ts +0 -9
  115. package/lib/src/components/WorkloadDropdown/index.d.ts +0 -9
  116. package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +0 -9
  117. package/lib/src/components/WorkloadPodsTable/index.d.ts +0 -1
  118. package/lib/src/components/WorkloadReplicas/index.d.ts +0 -17
  119. package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.d.ts +0 -9
  120. package/lib/src/components/YamlEditor/MonacoYamlEditor.d.ts +0 -19
  121. package/lib/src/components/YamlEditor/YamlEditorComponent.d.ts +0 -27
  122. package/lib/src/components/YamlEditor/index.d.ts +0 -1
  123. package/lib/src/components/YamlEditor/style.d.ts +0 -11
  124. package/lib/src/components/YamlEditor/yaml.worker.d.ts +0 -1
  125. package/lib/src/components/index.d.ts +0 -49
  126. package/lib/src/constants/auth.d.ts +0 -5
  127. package/lib/src/constants/index.d.ts +0 -3
  128. package/lib/src/constants/k8s.d.ts +0 -522
  129. package/lib/src/constants/state.d.ts +0 -15
  130. package/lib/src/contexts/component.d.ts +0 -8
  131. package/lib/src/contexts/configs.d.ts +0 -4
  132. package/lib/src/contexts/global-store.d.ts +0 -6
  133. package/lib/src/contexts/index.d.ts +0 -3
  134. package/lib/src/hooks/index.d.ts +0 -8
  135. package/lib/src/hooks/useDeleteModal/index.d.ts +0 -1
  136. package/lib/src/hooks/useDeleteModal/useDeleteManyModal.d.ts +0 -8
  137. package/lib/src/hooks/useDeleteModal/useDeleteModal.d.ts +0 -7
  138. package/lib/src/hooks/useDownloadYAML.d.ts +0 -7
  139. package/lib/src/hooks/useEagleTable/columns.d.ts +0 -47
  140. package/lib/src/hooks/useEagleTable/index.d.ts +0 -2
  141. package/lib/src/hooks/useEagleTable/useEagleTable.d.ts +0 -56
  142. package/lib/src/hooks/useEdit.d.ts +0 -4
  143. package/lib/src/hooks/useGlobalStore.d.ts +0 -3
  144. package/lib/src/hooks/useK8sYamlEditor.d.ts +0 -5
  145. package/lib/src/hooks/useNamespaceRefineFilter.d.ts +0 -5
  146. package/lib/src/hooks/useOpenForm.d.ts +0 -8
  147. package/lib/src/hooks/useSchema.d.ts +0 -21
  148. package/lib/src/hooks/useSubmitForm.d.ts +0 -14
  149. package/lib/src/hooks/useTableData.d.ts +0 -20
  150. package/lib/src/i18n.d.ts +0 -371
  151. package/lib/src/index.d.ts +0 -12
  152. package/lib/src/locales/en-US/index.d.ts +0 -175
  153. package/lib/src/locales/index.d.ts +0 -2
  154. package/lib/src/locales/zh-CN/index.d.ts +0 -193
  155. package/lib/src/main.d.ts +0 -3
  156. package/lib/src/models/cronjob-model.d.ts +0 -15
  157. package/lib/src/models/daemonset-model.d.ts +0 -15
  158. package/lib/src/models/deployment-model.d.ts +0 -13
  159. package/lib/src/models/event-model.d.ts +0 -7
  160. package/lib/src/models/index.d.ts +0 -19
  161. package/lib/src/models/ingress-model.d.ts +0 -20
  162. package/lib/src/models/job-model.d.ts +0 -20
  163. package/lib/src/models/network-policy-model.d.ts +0 -9
  164. package/lib/src/models/node-model.d.ts +0 -17
  165. package/lib/src/models/persistent-volume-claim.d.ts +0 -13
  166. package/lib/src/models/persistent-volume.d.ts +0 -13
  167. package/lib/src/models/pod-metrics-model.d.ts +0 -8
  168. package/lib/src/models/pod-model.d.ts +0 -20
  169. package/lib/src/models/resource-model.d.ts +0 -21
  170. package/lib/src/models/service-model.d.ts +0 -24
  171. package/lib/src/models/statefulset-model.d.ts +0 -13
  172. package/lib/src/models/storage-class.d.ts +0 -16
  173. package/lib/src/models/types/index.d.ts +0 -1
  174. package/lib/src/models/types/metric.d.ts +0 -25
  175. package/lib/src/models/workload-base-model.d.ts +0 -12
  176. package/lib/src/models/workload-model.d.ts +0 -18
  177. package/lib/src/pages/configmaps/index.d.ts +0 -4
  178. package/lib/src/pages/cronjobs/create/index.d.ts +0 -3
  179. package/lib/src/pages/cronjobs/index.d.ts +0 -3
  180. package/lib/src/pages/cronjobs/list/index.d.ts +0 -3
  181. package/lib/src/pages/cronjobs/show/index.d.ts +0 -3
  182. package/lib/src/pages/daemonsets/create/index.d.ts +0 -3
  183. package/lib/src/pages/daemonsets/index.d.ts +0 -3
  184. package/lib/src/pages/daemonsets/list/index.d.ts +0 -3
  185. package/lib/src/pages/daemonsets/show/index.d.ts +0 -3
  186. package/lib/src/pages/deployments/index.d.ts +0 -2
  187. package/lib/src/pages/deployments/list/index.d.ts +0 -3
  188. package/lib/src/pages/deployments/show/index.d.ts +0 -3
  189. package/lib/src/pages/ingresses/index.d.ts +0 -4
  190. package/lib/src/pages/jobs/index.d.ts +0 -4
  191. package/lib/src/pages/networkPolicies/index.d.ts +0 -4
  192. package/lib/src/pages/nodes/index.d.ts +0 -2
  193. package/lib/src/pages/nodes/list/index.d.ts +0 -3
  194. package/lib/src/pages/nodes/show/index.d.ts +0 -3
  195. package/lib/src/pages/persistentvolumeclaims/index.d.ts +0 -4
  196. package/lib/src/pages/persistentvolumes/index.d.ts +0 -4
  197. package/lib/src/pages/pods/create/index.d.ts +0 -3
  198. package/lib/src/pages/pods/index.d.ts +0 -3
  199. package/lib/src/pages/pods/list/index.d.ts +0 -3
  200. package/lib/src/pages/pods/show/index.d.ts +0 -3
  201. package/lib/src/pages/secrets/index.d.ts +0 -4
  202. package/lib/src/pages/services/index.d.ts +0 -4
  203. package/lib/src/pages/statefulsets/index.d.ts +0 -4
  204. package/lib/src/pages/storageclasses/form/index.d.ts +0 -9
  205. package/lib/src/pages/storageclasses/index.d.ts +0 -48
  206. package/lib/src/plugins/index.d.ts +0 -4
  207. package/lib/src/plugins/model-plugin.d.ts +0 -13
  208. package/lib/src/plugins/relation-plugin.d.ts +0 -26
  209. package/lib/src/plugins/type.d.ts +0 -8
  210. package/lib/src/providers/index.d.ts +0 -1
  211. package/lib/src/providers/router-provider/index.d.ts +0 -21
  212. package/lib/src/styles/button.d.ts +0 -1
  213. package/lib/src/styles/modal.d.ts +0 -1
  214. package/lib/src/types/index.d.ts +0 -1
  215. package/lib/src/types/resource.d.ts +0 -62
  216. package/lib/src/utils/addId.d.ts +0 -3
  217. package/lib/src/utils/download.d.ts +0 -1
  218. package/lib/src/utils/error.d.ts +0 -20
  219. package/lib/src/utils/form.d.ts +0 -3
  220. package/lib/src/utils/index.d.ts +0 -1
  221. package/lib/src/utils/k8s.d.ts +0 -3
  222. package/lib/src/utils/labels.d.ts +0 -9
  223. package/lib/src/utils/match-selector.d.ts +0 -3
  224. package/lib/src/utils/openapi.d.ts +0 -40
  225. package/lib/src/utils/schema.d.ts +0 -18
  226. package/lib/src/utils/selector.d.ts +0 -3
  227. package/lib/src/utils/shell.d.ts +0 -16
  228. package/lib/src/utils/storage.d.ts +0 -13
  229. package/lib/src/utils/string.d.ts +0 -1
  230. package/lib/src/utils/time.d.ts +0 -13
  231. package/lib/src/utils/unit.d.ts +0 -12
  232. package/lib/src/utils/yaml.d.ts +0 -2
  233. package/lib/vite.config.d.ts +0 -2
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./index-8ae38abf.js";
1
+ import { j as jsxRuntimeExports } from "./index-bf5bacd7.js";
2
2
  import * as monaco from "monaco-editor";
3
3
  import { useRef, useEffect } from "react";
4
4
  import "i18next";
@@ -10,7 +10,7 @@ import React__default, { createElement, isValidElement, cloneElement, Children,
10
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$2, Pagination, Alert, usePopModal, Modal, usePushModal, Fields, Units, OverflowTooltip, Tooltip, StatusCapsule, Dropdown, Menu as Menu$1, Icon as Icon$1, Divider, Link as Link$1, Tabs as Tabs$1, TabsTabPane, Row, Col, DonutChart, SegmentControl, Checkbox, DropdownMenu, SearchInput, Token, AntdSelectOptGroup, TableForm, 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, Dropdown, Menu as Menu$1, Icon as Icon$1, Divider, Link as Link$1, Tabs as Tabs$1, TabsTabPane, Row, Col, DonutChart, SegmentControl, Checkbox, DropdownMenu, SearchInput, Token, AntdSelectOptGroup, Popover, AntdTable, TableForm, MenuItemGroup, Layout as Layout$1, Time as Time$1, useMessage, ModalStack, KitStoreProvider, ConfigProvider } from "@cloudtower/eagle";
14
14
  import { EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, FontSize16GrayIcon, FontSize16BlueIcon, LogCollection16GrayIcon, LogCollection16GradientBlueIcon, TrashBinDeletePermanently16GrayIcon, TrashBinDeletePermanently16BlueIcon, Loading24GradientBlueIcon, OpenTerminal16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, EditPen16GradientBlueIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon, EditPen16BlueIcon } from "@cloudtower/icons-react";
15
15
  import { first, cloneDeep, set as set$1, omit as omit$1, merge, get as get$3, debounce, last, isObject as isObject$4, uniq, keyBy } from "lodash-es";
16
16
  import yaml$1 from "js-yaml";
@@ -1449,6 +1449,7 @@ const node_port = "NodePort";
1449
1449
  const protocol = "协议";
1450
1450
  const key = "键";
1451
1451
  const value = "值";
1452
+ const value_optional = "值(选填)";
1452
1453
  const effect = "效果";
1453
1454
  const show_data_value = "显示数值";
1454
1455
  const hide_data_value = "隐藏数值";
@@ -1549,6 +1550,25 @@ const change_form_mode_alert = "从编辑 YAML 切回表单编辑,将无法保
1549
1550
  const pvc_storage_required = "请填写分配量。";
1550
1551
  const pvc_storage_min = "请输入正整数。";
1551
1552
  const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1553
+ const key_empty_text = "请填写键。";
1554
+ const format_error = "格式错误。";
1555
+ const taint_effect_empty_text = "请选择效果。";
1556
+ const add_label = "添加标签";
1557
+ const add_annotation = "添加注解";
1558
+ const add_taint = "添加污点";
1559
+ const look_format_requirement = "查看格式要求";
1560
+ const yes = "是";
1561
+ const no = "否";
1562
+ const contains = "包含";
1563
+ const optional = "是否必填";
1564
+ const format_requirements = "格式要求";
1565
+ const suffix = "前缀";
1566
+ const suffix_format_rule_1 = "DNS 子域:由点 (.) 分隔的一系列 DNS 标签";
1567
+ const suffix_format_rule_2 = "不超过 253 个字符";
1568
+ const suffix_format_rule_3 = "后跟斜杠 (/),即第一个 (/) 前的内容是前缀。如有 (/) ,前缀不可为空";
1569
+ const name_format_rule_1 = "由字母、数字、连字符 (-)、下划线(_) 或点 (.) 组成";
1570
+ const name_format_rule_2 = "以字母或数字开头和结尾";
1571
+ const name_format_rule_3 = "不超过 63 个字符";
1552
1572
  const dovetail = {
1553
1573
  copy: copy$1,
1554
1574
  reset_arguments,
@@ -1655,6 +1675,7 @@ const dovetail = {
1655
1675
  protocol,
1656
1676
  key,
1657
1677
  value,
1678
+ value_optional,
1658
1679
  effect,
1659
1680
  show_data_value,
1660
1681
  hide_data_value,
@@ -1756,7 +1777,26 @@ const dovetail = {
1756
1777
  change_form_mode_alert,
1757
1778
  pvc_storage_required,
1758
1779
  pvc_storage_min,
1759
- pvc_storage_reduce_limit
1780
+ pvc_storage_reduce_limit,
1781
+ key_empty_text,
1782
+ format_error,
1783
+ taint_effect_empty_text,
1784
+ add_label,
1785
+ add_annotation,
1786
+ add_taint,
1787
+ look_format_requirement,
1788
+ yes,
1789
+ no,
1790
+ contains,
1791
+ optional,
1792
+ format_requirements,
1793
+ suffix,
1794
+ suffix_format_rule_1,
1795
+ suffix_format_rule_2,
1796
+ suffix_format_rule_3,
1797
+ name_format_rule_1,
1798
+ name_format_rule_2,
1799
+ name_format_rule_3
1760
1800
  };
1761
1801
  const ZH = {
1762
1802
  dovetail
@@ -9356,7 +9396,7 @@ const FRACTIONAL = ["", "m", "u", "n", "p", "f"];
9356
9396
  function formatSi(inValue, options) {
9357
9397
  const {
9358
9398
  increment = 1e3,
9359
- suffix = null,
9399
+ suffix: suffix2 = null,
9360
9400
  firstSuffix = null,
9361
9401
  startingExponent = 0,
9362
9402
  minExponent = 0,
@@ -9384,7 +9424,7 @@ function formatSi(inValue, options) {
9384
9424
  if (exp === 0 && firstSuffix !== null) {
9385
9425
  outStr += `${firstSuffix}`;
9386
9426
  } else {
9387
- outStr += `${UNITS[exp]}${suffix}` || "";
9427
+ outStr += `${UNITS[exp]}${suffix2}` || "";
9388
9428
  }
9389
9429
  return outStr;
9390
9430
  }
@@ -35478,7 +35518,6 @@ function ListPage(props) {
35478
35518
  tableProps,
35479
35519
  contentClassName
35480
35520
  } = props;
35481
- useTranslation();
35482
35521
  const {
35483
35522
  resource
35484
35523
  } = useResource();
@@ -37958,7 +37997,7 @@ const Separator = () => {
37958
37997
  });
37959
37998
  };
37960
37999
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
37961
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-42ab72d2.js"));
38000
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-10d71161.js"));
37962
38001
  const YamlEditorComponent = forwardRef(
37963
38002
  function YamlEditorComponent2(props, ref) {
37964
38003
  const {
@@ -39017,83 +39056,271 @@ function CronJobDropdown(props) {
39017
39056
  }
39018
39057
  ) : null });
39019
39058
  }
39059
+ function validateLabelKey(key2) {
39060
+ const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
39061
+ const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
39062
+ let prefix, name2;
39063
+ const splitResult = key2.split("/");
39064
+ if (splitResult.length === 1) {
39065
+ name2 = splitResult[0];
39066
+ } else {
39067
+ prefix = splitResult[0];
39068
+ name2 = splitResult[1];
39069
+ }
39070
+ if (prefix === "") {
39071
+ return { isValid: false, errorMessage: "EMPTY_PREFIX" };
39072
+ }
39073
+ if (prefix && !labelPrefixRegex.test(prefix)) {
39074
+ return { isValid: false, errorMessage: "INVALID_PREFIX" };
39075
+ }
39076
+ if (!labelNameRegex.test(name2)) {
39077
+ return { isValid: false, errorMessage: "INVALID_NAME" };
39078
+ }
39079
+ if (prefix && prefix.length > 253) {
39080
+ return { isValid: false, errorMessage: "MAX_253" };
39081
+ }
39082
+ if (name2 && name2.length > 63) {
39083
+ return { isValid: false, errorMessage: "MAX_63" };
39084
+ }
39085
+ return { isValid: true };
39086
+ }
39087
+ function validateLabelValue(value2) {
39088
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
39089
+ if (value2 === "") {
39090
+ return { isValid: true };
39091
+ }
39092
+ if (value2.length > 63) {
39093
+ return { isValid: false, errorMessage: "MAX_63" };
39094
+ }
39095
+ if (!labelValueRegex.test(value2)) {
39096
+ return { isValid: false, errorMessage: "INVALID_VALUE" };
39097
+ }
39098
+ return { isValid: true };
39099
+ }
39100
+ const LabelFormatPopover_105yfzn = "";
39101
+ const PodLabelFormatRulePopoverStyle = "p5jt6nm";
39102
+ const LabelFormatPopover = () => {
39103
+ const {
39104
+ t: t2
39105
+ } = useTranslation();
39106
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Popover, {
39107
+ overlayClassName: PodLabelFormatRulePopoverStyle,
39108
+ placement: "bottomRight",
39109
+ content: /* @__PURE__ */ jsxRuntimeExports.jsx(AntdTable, {
39110
+ bordered: true,
39111
+ dataSource: [{
39112
+ object: t2("dovetail.key"),
39113
+ contains: t2("dovetail.suffix"),
39114
+ optional: t2("dovetail.no"),
39115
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
39116
+ }, {
39117
+ object: t2("dovetail.key"),
39118
+ contains: t2("dovetail.name"),
39119
+ optional: t2("dovetail.yes"),
39120
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
39121
+ }, {
39122
+ object: t2("dovetail.value"),
39123
+ contains: t2("dovetail.name"),
39124
+ optional: t2("dovetail.no"),
39125
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
39126
+ }],
39127
+ columns: [{
39128
+ key: "object",
39129
+ title: t2("dovetail.object"),
39130
+ dataIndex: "object",
39131
+ render: (cell, record, index2) => {
39132
+ return {
39133
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39134
+ className: Typo.Label.l4_bold,
39135
+ children: cell
39136
+ }),
39137
+ props: {
39138
+ rowSpan: index2 === 0 ? 2 : index2 === 1 ? 0 : 1
39139
+ }
39140
+ };
39141
+ }
39142
+ }, {
39143
+ key: "contains",
39144
+ title: t2("dovetail.contains"),
39145
+ dataIndex: "contains"
39146
+ }, {
39147
+ key: "optional",
39148
+ title: t2("dovetail.optional"),
39149
+ dataIndex: "optional"
39150
+ }, {
39151
+ key: "rule",
39152
+ title: t2("dovetail.format_requirements"),
39153
+ dataIndex: "rule",
39154
+ render: (cell) => {
39155
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
39156
+ className: "rule-list",
39157
+ children: cell.map((rule2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39158
+ children: rule2
39159
+ }, index2))
39160
+ });
39161
+ }
39162
+ }],
39163
+ pagination: false
39164
+ }),
39165
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
39166
+ size: "small",
39167
+ type: "link",
39168
+ children: t2("dovetail.look_format_requirement")
39169
+ })
39170
+ });
39171
+ };
39172
+ const KeyValueTableForm_1eydq7y = "";
39173
+ function _KeyValueTableFormForm(props, ref) {
39174
+ const {
39175
+ defaultValue,
39176
+ onSubmit,
39177
+ extraColumns,
39178
+ addButtonText
39179
+ } = props;
39180
+ const {
39181
+ t: t2
39182
+ } = useTranslation();
39183
+ const [value2, setValue] = useState([]);
39184
+ const tableFormRef = useRef(null);
39185
+ useImperativeHandle(ref, () => ({
39186
+ submit: () => {
39187
+ return new Promise((res, rej) => {
39188
+ var _a;
39189
+ (_a = tableFormRef.current) == null ? void 0 : _a.validateWholeFields();
39190
+ setTimeout(() => {
39191
+ var _a2;
39192
+ const isValid = (_a2 = tableFormRef.current) == null ? void 0 : _a2.isValid();
39193
+ if (isValid) {
39194
+ res(onSubmit(value2));
39195
+ } else {
39196
+ rej();
39197
+ }
39198
+ }, 0);
39199
+ });
39200
+ }
39201
+ }), [onSubmit, value2]);
39202
+ const renderTextAreaFunc = ({
39203
+ value: value22,
39204
+ onChange
39205
+ }) => {
39206
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TextArea, {
39207
+ autoSize: true,
39208
+ className: "clsjtk2",
39209
+ size: "small",
39210
+ value: value22,
39211
+ onChange: (e2) => {
39212
+ onChange(e2.target.value);
39213
+ }
39214
+ });
39215
+ };
39216
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Space, {
39217
+ size: 8,
39218
+ direction: "vertical",
39219
+ className: "cq3mbby",
39220
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(TableForm, {
39221
+ ref: tableFormRef,
39222
+ onBodyChange: (value22) => {
39223
+ setValue(value22);
39224
+ },
39225
+ columns: [{
39226
+ key: "key",
39227
+ title: t2("dovetail.key"),
39228
+ type: "input",
39229
+ validator: ({
39230
+ value: value22
39231
+ }) => {
39232
+ if (!value22)
39233
+ return t2("dovetail.key_empty_text");
39234
+ const {
39235
+ isValid,
39236
+ errorMessage
39237
+ } = validateLabelKey(value22 || "");
39238
+ if (!isValid)
39239
+ return t2("dovetail.format_error");
39240
+ },
39241
+ render: renderTextAreaFunc
39242
+ }, {
39243
+ key: "value",
39244
+ title: t2("dovetail.value_optional"),
39245
+ type: "input",
39246
+ validator: ({
39247
+ value: value22
39248
+ }) => {
39249
+ const {
39250
+ isValid
39251
+ } = validateLabelValue(value22 || "");
39252
+ if (!isValid)
39253
+ return t2("dovetail.format_error");
39254
+ },
39255
+ render: renderTextAreaFunc
39256
+ }, ...extraColumns || []],
39257
+ disableBatchFilling: true,
39258
+ hideEmptyTable: true,
39259
+ rowAddConfig: {
39260
+ addible: true,
39261
+ text: () => addButtonText
39262
+ },
39263
+ defaultData: defaultValue,
39264
+ row: {
39265
+ deletable: true
39266
+ }
39267
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
39268
+ });
39269
+ }
39270
+ const KeyValueTableFormForm = React__default.forwardRef(_KeyValueTableFormForm);
39020
39271
  const EditLabelForm = React__default.forwardRef(
39021
39272
  function EditLabelForm2(props, ref) {
39022
39273
  var _a;
39023
39274
  const { resourceModel } = props;
39024
39275
  const { mutateAsync } = useUpdate();
39025
39276
  const { t: t2 } = useTranslation();
39026
- const [value2, setValue] = useState([]);
39027
39277
  const defaultValue = useMemo(() => {
39028
39278
  var _a2;
39029
39279
  return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.labels) || {}).map((key2) => {
39030
39280
  var _a3, _b;
39031
- return { key: key2, value: (_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.labels) == null ? void 0 : _b[key2] };
39281
+ return { key: key2, value: ((_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.labels) == null ? void 0 : _b[key2]) || "" };
39032
39282
  });
39033
39283
  }, [(_a = resourceModel.metadata) == null ? void 0 : _a.labels]);
39034
- const submit = useCallback(() => {
39035
- const newLabels = {};
39036
- value2.forEach(({ key: key2, value: value22 }) => {
39037
- newLabels[key2] = value22;
39038
- });
39039
- const newYaml = resourceModel.updateLabel(newLabels);
39040
- pruneBeforeEdit(newYaml);
39041
- return mutateAsync({
39042
- id: resourceModel.id,
39043
- resource: resourceModel.name || "",
39044
- values: newYaml,
39045
- meta: {
39046
- resourceBasePath: resourceModel.apiVersion,
39047
- kind: resourceModel.kind
39048
- },
39049
- successNotification() {
39050
- return {
39051
- message: t2("dovetail.edit_label_success_toast", {
39052
- kind: resourceModel.kind,
39053
- name: resourceModel.metadata.name,
39054
- interpolation: {
39055
- escapeValue: false
39056
- }
39057
- }),
39058
- type: "success"
39059
- };
39060
- },
39061
- errorNotification: false
39062
- });
39063
- }, [value2, resourceModel, mutateAsync, t2]);
39064
- useImperativeHandle(
39065
- ref,
39066
- () => ({
39067
- submit
39068
- }),
39069
- [submit]
39284
+ const onSubmit = useCallback(
39285
+ (value2) => {
39286
+ const newLabels = {};
39287
+ value2.forEach(({ key: key2, value: value22 }) => {
39288
+ newLabels[key2] = value22 || "";
39289
+ });
39290
+ const newYaml = resourceModel.updateLabel(newLabels);
39291
+ pruneBeforeEdit(newYaml);
39292
+ return mutateAsync({
39293
+ id: resourceModel.id,
39294
+ resource: resourceModel.name || "",
39295
+ values: newYaml,
39296
+ meta: {
39297
+ resourceBasePath: resourceModel.apiVersion,
39298
+ kind: resourceModel.kind
39299
+ },
39300
+ successNotification() {
39301
+ return {
39302
+ message: t2("dovetail.edit_label_success_toast", {
39303
+ kind: resourceModel.kind,
39304
+ name: resourceModel.metadata.name,
39305
+ interpolation: {
39306
+ escapeValue: false
39307
+ }
39308
+ }),
39309
+ type: "success"
39310
+ };
39311
+ },
39312
+ errorNotification: false
39313
+ });
39314
+ },
39315
+ [resourceModel, mutateAsync, t2]
39070
39316
  );
39071
39317
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
39072
- TableForm,
39318
+ KeyValueTableFormForm,
39073
39319
  {
39074
- onBodyChange: (value22) => {
39075
- setValue(value22);
39076
- },
39077
- columns: [
39078
- {
39079
- key: "key",
39080
- title: t2("dovetail.key"),
39081
- type: "input"
39082
- },
39083
- {
39084
- key: "value",
39085
- title: t2("dovetail.value"),
39086
- type: "input"
39087
- }
39088
- ],
39089
- disableBatchFilling: true,
39090
- rowAddConfig: {
39091
- addible: true
39092
- },
39093
- defaultData: defaultValue,
39094
- row: {
39095
- deletable: true
39096
- }
39320
+ ref,
39321
+ defaultValue,
39322
+ onSubmit,
39323
+ addButtonText: t2("dovetail.add_label")
39097
39324
  }
39098
39325
  );
39099
39326
  }
@@ -39130,24 +39357,23 @@ function EditLabelDropdownMenuItem(props) {
39130
39357
  }
39131
39358
  );
39132
39359
  }
39133
- const EditAnnotationForm = React__default.forwardRef(
39134
- function EditAnnotationForm2(props, ref) {
39135
- var _a;
39136
- const { resourceModel } = props;
39137
- const { mutateAsync } = useUpdate();
39138
- const { t: t2 } = useTranslation();
39139
- const [value2, setValue] = useState([]);
39140
- const defaultValue = useMemo(() => {
39141
- var _a2;
39142
- return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.annotations) || {}).map((key2) => {
39143
- var _a3, _b;
39144
- return { key: key2, value: (_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.annotations) == null ? void 0 : _b[key2] };
39145
- });
39146
- }, [(_a = resourceModel.metadata) == null ? void 0 : _a.annotations]);
39147
- const submit = useCallback(() => {
39360
+ const EditAnnotationForm = React__default.forwardRef(function EditAnnotationForm2(props, ref) {
39361
+ var _a;
39362
+ const { resourceModel } = props;
39363
+ const { mutateAsync } = useUpdate();
39364
+ const { t: t2 } = useTranslation();
39365
+ const defaultValue = useMemo(() => {
39366
+ var _a2;
39367
+ return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.annotations) || {}).map((key2) => {
39368
+ var _a3, _b;
39369
+ return { key: key2, value: ((_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.annotations) == null ? void 0 : _b[key2]) || "" };
39370
+ });
39371
+ }, [(_a = resourceModel.metadata) == null ? void 0 : _a.annotations]);
39372
+ const onSubmit = useCallback(
39373
+ (value2) => {
39148
39374
  const newAnnotations = {};
39149
39375
  value2.forEach(({ key: key2, value: value22 }) => {
39150
- newAnnotations[key2] = value22;
39376
+ newAnnotations[key2] = value22 || "";
39151
39377
  });
39152
39378
  const newYaml = resourceModel.updateAnnotation(newAnnotations);
39153
39379
  pruneBeforeEdit(newYaml);
@@ -39173,44 +39399,19 @@ const EditAnnotationForm = React__default.forwardRef(
39173
39399
  },
39174
39400
  errorNotification: false
39175
39401
  });
39176
- }, [value2, resourceModel, mutateAsync, t2]);
39177
- useImperativeHandle(
39402
+ },
39403
+ [resourceModel, mutateAsync, t2]
39404
+ );
39405
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39406
+ KeyValueTableFormForm,
39407
+ {
39178
39408
  ref,
39179
- () => ({
39180
- submit
39181
- }),
39182
- [submit]
39183
- );
39184
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
39185
- TableForm,
39186
- {
39187
- onBodyChange: (value22) => {
39188
- setValue(value22);
39189
- },
39190
- columns: [
39191
- {
39192
- key: "key",
39193
- title: t2("dovetail.key"),
39194
- type: "input"
39195
- },
39196
- {
39197
- key: "value",
39198
- title: t2("dovetail.value"),
39199
- type: "input"
39200
- }
39201
- ],
39202
- disableBatchFilling: true,
39203
- rowAddConfig: {
39204
- addible: true
39205
- },
39206
- defaultData: defaultValue,
39207
- row: {
39208
- deletable: true
39209
- }
39210
- }
39211
- );
39212
- }
39213
- );
39409
+ defaultValue,
39410
+ onSubmit,
39411
+ addButtonText: t2("dovetail.add_annotation")
39412
+ }
39413
+ );
39414
+ });
39214
39415
  function EditAnnotationDropdownMenuItem(props) {
39215
39416
  const { formRef, resourceModel } = props;
39216
39417
  const { t: t2 } = useTranslation();
@@ -40685,6 +40886,8 @@ export {
40685
40886
  generateValueFromSchema as d5,
40686
40887
  generateSchemaTypeValue as d6,
40687
40888
  resolveRef as d7,
40889
+ getApiVersion as d8,
40890
+ pruneBeforeEdit as d9,
40688
40891
  NameSpaceColumnRenderer as e,
40689
40892
  WorkloadRestartsColumnRenderer as f,
40690
40893
  NodeNameColumnRenderer as g,
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { bM, cB, A, aV, aX, aE, c9, bj, a1, cn, cb, aP, T, C, i, cF, aH, bo, ac, cH, ai, ap, cQ, aw, cc, ca, cT, aL, bv, w, aC, bC, cS, cC, bF, D, b0, as, bI, ar, a0, c8, c7, cR, bh, aT, ad, bP, cE, cG, cl, aF, aj, s, q, cI, I, bs, aS, t, M, bd, bf, cd, cK, aK, br, aq, ax, ay, a8, az, aW, aD, bD, bG, a9, d1, cm, cw, bL, N, a2, e, aU, a6, bO, bx, bw, cJ, b_, cY, g, cX, aI, bp, cf, L, b9, ba, bn, H, bb, J, bc, B, b4, cz, z, b3, G, b7, E, b5, F, b6, K, b$, b8, cy, aa, c$, c_, P, bl, v, ae, ah, bZ, bi, cO, cN, a_, bt, c5, c4, p, aJ, bk, x, bu, a$, d0, y, cp, cD, bJ, bQ, bR, d3, aG, R, ag, an, am, bK, ak, cP, c1, al, cA, c6, bg, bz, at, h, Q, O, be, cs, cv, cr, cq, ct, cu, co, cg, cj, ck, ci, ch, ce, cx, bS, aM, bq, aA, m, bV, l, aY, cW, o, bW, aZ, n, aR, bm, k, cV, aO, aQ, c3, bB, bA, c2, aN, S, bE, cU, cZ, b1, b2, by, bH, c0, bX, bY, ab, $, cM, af, W, cL, ao, av, au, f, aB, bT, U, a3, d, d6, d5, d2, a7, d4, d7, a5, a4, r, a, c, X, V, Y, Z, u, bN, _, bU, b } from "./index-8ae38abf.js";
1
+ import { bM, cB, A, aV, aX, aE, c9, bj, a1, cn, cb, aP, T, C, i, cF, aH, bo, ac, cH, ai, ap, cQ, aw, cc, ca, cT, aL, bv, w, aC, bC, cS, cC, bF, D, b0, as, bI, ar, a0, c8, c7, cR, bh, aT, ad, bP, cE, cG, cl, aF, aj, s, q, cI, I, bs, aS, t, M, bd, bf, cd, cK, aK, br, aq, ax, ay, a8, az, aW, aD, bD, bG, a9, d1, cm, cw, bL, N, a2, e, aU, a6, bO, bx, bw, cJ, b_, cY, g, cX, aI, bp, cf, L, b9, ba, bn, H, bb, J, bc, B, b4, cz, z, b3, G, b7, E, b5, F, b6, K, b$, b8, cy, aa, c$, c_, P, bl, v, ae, ah, bZ, bi, cO, cN, a_, bt, c5, c4, p, aJ, bk, x, bu, a$, d0, y, cp, cD, bJ, bQ, bR, d3, aG, R, ag, an, am, bK, ak, cP, c1, al, cA, c6, bg, bz, at, h, Q, O, be, cs, cv, cr, cq, ct, cu, co, cg, cj, ck, ci, ch, ce, cx, bS, aM, bq, aA, m, bV, l, aY, cW, o, bW, aZ, n, aR, bm, k, cV, aO, aQ, c3, bB, bA, c2, aN, S, bE, cU, cZ, b1, b2, by, bH, c0, bX, bY, ab, $, cM, af, W, cL, ao, av, au, f, aB, bT, U, a3, d, d6, d5, d8, d2, a7, d9, d4, d7, a5, a4, r, a, c, X, V, Y, Z, u, bN, _, bU, b } from "./index-bf5bacd7.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "react";
@@ -250,8 +250,10 @@ export {
250
250
  d as dovetailRefineI18n,
251
251
  d6 as generateSchemaTypeValue,
252
252
  d5 as generateValueFromSchema,
253
+ d8 as getApiVersion,
253
254
  d2 as modelPlugin,
254
255
  a7 as namespaceRules,
256
+ d9 as pruneBeforeEdit,
255
257
  d4 as relationPlugin,
256
258
  d7 as resolveRef,
257
259
  a5 as rfc1035LabelRules,