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

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 (237) hide show
  1. package/dist/{MonacoYamlDiffEditor-42ab72d2.js → MonacoYamlDiffEditor-ae1a891e.js} +1 -1
  2. package/dist/{index-8ae38abf.js → index-90c4694a.js} +709 -322
  3. package/dist/refine.js +175 -172
  4. package/dist/refine.umd.cjs +535 -148
  5. package/dist/style.css +185 -0
  6. package/lib/components/DropdownMenuItems/index.d.ts +1 -0
  7. package/lib/components/EditField/index.d.ts +3 -0
  8. package/lib/components/EditMetadataForm/KeyValueTableForm.d.ts +15 -0
  9. package/lib/components/EditMetadataForm/LabelFormatPopover.d.ts +3 -0
  10. package/lib/components/Form/useYamlForm.d.ts +1 -1
  11. package/lib/i18n.d.ts +26 -0
  12. package/lib/locales/zh-CN/index.d.ts +26 -0
  13. package/lib/types/resource.d.ts +1 -1
  14. package/lib/utils/index.d.ts +1 -0
  15. package/lib/utils/schema-store.d.ts +13 -0
  16. package/lib/utils/validation.d.ts +8 -0
  17. package/package.json +7 -7
  18. package/lib/components/CronJobDropdown/index.d.ts +0 -9
  19. package/lib/components/K8sDropdown/index.d.ts +0 -9
  20. package/lib/components/PodDropdown/index.d.ts +0 -9
  21. package/lib/components/ReplicasDropdown/index.d.ts +0 -9
  22. package/lib/components/Table/TableToolBar.d.ts +0 -9
  23. package/lib/components/Table/TableWidgets.d.ts +0 -6
  24. package/lib/components/WorkloadDropdown/index.d.ts +0 -9
  25. package/lib/src/App.d.ts +0 -3
  26. package/lib/src/Dovetail.d.ts +0 -18
  27. package/lib/src/components/Breadcrumb/index.d.ts +0 -6
  28. package/lib/src/components/ConditionsTable/ConditionsTable.d.ts +0 -7
  29. package/lib/src/components/ConditionsTable/index.d.ts +0 -1
  30. package/lib/src/components/CreateButton/index.d.ts +0 -2
  31. package/lib/src/components/CronJobDropdown/index.d.ts +0 -9
  32. package/lib/src/components/CronjobJobsTable/index.d.ts +0 -8
  33. package/lib/src/components/DeleteButton/index.d.ts +0 -2
  34. package/lib/src/components/DeleteManyButton/index.d.ts +0 -4
  35. package/lib/src/components/DrawerShow/DrawerShow.d.ts +0 -9
  36. package/lib/src/components/DrawerShow/index.d.ts +0 -1
  37. package/lib/src/components/DurationTime/index.d.ts +0 -6
  38. package/lib/src/components/EditButton/index.d.ts +0 -2
  39. package/lib/src/components/EditField/index.d.ts +0 -15
  40. package/lib/src/components/ErrorContent/index.d.ts +0 -17
  41. package/lib/src/components/EventsTable/EventsTable.d.ts +0 -6
  42. package/lib/src/components/EventsTable/index.d.ts +0 -1
  43. package/lib/src/components/Form/FormModal.d.ts +0 -9
  44. package/lib/src/components/Form/RefineFormContent.d.ts +0 -12
  45. package/lib/src/components/Form/RefineFormPage.d.ts +0 -7
  46. package/lib/src/components/Form/YamlForm.d.ts +0 -29
  47. package/lib/src/components/Form/index.d.ts +0 -7
  48. package/lib/src/components/Form/type.d.ts +0 -17
  49. package/lib/src/components/Form/useFieldsConfig.d.ts +0 -4
  50. package/lib/src/components/Form/useReactHookForm.d.ts +0 -30
  51. package/lib/src/components/Form/useRefineForm.d.ts +0 -13
  52. package/lib/src/components/Form/useYamlForm.d.ts +0 -50
  53. package/lib/src/components/FormErrorAlert/index.d.ts +0 -9
  54. package/lib/src/components/FormLayout/index.d.ts +0 -7
  55. package/lib/src/components/FormWidgets/KeyValueListWidget.d.ts +0 -6
  56. package/lib/src/components/FormWidgets/MetadataForm.d.ts +0 -2
  57. package/lib/src/components/FormWidgets/NameInputWidget.d.ts +0 -51
  58. package/lib/src/components/FormWidgets/NamespaceSelectWidget.d.ts +0 -9
  59. package/lib/src/components/FormWidgets/index.d.ts +0 -4
  60. package/lib/src/components/FormWidgets/widget.d.ts +0 -5
  61. package/lib/src/components/ImageNames/index.d.ts +0 -5
  62. package/lib/src/components/IngressRulesComponent/index.d.ts +0 -5
  63. package/lib/src/components/IngressRulesTable/IngressRulesTable.d.ts +0 -7
  64. package/lib/src/components/IngressRulesTable/index.d.ts +0 -1
  65. package/lib/src/components/K8sDropdown/index.d.ts +0 -9
  66. package/lib/src/components/KeyValue/KeyValue.d.ts +0 -7
  67. package/lib/src/components/KeyValue/KeyValueAnnotation.d.ts +0 -6
  68. package/lib/src/components/KeyValue/KeyValueSecret.d.ts +0 -5
  69. package/lib/src/components/KeyValue/index.d.ts +0 -3
  70. package/lib/src/components/Layout/index.d.ts +0 -3
  71. package/lib/src/components/LinkFallback/index.d.ts +0 -4
  72. package/lib/src/components/ListPage/index.d.ts +0 -10
  73. package/lib/src/components/Menu/index.d.ts +0 -2
  74. package/lib/src/components/NamespacesFilter/index.d.ts +0 -11
  75. package/lib/src/components/NetworkPolicyRulesViewer/NetworkPolicyRulesViewer.d.ts +0 -8
  76. package/lib/src/components/NetworkPolicyRulesViewer/index.d.ts +0 -1
  77. package/lib/src/components/PVCDistributeStorage/index.d.ts +0 -16
  78. package/lib/src/components/PageShow/PageShow.d.ts +0 -12
  79. package/lib/src/components/PageShow/index.d.ts +0 -1
  80. package/lib/src/components/PodContainersTable/PodContainersTable.d.ts +0 -8
  81. package/lib/src/components/PodContainersTable/index.d.ts +0 -1
  82. package/lib/src/components/PodDropdown/index.d.ts +0 -9
  83. package/lib/src/components/PodLog/index.d.ts +0 -6
  84. package/lib/src/components/PodSelectorTable/index.d.ts +0 -6
  85. package/lib/src/components/PodShellModal/PodShell.d.ts +0 -18
  86. package/lib/src/components/PodShellModal/index.d.ts +0 -10
  87. package/lib/src/components/PortsTable/index.d.ts +0 -7
  88. package/lib/src/components/ReferenceLink/index.d.ts +0 -8
  89. package/lib/src/components/ReplicasDropdown/index.d.ts +0 -9
  90. package/lib/src/components/ResourceCRUD/ResourceCRUD.d.ts +0 -8
  91. package/lib/src/components/ResourceCRUD/create/index.d.ts +0 -8
  92. package/lib/src/components/ResourceCRUD/index.d.ts +0 -4
  93. package/lib/src/components/ResourceCRUD/list/index.d.ts +0 -9
  94. package/lib/src/components/ResourceCRUD/show/index.d.ts +0 -9
  95. package/lib/src/components/ResourceFiledDisplays.d.ts +0 -7
  96. package/lib/src/components/ResourceLink/index.d.ts +0 -8
  97. package/lib/src/components/ResourceSelect/index.d.ts +0 -12
  98. package/lib/src/components/ResourceTable/index.d.ts +0 -9
  99. package/lib/src/components/ResourceUsageBar/index.d.ts +0 -8
  100. package/lib/src/components/Separator/index.d.ts +0 -2
  101. package/lib/src/components/ServiceComponents/index.d.ts +0 -10
  102. package/lib/src/components/Shell/ShellToolbar.d.ts +0 -16
  103. package/lib/src/components/Shell/index.d.ts +0 -74
  104. package/lib/src/components/ShowContent/ShowContent.d.ts +0 -18
  105. package/lib/src/components/ShowContent/fields.d.ts +0 -76
  106. package/lib/src/components/ShowContent/groups.d.ts +0 -24
  107. package/lib/src/components/ShowContent/index.d.ts +0 -4
  108. package/lib/src/components/ShowContent/tabs.d.ts +0 -5
  109. package/lib/src/components/StateTag/StateTag.d.ts +0 -10
  110. package/lib/src/components/StateTag/index.d.ts +0 -1
  111. package/lib/src/components/Table/TableToolBar.d.ts +0 -8
  112. package/lib/src/components/Table/TableWidgets.d.ts +0 -6
  113. package/lib/src/components/Table/index.d.ts +0 -43
  114. package/lib/src/components/Tabs/index.d.ts +0 -10
  115. package/lib/src/components/Tags/index.d.ts +0 -6
  116. package/lib/src/components/TextTags/index.d.ts +0 -6
  117. package/lib/src/components/Time/index.d.ts +0 -8
  118. package/lib/src/components/ValueDisplay/index.d.ts +0 -9
  119. package/lib/src/components/WorkloadDropdown/index.d.ts +0 -9
  120. package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +0 -9
  121. package/lib/src/components/WorkloadPodsTable/index.d.ts +0 -1
  122. package/lib/src/components/WorkloadReplicas/index.d.ts +0 -17
  123. package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.d.ts +0 -9
  124. package/lib/src/components/YamlEditor/MonacoYamlEditor.d.ts +0 -19
  125. package/lib/src/components/YamlEditor/YamlEditorComponent.d.ts +0 -27
  126. package/lib/src/components/YamlEditor/index.d.ts +0 -1
  127. package/lib/src/components/YamlEditor/style.d.ts +0 -11
  128. package/lib/src/components/YamlEditor/yaml.worker.d.ts +0 -1
  129. package/lib/src/components/index.d.ts +0 -49
  130. package/lib/src/constants/auth.d.ts +0 -5
  131. package/lib/src/constants/index.d.ts +0 -3
  132. package/lib/src/constants/k8s.d.ts +0 -522
  133. package/lib/src/constants/state.d.ts +0 -15
  134. package/lib/src/contexts/component.d.ts +0 -8
  135. package/lib/src/contexts/configs.d.ts +0 -4
  136. package/lib/src/contexts/global-store.d.ts +0 -6
  137. package/lib/src/contexts/index.d.ts +0 -3
  138. package/lib/src/hooks/index.d.ts +0 -8
  139. package/lib/src/hooks/useDeleteModal/index.d.ts +0 -1
  140. package/lib/src/hooks/useDeleteModal/useDeleteManyModal.d.ts +0 -8
  141. package/lib/src/hooks/useDeleteModal/useDeleteModal.d.ts +0 -7
  142. package/lib/src/hooks/useDownloadYAML.d.ts +0 -7
  143. package/lib/src/hooks/useEagleTable/columns.d.ts +0 -47
  144. package/lib/src/hooks/useEagleTable/index.d.ts +0 -2
  145. package/lib/src/hooks/useEagleTable/useEagleTable.d.ts +0 -56
  146. package/lib/src/hooks/useEdit.d.ts +0 -4
  147. package/lib/src/hooks/useGlobalStore.d.ts +0 -3
  148. package/lib/src/hooks/useK8sYamlEditor.d.ts +0 -5
  149. package/lib/src/hooks/useNamespaceRefineFilter.d.ts +0 -5
  150. package/lib/src/hooks/useOpenForm.d.ts +0 -8
  151. package/lib/src/hooks/useSchema.d.ts +0 -21
  152. package/lib/src/hooks/useSubmitForm.d.ts +0 -14
  153. package/lib/src/hooks/useTableData.d.ts +0 -20
  154. package/lib/src/i18n.d.ts +0 -371
  155. package/lib/src/index.d.ts +0 -12
  156. package/lib/src/locales/en-US/index.d.ts +0 -175
  157. package/lib/src/locales/index.d.ts +0 -2
  158. package/lib/src/locales/zh-CN/index.d.ts +0 -193
  159. package/lib/src/main.d.ts +0 -3
  160. package/lib/src/models/cronjob-model.d.ts +0 -15
  161. package/lib/src/models/daemonset-model.d.ts +0 -15
  162. package/lib/src/models/deployment-model.d.ts +0 -13
  163. package/lib/src/models/event-model.d.ts +0 -7
  164. package/lib/src/models/index.d.ts +0 -19
  165. package/lib/src/models/ingress-model.d.ts +0 -20
  166. package/lib/src/models/job-model.d.ts +0 -20
  167. package/lib/src/models/network-policy-model.d.ts +0 -9
  168. package/lib/src/models/node-model.d.ts +0 -17
  169. package/lib/src/models/persistent-volume-claim.d.ts +0 -13
  170. package/lib/src/models/persistent-volume.d.ts +0 -13
  171. package/lib/src/models/pod-metrics-model.d.ts +0 -8
  172. package/lib/src/models/pod-model.d.ts +0 -20
  173. package/lib/src/models/resource-model.d.ts +0 -21
  174. package/lib/src/models/service-model.d.ts +0 -24
  175. package/lib/src/models/statefulset-model.d.ts +0 -13
  176. package/lib/src/models/storage-class.d.ts +0 -16
  177. package/lib/src/models/types/index.d.ts +0 -1
  178. package/lib/src/models/types/metric.d.ts +0 -25
  179. package/lib/src/models/workload-base-model.d.ts +0 -12
  180. package/lib/src/models/workload-model.d.ts +0 -18
  181. package/lib/src/pages/configmaps/index.d.ts +0 -4
  182. package/lib/src/pages/cronjobs/create/index.d.ts +0 -3
  183. package/lib/src/pages/cronjobs/index.d.ts +0 -3
  184. package/lib/src/pages/cronjobs/list/index.d.ts +0 -3
  185. package/lib/src/pages/cronjobs/show/index.d.ts +0 -3
  186. package/lib/src/pages/daemonsets/create/index.d.ts +0 -3
  187. package/lib/src/pages/daemonsets/index.d.ts +0 -3
  188. package/lib/src/pages/daemonsets/list/index.d.ts +0 -3
  189. package/lib/src/pages/daemonsets/show/index.d.ts +0 -3
  190. package/lib/src/pages/deployments/index.d.ts +0 -2
  191. package/lib/src/pages/deployments/list/index.d.ts +0 -3
  192. package/lib/src/pages/deployments/show/index.d.ts +0 -3
  193. package/lib/src/pages/ingresses/index.d.ts +0 -4
  194. package/lib/src/pages/jobs/index.d.ts +0 -4
  195. package/lib/src/pages/networkPolicies/index.d.ts +0 -4
  196. package/lib/src/pages/nodes/index.d.ts +0 -2
  197. package/lib/src/pages/nodes/list/index.d.ts +0 -3
  198. package/lib/src/pages/nodes/show/index.d.ts +0 -3
  199. package/lib/src/pages/persistentvolumeclaims/index.d.ts +0 -4
  200. package/lib/src/pages/persistentvolumes/index.d.ts +0 -4
  201. package/lib/src/pages/pods/create/index.d.ts +0 -3
  202. package/lib/src/pages/pods/index.d.ts +0 -3
  203. package/lib/src/pages/pods/list/index.d.ts +0 -3
  204. package/lib/src/pages/pods/show/index.d.ts +0 -3
  205. package/lib/src/pages/secrets/index.d.ts +0 -4
  206. package/lib/src/pages/services/index.d.ts +0 -4
  207. package/lib/src/pages/statefulsets/index.d.ts +0 -4
  208. package/lib/src/pages/storageclasses/form/index.d.ts +0 -9
  209. package/lib/src/pages/storageclasses/index.d.ts +0 -48
  210. package/lib/src/plugins/index.d.ts +0 -4
  211. package/lib/src/plugins/model-plugin.d.ts +0 -13
  212. package/lib/src/plugins/relation-plugin.d.ts +0 -26
  213. package/lib/src/plugins/type.d.ts +0 -8
  214. package/lib/src/providers/index.d.ts +0 -1
  215. package/lib/src/providers/router-provider/index.d.ts +0 -21
  216. package/lib/src/styles/button.d.ts +0 -1
  217. package/lib/src/styles/modal.d.ts +0 -1
  218. package/lib/src/types/index.d.ts +0 -1
  219. package/lib/src/types/resource.d.ts +0 -62
  220. package/lib/src/utils/addId.d.ts +0 -3
  221. package/lib/src/utils/download.d.ts +0 -1
  222. package/lib/src/utils/error.d.ts +0 -20
  223. package/lib/src/utils/form.d.ts +0 -3
  224. package/lib/src/utils/index.d.ts +0 -1
  225. package/lib/src/utils/k8s.d.ts +0 -3
  226. package/lib/src/utils/labels.d.ts +0 -9
  227. package/lib/src/utils/match-selector.d.ts +0 -3
  228. package/lib/src/utils/openapi.d.ts +0 -40
  229. package/lib/src/utils/schema.d.ts +0 -18
  230. package/lib/src/utils/selector.d.ts +0 -3
  231. package/lib/src/utils/shell.d.ts +0 -16
  232. package/lib/src/utils/storage.d.ts +0 -13
  233. package/lib/src/utils/string.d.ts +0 -1
  234. package/lib/src/utils/time.d.ts +0 -13
  235. package/lib/src/utils/unit.d.ts +0 -12
  236. package/lib/src/utils/yaml.d.ts +0 -2
  237. package/lib/vite.config.d.ts +0 -2
@@ -1455,6 +1455,7 @@ var __publicField = (obj, key, value) => {
1455
1455
  const protocol = "协议";
1456
1456
  const key = "键";
1457
1457
  const value = "值";
1458
+ const value_optional = "值(选填)";
1458
1459
  const effect = "效果";
1459
1460
  const show_data_value = "显示数值";
1460
1461
  const hide_data_value = "隐藏数值";
@@ -1555,6 +1556,31 @@ var __publicField = (obj, key, value) => {
1555
1556
  const pvc_storage_required = "请填写分配量。";
1556
1557
  const pvc_storage_min = "请输入正整数。";
1557
1558
  const pvc_storage_reduce_limit = "输入值不得小于当前数值。";
1559
+ const key_empty_text = "请填写键。";
1560
+ const format_error = "格式错误。";
1561
+ const taint_effect_empty_text = "请选择效果。";
1562
+ const add_label = "添加标签";
1563
+ const add_annotation = "添加注解";
1564
+ const add_taint = "添加污点";
1565
+ const look_format_requirement = "查看格式要求";
1566
+ const yes = "是";
1567
+ const no = "否";
1568
+ const contains = "包含";
1569
+ const optional = "是否必填";
1570
+ const format_requirements = "格式要求";
1571
+ const suffix = "前缀";
1572
+ const suffix_format_rule_1 = "DNS 子域:由点 (.) 分隔的一系列 DNS 标签";
1573
+ const suffix_format_rule_2 = "不超过 253 个字符";
1574
+ const suffix_format_rule_3 = "后跟斜杠 (/),即第一个 (/) 前的内容是前缀。如有 (/) ,前缀不可为空";
1575
+ const name_format_rule_1 = "由字母、数字、连字符 (-)、下划线(_) 或点 (.) 组成";
1576
+ const name_format_rule_2 = "以字母或数字开头和结尾";
1577
+ const name_format_rule_3 = "不超过 63 个字符";
1578
+ const taint_effect_NoSchedule_tooltip_1 = "正在节点上运行的 Pod 不会被驱逐。";
1579
+ const taint_effect_NoSchedule_tooltip_2 = "新 Pod 不会调度到污点节点,除非有匹配的容忍度。";
1580
+ const taint_effect_PreferNoSchedule_tooltip_1 = "不容忍污点的 Pod 将被立即驱逐。";
1581
+ const taint_effect_PreferNoSchedule_tooltip_2 = "容忍污点但未设置容忍时长的 Pod 将继续运行。";
1582
+ const taint_effect_PreferNoSchedule_tooltip_3 = "容忍污点并设置了容忍时长的 Pod 将按指定时间运行,时间结束后被驱逐。";
1583
+ const taint_effect_NoExecute_tooltip_3 = "控制平面将尝试避免将不能容忍污点的 Pod 调度到节点上,但无法保证完全避免。";
1558
1584
  const dovetail = {
1559
1585
  copy: copy$1,
1560
1586
  reset_arguments,
@@ -1661,6 +1687,7 @@ var __publicField = (obj, key, value) => {
1661
1687
  protocol,
1662
1688
  key,
1663
1689
  value,
1690
+ value_optional,
1664
1691
  effect,
1665
1692
  show_data_value,
1666
1693
  hide_data_value,
@@ -1762,7 +1789,32 @@ var __publicField = (obj, key, value) => {
1762
1789
  change_form_mode_alert,
1763
1790
  pvc_storage_required,
1764
1791
  pvc_storage_min,
1765
- pvc_storage_reduce_limit
1792
+ pvc_storage_reduce_limit,
1793
+ key_empty_text,
1794
+ format_error,
1795
+ taint_effect_empty_text,
1796
+ add_label,
1797
+ add_annotation,
1798
+ add_taint,
1799
+ look_format_requirement,
1800
+ yes,
1801
+ no,
1802
+ contains,
1803
+ optional,
1804
+ format_requirements,
1805
+ suffix,
1806
+ suffix_format_rule_1,
1807
+ suffix_format_rule_2,
1808
+ suffix_format_rule_3,
1809
+ name_format_rule_1,
1810
+ name_format_rule_2,
1811
+ name_format_rule_3,
1812
+ taint_effect_NoSchedule_tooltip_1,
1813
+ taint_effect_NoSchedule_tooltip_2,
1814
+ taint_effect_PreferNoSchedule_tooltip_1,
1815
+ taint_effect_PreferNoSchedule_tooltip_2,
1816
+ taint_effect_PreferNoSchedule_tooltip_3,
1817
+ taint_effect_NoExecute_tooltip_3
1766
1818
  };
1767
1819
  const ZH = {
1768
1820
  dovetail
@@ -8155,6 +8207,9 @@ var __publicField = (obj, key, value) => {
8155
8207
  }
8156
8208
  // Fetch and process OpenAPI schemas
8157
8209
  async fetch() {
8210
+ if (this.schemas) {
8211
+ return this.schemas;
8212
+ }
8158
8213
  try {
8159
8214
  const response = await fetch(
8160
8215
  `${this.pathPrefix}${this.resourceBasePath}`
@@ -8202,6 +8257,24 @@ var __publicField = (obj, key, value) => {
8202
8257
  });
8203
8258
  }
8204
8259
  }
8260
+ class SchemaStore {
8261
+ constructor() {
8262
+ __publicField(this, "openapiMap", {});
8263
+ }
8264
+ async fetchSchemas(resourceBasePath, pathPrefix) {
8265
+ const openapi = this.openapiMap[`${resourceBasePath}-${pathPrefix}`] || new K8sOpenAPI(resourceBasePath, pathPrefix);
8266
+ this.openapiMap[`${resourceBasePath}-${pathPrefix}`] = openapi;
8267
+ const schemas = await openapi.fetch();
8268
+ return schemas;
8269
+ }
8270
+ async fetchSchema(resourceBasePath, pathPrefix, kind) {
8271
+ const openapi = this.openapiMap[`${resourceBasePath}-${pathPrefix}`] || new K8sOpenAPI(resourceBasePath, pathPrefix);
8272
+ this.openapiMap[`${resourceBasePath}-${pathPrefix}`] = openapi;
8273
+ await openapi.fetch();
8274
+ return openapi.findSchema(kind);
8275
+ }
8276
+ }
8277
+ const schemaStore = new SchemaStore();
8205
8278
  const ConstantsContext = React.createContext({
8206
8279
  schemaUrlPrefix: ""
8207
8280
  });
@@ -8220,8 +8293,7 @@ var __publicField = (obj, key, value) => {
8220
8293
  if (state2.schemasMap[apiGroup]) {
8221
8294
  return { apiGroup, schemas: state2.schemasMap[apiGroup] };
8222
8295
  }
8223
- const openapi = new K8sOpenAPI(apiGroup, schemaUrlPrefix);
8224
- const groupSchemas = await openapi.fetch();
8296
+ const groupSchemas = await schemaStore.fetchSchemas(apiGroup, schemaUrlPrefix);
8225
8297
  return { apiGroup, schemas: groupSchemas || [] };
8226
8298
  })
8227
8299
  );
@@ -8250,20 +8322,12 @@ var __publicField = (obj, key, value) => {
8250
8322
  const useResourceResult = core.useResource();
8251
8323
  const resource = (options == null ? void 0 : options.resource) || useResourceResult.resource;
8252
8324
  const { schemaUrlPrefix } = React.useContext(ConstantsContext);
8253
- const openapi = React.useMemo(
8254
- () => {
8255
- var _a2;
8256
- return new K8sOpenAPI((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath, schemaUrlPrefix);
8257
- },
8258
- [(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.resourceBasePath, schemaUrlPrefix]
8259
- );
8260
8325
  const fetchSchema = React.useCallback(async () => {
8261
- var _a2;
8326
+ var _a2, _b2;
8262
8327
  setLoading(true);
8263
8328
  setError(null);
8264
8329
  try {
8265
- await openapi.fetch();
8266
- const schema2 = await openapi.findSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.kind);
8330
+ const schema2 = await schemaStore.fetchSchema((_a2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _a2.resourceBasePath, schemaUrlPrefix, (_b2 = resource == null ? void 0 : resource.meta) == null ? void 0 : _b2.kind);
8267
8331
  setSchema(schema2 || null);
8268
8332
  setError(null);
8269
8333
  } catch (e2) {
@@ -8271,7 +8335,7 @@ var __publicField = (obj, key, value) => {
8271
8335
  } finally {
8272
8336
  setLoading(false);
8273
8337
  }
8274
- }, [(_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.kind, openapi]);
8338
+ }, [(_a = resource == null ? void 0 : resource.meta) == null ? void 0 : _a.kind, (_b = resource == null ? void 0 : resource.meta) == null ? void 0 : _b.resourceBasePath, schemaUrlPrefix]);
8275
8339
  React.useEffect(() => {
8276
8340
  if (options == null ? void 0 : options.skip)
8277
8341
  return;
@@ -8896,11 +8960,6 @@ var __publicField = (obj, key, value) => {
8896
8960
  } = props;
8897
8961
  const auxiliaryLineRef = React.useRef(null);
8898
8962
  const wrapperRef = React.useRef(null);
8899
- React.useMemo(() => ({
8900
- current: currentPage,
8901
- pageSize: defaultSize,
8902
- onChange: onPageChange
8903
- }), [currentPage, defaultSize, onPageChange]);
8904
8963
  const finalColumns = React.useMemo(() => {
8905
8964
  if (RowMenu) {
8906
8965
  const actionColumn = {
@@ -9362,7 +9421,7 @@ var __publicField = (obj, key, value) => {
9362
9421
  function formatSi(inValue, options) {
9363
9422
  const {
9364
9423
  increment = 1e3,
9365
- suffix = null,
9424
+ suffix: suffix2 = null,
9366
9425
  firstSuffix = null,
9367
9426
  startingExponent = 0,
9368
9427
  minExponent = 0,
@@ -9390,7 +9449,7 @@ var __publicField = (obj, key, value) => {
9390
9449
  if (exp === 0 && firstSuffix !== null) {
9391
9450
  outStr += `${firstSuffix}`;
9392
9451
  } else {
9393
- outStr += `${UNITS[exp]}${suffix}` || "";
9452
+ outStr += `${UNITS[exp]}${suffix2}` || "";
9394
9453
  }
9395
9454
  return outStr;
9396
9455
  }
@@ -9498,10 +9557,8 @@ var __publicField = (obj, key, value) => {
9498
9557
  distributeStorage: validators.distributeStorage(v)
9499
9558
  });
9500
9559
  },
9501
- onBlur: () => {
9502
- },
9503
- onFocus: () => {
9504
- }
9560
+ onBlur: () => void 0,
9561
+ onFocus: () => void 0
9505
9562
  },
9506
9563
  min: 1,
9507
9564
  meta: {},
@@ -11523,7 +11580,7 @@ var __publicField = (obj, key, value) => {
11523
11580
  width: 120,
11524
11581
  render(value2) {
11525
11582
  const colorMap = {
11526
- "Warning": "red",
11583
+ "Warning": "warning",
11527
11584
  "Normal": "green"
11528
11585
  };
11529
11586
  return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.StatusCapsule, { color: colorMap[value2], className: cx_default(StateTagStyle, "no-background"), children: i18n2.t(`dovetail.${value2.toLowerCase()}`) });
@@ -18572,7 +18629,6 @@ var __publicField = (obj, key, value) => {
18572
18629
  const [currentItemCount, setCurrentItemCount] = React.useState(0);
18573
18630
  const [paused, setPaused] = React.useState(false);
18574
18631
  const [wrap, setWrap] = React.useState(false);
18575
- const [linesBehind, setLinesBehind] = React.useState(0);
18576
18632
  const logViewerRef = React.useRef(null);
18577
18633
  const abortControllerRef = React.useRef(null);
18578
18634
  const dataProvider = core.useDataProvider();
@@ -18586,10 +18642,6 @@ var __publicField = (obj, key, value) => {
18586
18642
  if (logViewerRef && logViewerRef.current) {
18587
18643
  logViewerRef.current.scrollToBottom();
18588
18644
  }
18589
- } else if (logs.length !== currentItemCount) {
18590
- setLinesBehind(logs.length - currentItemCount);
18591
- } else {
18592
- setLinesBehind(0);
18593
18645
  }
18594
18646
  }, [paused, logs, currentItemCount]);
18595
18647
  const onScroll = (params) => {
@@ -18708,7 +18760,6 @@ var __publicField = (obj, key, value) => {
18708
18760
  setSelectedContainer(newValue);
18709
18761
  setLogs([]);
18710
18762
  setPaused(false);
18711
- setLinesBehind(0);
18712
18763
  },
18713
18764
  value: selectedContainer
18714
18765
  },
@@ -35484,7 +35535,6 @@ WARNING: This link could potentially be dangerous`)) {
35484
35535
  tableProps,
35485
35536
  contentClassName
35486
35537
  } = props;
35487
- useTranslation();
35488
35538
  const {
35489
35539
  resource
35490
35540
  } = core.useResource();
@@ -39023,83 +39073,270 @@ WARNING: This link could potentially be dangerous`)) {
39023
39073
  }
39024
39074
  ) : null });
39025
39075
  }
39076
+ function validateLabelKey(key2) {
39077
+ const labelPrefixRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.]*[a-zA-Z0-9]$)/;
39078
+ const labelNameRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
39079
+ let prefix, name2;
39080
+ const splitResult = key2.split("/");
39081
+ if (splitResult.length === 1) {
39082
+ name2 = splitResult[0];
39083
+ } else {
39084
+ prefix = splitResult[0];
39085
+ name2 = splitResult[1];
39086
+ }
39087
+ if (prefix === "") {
39088
+ return { isValid: false, errorMessage: "EMPTY_PREFIX" };
39089
+ }
39090
+ if (prefix && !labelPrefixRegex.test(prefix)) {
39091
+ return { isValid: false, errorMessage: "INVALID_PREFIX" };
39092
+ }
39093
+ if (!labelNameRegex.test(name2)) {
39094
+ return { isValid: false, errorMessage: "INVALID_NAME" };
39095
+ }
39096
+ if (prefix && prefix.length > 253) {
39097
+ return { isValid: false, errorMessage: "MAX_253" };
39098
+ }
39099
+ if (name2 && name2.length > 63) {
39100
+ return { isValid: false, errorMessage: "MAX_63" };
39101
+ }
39102
+ return { isValid: true };
39103
+ }
39104
+ function validateLabelValue(value2) {
39105
+ const labelValueRegex = /(^[a-zA-Z0-9]$)|(^[a-zA-Z0-9][a-zA-Z0-9\.\-]*[a-zA-Z0-9]$)/;
39106
+ if (value2 === "") {
39107
+ return { isValid: true };
39108
+ }
39109
+ if (value2.length > 63) {
39110
+ return { isValid: false, errorMessage: "MAX_63" };
39111
+ }
39112
+ if (!labelValueRegex.test(value2)) {
39113
+ return { isValid: false, errorMessage: "INVALID_VALUE" };
39114
+ }
39115
+ return { isValid: true };
39116
+ }
39117
+ const LabelFormatPopover_105yfzn = "";
39118
+ const PodLabelFormatRulePopoverStyle = "p5jt6nm";
39119
+ const LabelFormatPopover = () => {
39120
+ const {
39121
+ t: t2
39122
+ } = useTranslation();
39123
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Popover, {
39124
+ overlayClassName: PodLabelFormatRulePopoverStyle,
39125
+ placement: "bottomRight",
39126
+ content: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.AntdTable, {
39127
+ bordered: true,
39128
+ dataSource: [{
39129
+ object: t2("dovetail.key"),
39130
+ contains: t2("dovetail.suffix"),
39131
+ optional: t2("dovetail.no"),
39132
+ rule: [t2("dovetail.suffix_format_rule_1"), t2("dovetail.suffix_format_rule_2"), t2("dovetail.suffix_format_rule_3")]
39133
+ }, {
39134
+ object: t2("dovetail.key"),
39135
+ contains: t2("dovetail.name"),
39136
+ optional: t2("dovetail.yes"),
39137
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
39138
+ }, {
39139
+ object: t2("dovetail.value"),
39140
+ contains: t2("dovetail.name"),
39141
+ optional: t2("dovetail.no"),
39142
+ rule: [t2("dovetail.name_format_rule_1"), t2("dovetail.name_format_rule_2"), t2("dovetail.name_format_rule_3")]
39143
+ }],
39144
+ columns: [{
39145
+ key: "object",
39146
+ title: t2("dovetail.object"),
39147
+ dataIndex: "object",
39148
+ render: (cell, record, index2) => {
39149
+ return {
39150
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
39151
+ className: eagle.Typo.Label.l4_bold,
39152
+ children: cell
39153
+ }),
39154
+ props: {
39155
+ rowSpan: index2 === 0 ? 2 : index2 === 1 ? 0 : 1
39156
+ }
39157
+ };
39158
+ }
39159
+ }, {
39160
+ key: "contains",
39161
+ title: t2("dovetail.contains"),
39162
+ dataIndex: "contains"
39163
+ }, {
39164
+ key: "optional",
39165
+ title: t2("dovetail.optional"),
39166
+ dataIndex: "optional"
39167
+ }, {
39168
+ key: "rule",
39169
+ title: t2("dovetail.format_requirements"),
39170
+ dataIndex: "rule",
39171
+ render: (cell) => {
39172
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
39173
+ className: "rule-list",
39174
+ children: cell.map((rule2, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39175
+ children: rule2
39176
+ }, index2))
39177
+ });
39178
+ }
39179
+ }],
39180
+ pagination: false
39181
+ }),
39182
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Button, {
39183
+ size: "small",
39184
+ type: "link",
39185
+ children: t2("dovetail.look_format_requirement")
39186
+ })
39187
+ });
39188
+ };
39189
+ const KeyValueTableForm_1eydq7y = "";
39190
+ function _KeyValueTableFormForm(props, ref) {
39191
+ const {
39192
+ defaultValue,
39193
+ onSubmit,
39194
+ extraColumns,
39195
+ addButtonText
39196
+ } = props;
39197
+ const {
39198
+ t: t2
39199
+ } = useTranslation();
39200
+ const [value2, setValue] = React.useState([]);
39201
+ const tableFormRef = React.useRef(null);
39202
+ React.useImperativeHandle(ref, () => ({
39203
+ submit: () => {
39204
+ return new Promise((res, rej) => {
39205
+ var _a;
39206
+ (_a = tableFormRef.current) == null ? void 0 : _a.validateWholeFields();
39207
+ setTimeout(() => {
39208
+ var _a2;
39209
+ const isValid = (_a2 = tableFormRef.current) == null ? void 0 : _a2.isValid();
39210
+ if (isValid) {
39211
+ res(onSubmit(value2));
39212
+ } else {
39213
+ rej();
39214
+ }
39215
+ }, 0);
39216
+ });
39217
+ }
39218
+ }), [onSubmit, value2]);
39219
+ const renderTextAreaFunc = ({
39220
+ value: value22,
39221
+ onChange
39222
+ }) => {
39223
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.TextArea, {
39224
+ autoSize: true,
39225
+ className: "clsjtk2",
39226
+ size: "small",
39227
+ value: value22,
39228
+ onChange: (e2) => {
39229
+ onChange(e2.target.value);
39230
+ }
39231
+ });
39232
+ };
39233
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(eagle.Space, {
39234
+ size: 8,
39235
+ direction: "vertical",
39236
+ className: "cq3mbby",
39237
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(eagle.TableForm, {
39238
+ ref: tableFormRef,
39239
+ onBodyChange: (value22) => {
39240
+ setValue(value22);
39241
+ },
39242
+ columns: [{
39243
+ key: "key",
39244
+ title: t2("dovetail.key"),
39245
+ type: "input",
39246
+ validator: ({
39247
+ value: value22
39248
+ }) => {
39249
+ if (!value22)
39250
+ return t2("dovetail.key_empty_text");
39251
+ const {
39252
+ isValid
39253
+ } = validateLabelKey(value22 || "");
39254
+ if (!isValid)
39255
+ return t2("dovetail.format_error");
39256
+ },
39257
+ render: renderTextAreaFunc
39258
+ }, {
39259
+ key: "value",
39260
+ title: t2("dovetail.value_optional"),
39261
+ type: "input",
39262
+ validator: ({
39263
+ value: value22
39264
+ }) => {
39265
+ const {
39266
+ isValid
39267
+ } = validateLabelValue(value22 || "");
39268
+ if (!isValid)
39269
+ return t2("dovetail.format_error");
39270
+ },
39271
+ render: renderTextAreaFunc
39272
+ }, ...extraColumns || []],
39273
+ disableBatchFilling: true,
39274
+ hideEmptyTable: true,
39275
+ rowAddConfig: {
39276
+ addible: true,
39277
+ text: () => addButtonText
39278
+ },
39279
+ defaultData: defaultValue,
39280
+ row: {
39281
+ deletable: true
39282
+ }
39283
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx(LabelFormatPopover, {})]
39284
+ });
39285
+ }
39286
+ const KeyValueTableFormForm = React.forwardRef(_KeyValueTableFormForm);
39026
39287
  const EditLabelForm = React.forwardRef(
39027
39288
  function EditLabelForm2(props, ref) {
39028
39289
  var _a;
39029
39290
  const { resourceModel } = props;
39030
39291
  const { mutateAsync } = core.useUpdate();
39031
39292
  const { t: t2 } = useTranslation();
39032
- const [value2, setValue] = React.useState([]);
39033
39293
  const defaultValue = React.useMemo(() => {
39034
39294
  var _a2;
39035
39295
  return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.labels) || {}).map((key2) => {
39036
39296
  var _a3, _b;
39037
- return { key: key2, value: (_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.labels) == null ? void 0 : _b[key2] };
39297
+ return { key: key2, value: ((_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.labels) == null ? void 0 : _b[key2]) || "" };
39038
39298
  });
39039
39299
  }, [(_a = resourceModel.metadata) == null ? void 0 : _a.labels]);
39040
- const submit = React.useCallback(() => {
39041
- const newLabels = {};
39042
- value2.forEach(({ key: key2, value: value22 }) => {
39043
- newLabels[key2] = value22;
39044
- });
39045
- const newYaml = resourceModel.updateLabel(newLabels);
39046
- pruneBeforeEdit(newYaml);
39047
- return mutateAsync({
39048
- id: resourceModel.id,
39049
- resource: resourceModel.name || "",
39050
- values: newYaml,
39051
- meta: {
39052
- resourceBasePath: resourceModel.apiVersion,
39053
- kind: resourceModel.kind
39054
- },
39055
- successNotification() {
39056
- return {
39057
- message: t2("dovetail.edit_label_success_toast", {
39058
- kind: resourceModel.kind,
39059
- name: resourceModel.metadata.name,
39060
- interpolation: {
39061
- escapeValue: false
39062
- }
39063
- }),
39064
- type: "success"
39065
- };
39066
- },
39067
- errorNotification: false
39068
- });
39069
- }, [value2, resourceModel, mutateAsync, t2]);
39070
- React.useImperativeHandle(
39071
- ref,
39072
- () => ({
39073
- submit
39074
- }),
39075
- [submit]
39300
+ const onSubmit = React.useCallback(
39301
+ (value2) => {
39302
+ const newLabels = {};
39303
+ value2.forEach(({ key: key2, value: value22 }) => {
39304
+ newLabels[key2] = value22 || "";
39305
+ });
39306
+ const newYaml = resourceModel.updateLabel(newLabels);
39307
+ pruneBeforeEdit(newYaml);
39308
+ return mutateAsync({
39309
+ id: resourceModel.id,
39310
+ resource: resourceModel.name || "",
39311
+ values: newYaml,
39312
+ meta: {
39313
+ resourceBasePath: resourceModel.apiVersion,
39314
+ kind: resourceModel.kind
39315
+ },
39316
+ successNotification() {
39317
+ return {
39318
+ message: t2("dovetail.edit_label_success_toast", {
39319
+ kind: resourceModel.kind,
39320
+ name: resourceModel.metadata.name,
39321
+ interpolation: {
39322
+ escapeValue: false
39323
+ }
39324
+ }),
39325
+ type: "success"
39326
+ };
39327
+ },
39328
+ errorNotification: false
39329
+ });
39330
+ },
39331
+ [resourceModel, mutateAsync, t2]
39076
39332
  );
39077
39333
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
39078
- eagle.TableForm,
39334
+ KeyValueTableFormForm,
39079
39335
  {
39080
- onBodyChange: (value22) => {
39081
- setValue(value22);
39082
- },
39083
- columns: [
39084
- {
39085
- key: "key",
39086
- title: t2("dovetail.key"),
39087
- type: "input"
39088
- },
39089
- {
39090
- key: "value",
39091
- title: t2("dovetail.value"),
39092
- type: "input"
39093
- }
39094
- ],
39095
- disableBatchFilling: true,
39096
- rowAddConfig: {
39097
- addible: true
39098
- },
39099
- defaultData: defaultValue,
39100
- row: {
39101
- deletable: true
39102
- }
39336
+ ref,
39337
+ defaultValue,
39338
+ onSubmit,
39339
+ addButtonText: t2("dovetail.add_label")
39103
39340
  }
39104
39341
  );
39105
39342
  }
@@ -39136,24 +39373,23 @@ WARNING: This link could potentially be dangerous`)) {
39136
39373
  }
39137
39374
  );
39138
39375
  }
39139
- const EditAnnotationForm = React.forwardRef(
39140
- function EditAnnotationForm2(props, ref) {
39141
- var _a;
39142
- const { resourceModel } = props;
39143
- const { mutateAsync } = core.useUpdate();
39144
- const { t: t2 } = useTranslation();
39145
- const [value2, setValue] = React.useState([]);
39146
- const defaultValue = React.useMemo(() => {
39147
- var _a2;
39148
- return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.annotations) || {}).map((key2) => {
39149
- var _a3, _b;
39150
- return { key: key2, value: (_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.annotations) == null ? void 0 : _b[key2] };
39151
- });
39152
- }, [(_a = resourceModel.metadata) == null ? void 0 : _a.annotations]);
39153
- const submit = React.useCallback(() => {
39376
+ const EditAnnotationForm = React.forwardRef(function EditAnnotationForm2(props, ref) {
39377
+ var _a;
39378
+ const { resourceModel } = props;
39379
+ const { mutateAsync } = core.useUpdate();
39380
+ const { t: t2 } = useTranslation();
39381
+ const defaultValue = React.useMemo(() => {
39382
+ var _a2;
39383
+ return Object.keys(((_a2 = resourceModel.metadata) == null ? void 0 : _a2.annotations) || {}).map((key2) => {
39384
+ var _a3, _b;
39385
+ return { key: key2, value: ((_b = (_a3 = resourceModel.metadata) == null ? void 0 : _a3.annotations) == null ? void 0 : _b[key2]) || "" };
39386
+ });
39387
+ }, [(_a = resourceModel.metadata) == null ? void 0 : _a.annotations]);
39388
+ const onSubmit = React.useCallback(
39389
+ (value2) => {
39154
39390
  const newAnnotations = {};
39155
39391
  value2.forEach(({ key: key2, value: value22 }) => {
39156
- newAnnotations[key2] = value22;
39392
+ newAnnotations[key2] = value22 || "";
39157
39393
  });
39158
39394
  const newYaml = resourceModel.updateAnnotation(newAnnotations);
39159
39395
  pruneBeforeEdit(newYaml);
@@ -39179,44 +39415,19 @@ WARNING: This link could potentially be dangerous`)) {
39179
39415
  },
39180
39416
  errorNotification: false
39181
39417
  });
39182
- }, [value2, resourceModel, mutateAsync, t2]);
39183
- React.useImperativeHandle(
39418
+ },
39419
+ [resourceModel, mutateAsync, t2]
39420
+ );
39421
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39422
+ KeyValueTableFormForm,
39423
+ {
39184
39424
  ref,
39185
- () => ({
39186
- submit
39187
- }),
39188
- [submit]
39189
- );
39190
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
39191
- eagle.TableForm,
39192
- {
39193
- onBodyChange: (value22) => {
39194
- setValue(value22);
39195
- },
39196
- columns: [
39197
- {
39198
- key: "key",
39199
- title: t2("dovetail.key"),
39200
- type: "input"
39201
- },
39202
- {
39203
- key: "value",
39204
- title: t2("dovetail.value"),
39205
- type: "input"
39206
- }
39207
- ],
39208
- disableBatchFilling: true,
39209
- rowAddConfig: {
39210
- addible: true
39211
- },
39212
- defaultData: defaultValue,
39213
- row: {
39214
- deletable: true
39215
- }
39216
- }
39217
- );
39218
- }
39219
- );
39425
+ defaultValue,
39426
+ onSubmit,
39427
+ addButtonText: t2("dovetail.add_annotation")
39428
+ }
39429
+ );
39430
+ });
39220
39431
  function EditAnnotationDropdownMenuItem(props) {
39221
39432
  const { formRef, resourceModel } = props;
39222
39433
  const { t: t2 } = useTranslation();
@@ -39249,6 +39460,179 @@ WARNING: This link could potentially be dangerous`)) {
39249
39460
  }
39250
39461
  );
39251
39462
  }
39463
+ const EditNodeTaintForm_cgov7z = "";
39464
+ const UlStyle = "u19jcs7t";
39465
+ const EditNodeTaintForm = React.forwardRef(function EditNodeTaintForm2(props, ref) {
39466
+ const {
39467
+ nodeModel
39468
+ } = props;
39469
+ const {
39470
+ mutateAsync
39471
+ } = core.useUpdate();
39472
+ const {
39473
+ t: t2
39474
+ } = useTranslation();
39475
+ const defaultValue = React.useMemo(() => {
39476
+ var _a;
39477
+ return ((_a = nodeModel._rawYaml.spec) == null ? void 0 : _a.taints) || [];
39478
+ }, [nodeModel]);
39479
+ const onSubmit = React.useCallback((_value) => {
39480
+ const value2 = _value;
39481
+ const newYaml = nodeModel._globalStore.restoreItem(nodeModel);
39482
+ if (newYaml.spec) {
39483
+ newYaml.spec.taints = value2;
39484
+ }
39485
+ pruneBeforeEdit(newYaml);
39486
+ return mutateAsync({
39487
+ id: nodeModel.id,
39488
+ resource: nodeModel.name || "",
39489
+ values: newYaml,
39490
+ meta: {
39491
+ resourceBasePath: nodeModel.apiVersion,
39492
+ kind: nodeModel.kind
39493
+ },
39494
+ successNotification() {
39495
+ return {
39496
+ message: t2("dovetail.edit_node_taint_success_toast", {
39497
+ kind: nodeModel.kind,
39498
+ name: nodeModel.metadata.name,
39499
+ interpolation: {
39500
+ escapeValue: false
39501
+ }
39502
+ }),
39503
+ type: "success"
39504
+ };
39505
+ },
39506
+ errorNotification: false
39507
+ });
39508
+ }, [nodeModel, mutateAsync, t2]);
39509
+ const noScheduleTooltip = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
39510
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("b", {
39511
+ children: "NoSchedule"
39512
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", {
39513
+ className: UlStyle,
39514
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39515
+ children: t2("dovetail.taint_effect_NoSchedule_tooltip_1")
39516
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39517
+ children: t2("dovetail.taint_effect_NoSchedule_tooltip_2")
39518
+ })]
39519
+ })]
39520
+ });
39521
+ const preferNoScheduleTooltip = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
39522
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("b", {
39523
+ children: "PreferNoSchedule"
39524
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", {
39525
+ className: UlStyle,
39526
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39527
+ children: t2("dovetail.taint_effect_PreferNoSchedule_tooltip_1")
39528
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39529
+ children: t2("dovetail.taint_effect_PreferNoSchedule_tooltip_2")
39530
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39531
+ children: t2("dovetail.taint_effect_PreferNoSchedule_tooltip_3")
39532
+ })]
39533
+ })]
39534
+ });
39535
+ const noExecuteTooltip = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
39536
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx("b", {
39537
+ children: "NoExecute"
39538
+ }), /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
39539
+ className: UlStyle,
39540
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx("li", {
39541
+ children: t2("dovetail.taint_effect_NoExecute_tooltip_3")
39542
+ })
39543
+ })]
39544
+ });
39545
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValueTableFormForm, {
39546
+ ref,
39547
+ defaultValue,
39548
+ onSubmit,
39549
+ addButtonText: t2("dovetail.add_taint"),
39550
+ extraColumns: [{
39551
+ key: "effect",
39552
+ title: t2("dovetail.effect"),
39553
+ render: ({
39554
+ value: value2,
39555
+ onChange
39556
+ }) => {
39557
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Select, {
39558
+ input: {},
39559
+ value: value2,
39560
+ onChange,
39561
+ size: "small",
39562
+ children: eagle.getOptions([{
39563
+ value: "NoSchedule",
39564
+ children: t2(`dovetail.node_taint_${"NoSchedule"}`),
39565
+ suffix: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
39566
+ title: noScheduleTooltip,
39567
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, {
39568
+ src: iconsReact.InfoICircleFill16GrayIcon,
39569
+ hoverSrc: iconsReact.InfoICircleFill16Gray70Icon
39570
+ })
39571
+ })
39572
+ }, {
39573
+ value: "PreferNoSchedule",
39574
+ children: t2(`dovetail.node_taint_${"PreferNoSchedule"}`),
39575
+ suffix: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
39576
+ title: preferNoScheduleTooltip,
39577
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, {
39578
+ src: iconsReact.InfoICircleFill16GrayIcon,
39579
+ hoverSrc: iconsReact.InfoICircleFill16Gray70Icon
39580
+ })
39581
+ })
39582
+ }, {
39583
+ value: "NoExecute",
39584
+ children: t2(`dovetail.node_taint_${"NoExecute"}`),
39585
+ suffix: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Tooltip, {
39586
+ title: noExecuteTooltip,
39587
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, {
39588
+ src: iconsReact.InfoICircleFill16GrayIcon,
39589
+ hoverSrc: iconsReact.InfoICircleFill16Gray70Icon
39590
+ })
39591
+ })
39592
+ }])
39593
+ });
39594
+ },
39595
+ validator: ({
39596
+ value: value2
39597
+ }) => {
39598
+ if (!value2)
39599
+ return t2("dovetail.taint_effect_empty_text");
39600
+ }
39601
+ }]
39602
+ });
39603
+ });
39604
+ function EditNodeTaintDropdownMenuItem(props) {
39605
+ const { formRef, resourceModel } = props;
39606
+ const { t: t2 } = useTranslation();
39607
+ const pushModal = eagle.usePushModal();
39608
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39609
+ eagle.Menu.Item,
39610
+ {
39611
+ className: "ant-dropdown-menu-item",
39612
+ onClick: () => {
39613
+ const modalProps = {
39614
+ formRef,
39615
+ title: t2("dovetail.edit_node_taint"),
39616
+ fullscreen: true,
39617
+ renderContent() {
39618
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
39619
+ EditNodeTaintForm,
39620
+ {
39621
+ ref: formRef,
39622
+ nodeModel: resourceModel
39623
+ }
39624
+ );
39625
+ }
39626
+ };
39627
+ pushModal({
39628
+ component: EditFieldModal,
39629
+ props: modalProps
39630
+ });
39631
+ },
39632
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(eagle.Icon, { src: iconsReact.EditPen16BlueIcon, children: t2("dovetail.edit_node_taint") })
39633
+ }
39634
+ );
39635
+ }
39252
39636
  const index_sazpyf = "";
39253
39637
  const WrapperStyle = "wfg6u6g";
39254
39638
  const InnerBar = ({
@@ -40538,6 +40922,7 @@ WARNING: This link could potentially be dangerous`)) {
40538
40922
  exports2.EditAnnotationDropdownMenuItem = EditAnnotationDropdownMenuItem;
40539
40923
  exports2.EditButton = EditButton;
40540
40924
  exports2.EditLabelDropdownMenuItem = EditLabelDropdownMenuItem;
40925
+ exports2.EditNodeTaintDropdownMenuItem = EditNodeTaintDropdownMenuItem;
40541
40926
  exports2.ErrorContent = WidgetErrorContent;
40542
40927
  exports2.ErrorContentType = ErrorContentType;
40543
40928
  exports2.ErrorWrapper = ErrorWrapper;
@@ -40733,8 +41118,10 @@ WARNING: This link could potentially be dangerous`)) {
40733
41118
  exports2.dovetailRefineI18n = dovetailRefineI18n;
40734
41119
  exports2.generateSchemaTypeValue = generateSchemaTypeValue;
40735
41120
  exports2.generateValueFromSchema = generateValueFromSchema;
41121
+ exports2.getApiVersion = getApiVersion;
40736
41122
  exports2.modelPlugin = modelPlugin;
40737
41123
  exports2.namespaceRules = namespaceRules;
41124
+ exports2.pruneBeforeEdit = pruneBeforeEdit;
40738
41125
  exports2.relationPlugin = relationPlugin;
40739
41126
  exports2.resolveRef = resolveRef;
40740
41127
  exports2.rfc1035LabelRules = rfc1035LabelRules;