@dovetail-v2/refine 0.0.49-alpha.0 → 0.0.51

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 (211) hide show
  1. package/dist/{MonacoYamlDiffEditor-7cb1e598.js → MonacoYamlDiffEditor-b82fbea9.js} +1 -1
  2. package/dist/{index-8f27c902.js → index-51cc13dd.js} +116 -82
  3. package/dist/refine.js +1 -1
  4. package/dist/refine.umd.cjs +114 -80
  5. package/dist/style.css +2 -1
  6. package/lib/src/App.js +91 -0
  7. package/lib/src/Dovetail.js +45 -0
  8. package/lib/src/components/Breadcrumb/index.js +20 -0
  9. package/lib/src/components/ConditionsTable/ConditionsTable.js +56 -0
  10. package/lib/src/components/ConditionsTable/index.js +1 -0
  11. package/lib/src/components/CreateButton/index.js +10 -0
  12. package/lib/src/components/CronJobDropdown/index.js +26 -0
  13. package/lib/src/components/CronjobJobsTable/index.js +49 -0
  14. package/lib/src/components/DeleteButton/index.js +13 -0
  15. package/lib/src/components/DeleteManyButton/index.js +16 -0
  16. package/lib/src/components/DrawerShow/DrawerShow.js +13 -0
  17. package/lib/src/components/DrawerShow/index.js +1 -0
  18. package/lib/src/components/EditButton/index.js +13 -0
  19. package/lib/src/components/EditField/index.js +47 -0
  20. package/lib/src/components/ErrorContent/index.js +36 -0
  21. package/lib/src/components/EventsTable/EventsTable.js +59 -0
  22. package/lib/src/components/EventsTable/index.js +1 -0
  23. package/lib/src/components/Form/KeyValueListWidget.js +56 -0
  24. package/lib/src/components/Form/MetadataForm.js +9 -0
  25. package/lib/src/components/Form/NameInputWidget.js +50 -0
  26. package/lib/src/components/Form/NamespaceSelectWidget.js +21 -0
  27. package/lib/src/components/Form/index.js +4 -0
  28. package/lib/src/components/Form/widget.js +1 -0
  29. package/lib/src/components/FormErrorAlert/index.js +8 -0
  30. package/lib/src/components/FormLayout/index.js +21 -0
  31. package/lib/src/components/FormModal/index.js +51 -0
  32. package/lib/src/components/ImageNames/index.js +14 -0
  33. package/lib/src/components/IngressRulesComponent/index.js +11 -0
  34. package/lib/src/components/IngressRulesTable/IngressRulesTable.js +51 -0
  35. package/lib/src/components/IngressRulesTable/index.js +1 -0
  36. package/lib/src/components/K8sDropdown/index.js +31 -0
  37. package/lib/src/components/KeyValue/KeyValue.js +27 -0
  38. package/lib/src/components/KeyValue/index.js +1 -0
  39. package/lib/src/components/KeyValueData/index.js +50 -0
  40. package/lib/src/components/Layout/index.js +39 -0
  41. package/lib/src/components/ListPage/index.js +25 -0
  42. package/lib/src/components/Menu/index.js +36 -0
  43. package/lib/src/components/NamespacesFilter/index.js +34 -0
  44. package/lib/src/components/NetworkPolicyRulesTable/NetworkPolicyRulesTable.d.ts +1 -2
  45. package/lib/src/components/NetworkPolicyRulesTable/NetworkPolicyRulesTable.js +77 -0
  46. package/lib/src/components/NetworkPolicyRulesTable/index.js +1 -0
  47. package/lib/src/components/PageShow/PageShow.js +11 -0
  48. package/lib/src/components/PageShow/index.js +1 -0
  49. package/lib/src/components/PodContainersTable/PodContainersTable.js +78 -0
  50. package/lib/src/components/PodContainersTable/index.js +1 -0
  51. package/lib/src/components/PodLog/index.js +136 -0
  52. package/lib/src/components/ReferenceLink/index.js +17 -0
  53. package/lib/src/components/RefineForm/RefineFormContent.d.ts +10 -0
  54. package/lib/src/components/RefineForm/RefineFormModal.d.ts +8 -0
  55. package/lib/src/components/RefineForm/RefineFormPage.d.ts +7 -0
  56. package/lib/src/components/RefineForm/index.d.ts +3 -0
  57. package/lib/src/components/RefineForm/type.d.ts +20 -0
  58. package/lib/src/components/RefineForm/useRefineForm.d.ts +10 -0
  59. package/lib/src/components/ResourceCRUD/ResourceCRUD.js +15 -0
  60. package/lib/src/components/ResourceCRUD/create/index.js +13 -0
  61. package/lib/src/components/ResourceCRUD/index.js +4 -0
  62. package/lib/src/components/ResourceCRUD/list/index.js +19 -0
  63. package/lib/src/components/ResourceCRUD/show/index.js +6 -0
  64. package/lib/src/components/ResourceLink/index.js +21 -0
  65. package/lib/src/components/ResourceUsageBar/index.js +81 -0
  66. package/lib/src/components/Separator/index.js +11 -0
  67. package/lib/src/components/ServiceComponents/index.d.ts +0 -1
  68. package/lib/src/components/ShowContent/ShowContent.d.ts +1 -1
  69. package/lib/src/components/ShowContent/ShowContent.js +157 -0
  70. package/lib/src/components/ShowContent/fields.d.ts +1 -1
  71. package/lib/src/components/ShowContent/fields.js +157 -0
  72. package/lib/src/components/ShowContent/index.js +2 -0
  73. package/lib/src/components/StateTag/StateTag.js +22 -0
  74. package/lib/src/components/StateTag/index.js +1 -0
  75. package/lib/src/components/Table/ErrorContent.js +36 -0
  76. package/lib/src/components/Table/TableToolBar.js +14 -0
  77. package/lib/src/components/Table/TableWidgets.js +28 -0
  78. package/lib/src/components/Table/index.js +69 -0
  79. package/lib/src/components/Tags/index.js +22 -0
  80. package/lib/src/components/Time/index.js +14 -0
  81. package/lib/src/components/WorkloadDropdown/index.js +24 -0
  82. package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.js +39 -0
  83. package/lib/src/components/WorkloadPodsTable/index.js +1 -0
  84. package/lib/src/components/WorkloadReplicas/index.js +50 -0
  85. package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.js +34 -0
  86. package/lib/src/components/YamlEditor/MonacoYamlEditor.js +149 -0
  87. package/lib/src/components/YamlEditor/YamlEditorComponent.js +90 -0
  88. package/lib/src/components/YamlEditor/index.js +1 -0
  89. package/lib/src/components/YamlEditor/style.js +102 -0
  90. package/lib/src/components/YamlEditor/yaml.worker.js +1 -0
  91. package/lib/src/components/YamlForm/index.d.ts +0 -4
  92. package/lib/src/components/YamlForm/index.js +61 -0
  93. package/lib/src/components/index.js +38 -0
  94. package/lib/src/constants/index.js +2 -0
  95. package/lib/src/constants/k8s.js +203 -0
  96. package/lib/src/constants/state.d.ts +2 -1
  97. package/lib/src/constants/state.js +15 -0
  98. package/lib/src/contexts/component.js +3 -0
  99. package/lib/src/contexts/configs.js +3 -0
  100. package/lib/src/contexts/global-store.js +3 -0
  101. package/lib/src/contexts/index.js +3 -0
  102. package/lib/src/hooks/index.js +7 -0
  103. package/lib/src/hooks/useDeleteModal/index.js +1 -0
  104. package/lib/src/hooks/useDeleteModal/useDeleteManyModal.js +31 -0
  105. package/lib/src/hooks/useDeleteModal/useDeleteModal.js +38 -0
  106. package/lib/src/hooks/useDownloadYAML.js +10 -0
  107. package/lib/src/hooks/useEagleForm.d.ts +1 -2
  108. package/lib/src/hooks/useEagleForm.js +177 -0
  109. package/lib/src/hooks/useEagleTable/columns.d.ts +1 -1
  110. package/lib/src/hooks/useEagleTable/columns.js +246 -0
  111. package/lib/src/hooks/useEagleTable/index.js +2 -0
  112. package/lib/src/hooks/useEagleTable/useEagleTable.js +63 -0
  113. package/lib/src/hooks/useEdit.js +19 -0
  114. package/lib/src/hooks/useGlobalStore.js +5 -0
  115. package/lib/src/hooks/useK8sYamlEditor.js +37 -0
  116. package/lib/src/hooks/useOpenForm.js +43 -0
  117. package/lib/src/hooks/useSchema.js +37 -0
  118. package/lib/src/hooks/useSubmitForm.js +42 -0
  119. package/lib/src/i18n.d.ts +4 -0
  120. package/lib/src/i18n.js +19 -0
  121. package/lib/src/index.js +13 -0
  122. package/lib/src/locales/en-US/dovetail.json +18 -0
  123. package/lib/src/locales/en-US/index.d.ts +2 -0
  124. package/lib/src/locales/en-US/index.js +4 -0
  125. package/lib/src/locales/index.js +6 -0
  126. package/lib/src/locales/zh-CN/dovetail.json +91 -0
  127. package/lib/src/locales/zh-CN/index.d.ts +2 -0
  128. package/lib/src/locales/zh-CN/index.js +4 -0
  129. package/lib/src/main.js +12 -0
  130. package/lib/src/models/cronjob-model.js +32 -0
  131. package/lib/src/models/daemonset-model.js +17 -0
  132. package/lib/src/models/deployment-model.d.ts +1 -1
  133. package/lib/src/models/deployment-model.js +17 -0
  134. package/lib/src/models/event-model.js +11 -0
  135. package/lib/src/models/index.js +14 -0
  136. package/lib/src/models/ingress-model.js +24 -0
  137. package/lib/src/models/job-model.js +56 -0
  138. package/lib/src/models/network-policy-model.js +10 -0
  139. package/lib/src/models/pod-metrics-model.js +34 -0
  140. package/lib/src/models/pod-model.js +78 -0
  141. package/lib/src/models/resource-model.js +34 -0
  142. package/lib/src/models/server-instance-model.d.ts +10 -0
  143. package/lib/src/models/service-model.d.ts +2 -1
  144. package/lib/src/models/service-model.js +17 -0
  145. package/lib/src/models/statefulset-model.d.ts +1 -1
  146. package/lib/src/models/statefulset-model.js +17 -0
  147. package/lib/src/models/types/index.js +1 -0
  148. package/lib/src/models/types/metric.js +1 -0
  149. package/lib/src/models/workload-base-model.js +22 -0
  150. package/lib/src/models/workload-model.js +51 -0
  151. package/lib/src/pages/configmaps/index.js +15 -0
  152. package/lib/src/pages/cronjobs/create/index.js +6 -0
  153. package/lib/src/pages/cronjobs/index.js +3 -0
  154. package/lib/src/pages/cronjobs/list/index.js +42 -0
  155. package/lib/src/pages/cronjobs/show/index.js +16 -0
  156. package/lib/src/pages/daemonsets/create/index.js +6 -0
  157. package/lib/src/pages/daemonsets/index.js +3 -0
  158. package/lib/src/pages/daemonsets/list/index.js +32 -0
  159. package/lib/src/pages/daemonsets/show/index.js +16 -0
  160. package/lib/src/pages/deployments/create/index.js +7 -0
  161. package/lib/src/pages/deployments/index.js +3 -0
  162. package/lib/src/pages/deployments/list/index.js +26 -0
  163. package/lib/src/pages/deployments/show/index.js +16 -0
  164. package/lib/src/pages/ingresses/index.js +26 -0
  165. package/lib/src/pages/jobs/index.js +34 -0
  166. package/lib/src/pages/networkPolicies/index.js +67 -0
  167. package/lib/src/pages/pods/create/index.js +6 -0
  168. package/lib/src/pages/pods/index.js +3 -0
  169. package/lib/src/pages/pods/list/index.js +81 -0
  170. package/lib/src/pages/pods/show/index.js +54 -0
  171. package/lib/src/pages/secrets/index.js +15 -0
  172. package/lib/src/pages/services/index.js +26 -0
  173. package/lib/src/pages/statefulsets/create/index.js +6 -0
  174. package/lib/src/pages/statefulsets/index.js +3 -0
  175. package/lib/src/pages/statefulsets/list/index.js +26 -0
  176. package/lib/src/pages/statefulsets/show/index.js +16 -0
  177. package/lib/src/plugins/index.js +3 -0
  178. package/lib/src/plugins/model-plugin.js +46 -0
  179. package/lib/src/plugins/relation-plugin.js +81 -0
  180. package/lib/src/plugins/type.js +1 -0
  181. package/lib/src/providers/index.js +1 -0
  182. package/lib/src/providers/router-provider/index.js +100 -0
  183. package/lib/src/types/index.js +1 -0
  184. package/lib/src/types/resource.js +12 -0
  185. package/lib/src/utils/addId.js +8 -0
  186. package/lib/src/utils/download.js +9 -0
  187. package/lib/src/utils/error.js +53 -0
  188. package/lib/src/utils/form.js +9 -0
  189. package/lib/src/utils/k8s.js +6 -0
  190. package/lib/src/utils/labels.js +15 -0
  191. package/lib/src/utils/match-selector.js +12 -0
  192. package/lib/src/utils/openapi.js +33 -0
  193. package/lib/src/utils/schema.js +117 -0
  194. package/lib/src/utils/selector.js +12 -0
  195. package/lib/src/utils/string.js +6 -0
  196. package/lib/src/utils/time.js +46 -0
  197. package/lib/src/utils/unit.js +69 -0
  198. package/lib/src/utils/yaml.js +44 -0
  199. package/lib/vite.config.js +60 -0
  200. package/package.json +2 -2
  201. package/lib/src/components/ModalContextProvider/index.d.ts +0 -12
  202. package/lib/src/hooks/useModal.d.ts +0 -0
  203. package/lib/src/hooks/useNamespaceFilter.d.ts +0 -5
  204. package/lib/src/model/cronjob-model.d.ts +0 -9
  205. package/lib/src/model/index.d.ts +0 -6
  206. package/lib/src/model/job-model.d.ts +0 -10
  207. package/lib/src/model/pod-metrics-model.d.ts +0 -7
  208. package/lib/src/model/pod-model.d.ts +0 -15
  209. package/lib/src/model/resource-model.d.ts +0 -17
  210. package/lib/src/model/workload-model.d.ts +0 -17
  211. package/lib/src/types/metric.d.ts +0 -25
@@ -1,4 +1,4 @@
1
- import { j as jsxRuntimeExports } from "./index-8f27c902.js";
1
+ import { j as jsxRuntimeExports } from "./index-51cc13dd.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, useParsed, useGo, useCan, useTable, useDeleteMany, CanAccess, useShow, useUpdate, 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, useUIKit, kitContext, Link as Link$1, OverflowTooltip, Tooltip, StatusCapsule, usePushModal, Icon as Icon$1, Button, usePopModal, Loading, Divider, Fields, Space, Form, Modal, useMessage, ModalStack, KitStoreProvider } from "@cloudtower/eagle";
13
+ import { Typo, Tag, useUIKit, kitContext, OverflowTooltip, Tooltip, StatusCapsule, usePushModal, Icon as Icon$1, Button, usePopModal, Loading, Divider, Fields, Space, Form, Modal, Link as Link$1, useMessage, ModalStack, KitStoreProvider } from "@cloudtower/eagle";
14
14
  import { EditPen16PrimaryIcon, Download16GradientBlueIcon, TrashBinDelete16Icon, MoreEllipsis324BoldSecondaryIcon, MoreEllipsis324BoldBlueIcon, MoreEllipsis316BoldBlueIcon, PlusAddCreateNew16BoldOntintIcon, ArrowChevronLeft16BoldTertiaryIcon, ArrowChevronLeftSmall16BoldBlueIcon, EditPen16GradientBlueIcon, ViewEye16GradientGrayIcon, EntityFilterIgnoreGradient16GrayIcon, RecoverContinue16GradientBlueIcon, SuspendedPause16GradientBlueIcon, Retry16GradientBlueIcon, HierarchyTriangleRight16GrayIcon, HierarchyTriangleRight16BlueIcon, ClipboardCopy16GradientGrayIcon, ClipboardCopy16GradientBlueIcon, Retry16GradientGrayIcon, EditPen16GradientGrayIcon, Showdiff16GradientGrayIcon, Showdiff16GradientBlueIcon, XmarkFailedSeriousWarningFill16RedIcon, ExclamationErrorCircleFill16RedIcon, Pause16GradientBlueIcon } from "@cloudtower/icons-react";
15
15
  import { omit as omit$1, merge, get as get$3, first, debounce, last, isObject as isObject$4, keyBy } from "lodash-es";
16
16
  import yaml from "js-yaml";
@@ -1010,7 +1010,7 @@ function useTranslation(ns) {
1010
1010
  }
1011
1011
  const copy$1 = "Copy";
1012
1012
  const reset_arguments$1 = "Reset";
1013
- const view_changes$1 = "Show Diff";
1013
+ const view_changes$1 = "Show diff";
1014
1014
  const back_to_edit$1 = "Edit";
1015
1015
  const configure_file$1 = "Configuration";
1016
1016
  const yaml_format_wrong$1 = "Configuration is in an invalid YAML format.";
@@ -1047,7 +1047,7 @@ const save$1 = "Save";
1047
1047
  const workload$1 = "Workload";
1048
1048
  const empty$1 = "No data available";
1049
1049
  const schedule$1 = "Schedule";
1050
- const lastScheduleTime$1 = "Last Schedule";
1050
+ const lastScheduleTime$1 = "Last schedule";
1051
1051
  const duration$1 = "Duration";
1052
1052
  const started$1 = "Start time";
1053
1053
  const container$1 = "Container";
@@ -1074,7 +1074,7 @@ const rule$1 = "Rule";
1074
1074
  const port$1 = "Port";
1075
1075
  const cert$1 = "Certificate";
1076
1076
  const ip_address$1 = "IP address";
1077
- const last_seen$1 = "Last Seen";
1077
+ const last_seen$1 = "Last seen";
1078
1078
  const node_port$1 = "NodePort";
1079
1079
  const protocol$1 = "Protocol";
1080
1080
  const key$1 = "Key";
@@ -1144,9 +1144,9 @@ const regular_container$1 = "Regular container";
1144
1144
  const suspend$1 = "Suspend";
1145
1145
  const default_backend$1 = "Default backend";
1146
1146
  const ingress_class$1 = "IngressClass";
1147
- const pod_ready_num$1 = "Ready Pod";
1148
- const pod_complete_num$1 = "Completion Pod";
1149
- const pod_replicas_num$1 = "Desired Pod";
1147
+ const pod_ready_num$1 = "Ready pod";
1148
+ const pod_complete_num$1 = "Completion pod";
1149
+ const pod_replicas_num$1 = "Desired pod";
1150
1150
  const edit_replicas$1 = "Edit expected number of replicas";
1151
1151
  const dns_record$1 = "DNS record";
1152
1152
  const basic_info$1 = "Basic information";
@@ -1158,6 +1158,8 @@ const pod_port$1 = "Pod port";
1158
1158
  const path_type$1 = "Path type";
1159
1159
  const only_support_one_yaml$1 = "Only one YAML configuration is supported at a time.";
1160
1160
  const not_support$1 = "Not supported";
1161
+ const stopped$1 = "Stopped";
1162
+ const any_node_ip$1 = "Any node IP";
1161
1163
  const dovetail$1 = {
1162
1164
  copy: copy$1,
1163
1165
  reset_arguments: reset_arguments$1,
@@ -1311,7 +1313,9 @@ const dovetail$1 = {
1311
1313
  pod_port: pod_port$1,
1312
1314
  path_type: path_type$1,
1313
1315
  only_support_one_yaml: only_support_one_yaml$1,
1314
- not_support: not_support$1
1316
+ not_support: not_support$1,
1317
+ stopped: stopped$1,
1318
+ any_node_ip: any_node_ip$1
1315
1319
  };
1316
1320
  const EN = {
1317
1321
  dovetail: dovetail$1
@@ -1467,6 +1471,8 @@ const out_cluster_lb_desc = "LoadBalancer 展示 <strong>ingress[*].ip</strong>
1467
1471
  const out_external_name_desc = "ExternalName 展示 <strong>external-ip</strong>。";
1468
1472
  const only_support_one_yaml = "一次仅支持输入一个 YAML 配置。";
1469
1473
  const not_support = "不支持";
1474
+ const stopped = "已停止";
1475
+ const any_node_ip = "任意节点 IP";
1470
1476
  const dovetail = {
1471
1477
  copy,
1472
1478
  reset_arguments,
@@ -1621,7 +1627,9 @@ const dovetail = {
1621
1627
  out_cluster_lb_desc,
1622
1628
  out_external_name_desc,
1623
1629
  only_support_one_yaml,
1624
- not_support
1630
+ not_support,
1631
+ stopped,
1632
+ any_node_ip
1625
1633
  };
1626
1634
  const ZH = {
1627
1635
  dovetail
@@ -9544,6 +9552,7 @@ var WorkloadState = /* @__PURE__ */ ((WorkloadState2) => {
9544
9552
  WorkloadState2["TERMINATING"] = "terminating";
9545
9553
  WorkloadState2["PENDING"] = "pending";
9546
9554
  WorkloadState2["WAITING"] = "waiting";
9555
+ WorkloadState2["STOPPED"] = "stopped";
9547
9556
  return WorkloadState2;
9548
9557
  })(WorkloadState || {});
9549
9558
  var AccessControlAuth = /* @__PURE__ */ ((AccessControlAuth2) => {
@@ -9834,7 +9843,7 @@ class PodModel extends WorkloadBaseModel {
9834
9843
  }
9835
9844
  get readyDisplay() {
9836
9845
  var _a, _b, _c;
9837
- return `${(_b = (_a = this._rawYaml.status) == null ? void 0 : _a.containerStatuses) == null ? void 0 : _b.filter((c2) => c2.ready).length}/${(_c = this._rawYaml.spec) == null ? void 0 : _c.containers.length}`;
9846
+ return `${((_b = (_a = this._rawYaml.status) == null ? void 0 : _a.containerStatuses) == null ? void 0 : _b.filter((c2) => c2.ready).length) || 0}/${((_c = this._rawYaml.spec) == null ? void 0 : _c.containers.length) || 0}`;
9838
9847
  }
9839
9848
  get readyContainerCount() {
9840
9849
  var _a, _b;
@@ -9925,8 +9934,10 @@ class DeploymentModel extends WorkloadModel {
9925
9934
  this._globalStore = _globalStore;
9926
9935
  }
9927
9936
  get stateDisplay() {
9928
- var _a, _b;
9929
- if (((_a = this.spec) == null ? void 0 : _a.replicas) !== ((_b = this.status) == null ? void 0 : _b.readyReplicas)) {
9937
+ var _a, _b, _c;
9938
+ if (((_a = this.spec) == null ? void 0 : _a.replicas) === 0) {
9939
+ return WorkloadState.STOPPED;
9940
+ } else if (((_b = this.spec) == null ? void 0 : _b.replicas) !== ((_c = this.status) == null ? void 0 : _c.readyReplicas)) {
9930
9941
  return WorkloadState.UPDATING;
9931
9942
  }
9932
9943
  return WorkloadState.READY;
@@ -9959,8 +9970,10 @@ class StatefulSetModel extends WorkloadModel {
9959
9970
  this._globalStore = _globalStore;
9960
9971
  }
9961
9972
  get stateDisplay() {
9962
- var _a, _b;
9963
- if (((_a = this.spec) == null ? void 0 : _a.replicas) !== ((_b = this.status) == null ? void 0 : _b.readyReplicas)) {
9973
+ var _a, _b, _c;
9974
+ if (((_a = this.spec) == null ? void 0 : _a.replicas) === 0) {
9975
+ return WorkloadState.STOPPED;
9976
+ } else if (((_b = this.spec) == null ? void 0 : _b.replicas) !== ((_c = this.status) == null ? void 0 : _c.readyReplicas)) {
9964
9977
  return WorkloadState.UPDATING;
9965
9978
  }
9966
9979
  return WorkloadState.READY;
@@ -9994,19 +10007,20 @@ class ServiceModel extends ResourceModel {
9994
10007
  get displayPortMapping() {
9995
10008
  var _a;
9996
10009
  return (_a = this._rawYaml.spec.ports) == null ? void 0 : _a.map((p) => {
9997
- let servicePort = `${p.port}`;
10010
+ let link = "";
9998
10011
  if (this._rawYaml.spec.clusterIP && this._rawYaml.spec.clusterIP !== "None") {
9999
- servicePort = `${this._rawYaml.spec.clusterIP}:${p.port}`;
10012
+ link = `${this._rawYaml.spec.clusterIP}:${p.port}`;
10000
10013
  }
10001
10014
  return {
10002
- servicePort,
10015
+ servicePort: p.port,
10016
+ link,
10003
10017
  targetPort: p.targetPort,
10004
10018
  protocol: p.protocol
10005
10019
  };
10006
10020
  });
10007
10021
  }
10008
10022
  }
10009
- const index_w8956m = "";
10023
+ const index_1lzkrja = "";
10010
10024
  const ServiceInClusterAccessComponent = ({
10011
10025
  service
10012
10026
  }) => {
@@ -10027,10 +10041,8 @@ const ServiceInClusterAccessComponent = ({
10027
10041
  }
10028
10042
  };
10029
10043
  const BreakLineStyle = "b1vtjd4k";
10030
- const LinkStyle = "luro4rx";
10031
10044
  const ServiceOutClusterAccessComponent = ({
10032
10045
  service,
10033
- clusterVip,
10034
10046
  breakLine = true
10035
10047
  }) => {
10036
10048
  var _a, _b, _c, _d;
@@ -10042,17 +10054,12 @@ const ServiceOutClusterAccessComponent = ({
10042
10054
  let content = "-";
10043
10055
  switch (spec.type) {
10044
10056
  case ServiceTypeEnum.NodePort:
10045
- content = (_a = spec.ports) == null ? void 0 : _a.filter((v) => !!v).map((p, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
10046
- target: "_blank",
10047
- href: `http://${clusterVip}:${p.nodePort}`,
10048
- className: cx_default(breakLine ? BreakLineStyle : "", LinkStyle),
10049
- children: /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTooltip, {
10050
- content: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
10051
- className: Typo.Label.l4_regular_title,
10052
- children: [clusterVip, ":", p.nodePort, !breakLine && index !== (spec.ports || []).length - 1 ? ", " : ""]
10053
- }),
10054
- tooltip: `${clusterVip}:${p.nodePort}`
10055
- })
10057
+ content = (_a = spec.ports) == null ? void 0 : _a.filter((v) => !!v).map((p, index) => /* @__PURE__ */ jsxRuntimeExports.jsx(OverflowTooltip, {
10058
+ content: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
10059
+ className: cx_default(Typo.Label.l4_regular_title, BreakLineStyle),
10060
+ children: [i18n2.t("dovetail.any_node_ip"), ":", p.nodePort, !breakLine && index !== (spec.ports || []).length - 1 ? ", " : ""]
10061
+ }),
10062
+ tooltip: `${i18n2.t("dovetail.any_node_ip")}:${p.nodePort}`
10056
10063
  }, p.nodePort));
10057
10064
  return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", {
10058
10065
  children: content
@@ -10136,7 +10143,8 @@ const StateTag = ({
10136
10143
  terminating: "loading",
10137
10144
  pending: "warning",
10138
10145
  waiting: "warning",
10139
- terminated: "red"
10146
+ terminated: "red",
10147
+ stopped: "gray"
10140
10148
  };
10141
10149
  return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.statusCapsule, {
10142
10150
  className: cx_default(className, StateTagStyle, hideBackground && "no-background"),
@@ -10896,8 +10904,14 @@ const ImageNames = ({
10896
10904
  }, `${image2}-${index}`)) : value2.join(", ")
10897
10905
  });
10898
10906
  };
10907
+ const index_cbhkdt = "";
10908
+ const LinkStyle$1 = "l1vnw9x0";
10899
10909
  const ResourceLink = (props) => {
10900
- const { name: name2, namespace: namespace2, resourceId } = props;
10910
+ const {
10911
+ name: name2,
10912
+ namespace: namespace2,
10913
+ resourceId
10914
+ } = props;
10901
10915
  const kit = useUIKit();
10902
10916
  const navigation = useNavigation();
10903
10917
  const go = useGo();
@@ -10912,7 +10926,11 @@ const ResourceLink = (props) => {
10912
10926
  }
10913
10927
  });
10914
10928
  };
10915
- return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, { onClick, children: resourceId });
10929
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, {
10930
+ className: LinkStyle$1,
10931
+ onClick,
10932
+ children: resourceId
10933
+ });
10916
10934
  };
10917
10935
  const IngressRulesTable = ({ ingress }) => {
10918
10936
  const { t: t2 } = useTranslation();
@@ -11318,7 +11336,7 @@ function KeyValueSecret(props) {
11318
11336
  i18n: i18n2
11319
11337
  } = useTranslation();
11320
11338
  const [hideSecret, setHideSecret] = useState(true);
11321
- const toggleButton = /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
11339
+ const toggleButton = Object.keys(data2).length ? /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
11322
11340
  type: "quiet",
11323
11341
  prefixIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Icon$1, {
11324
11342
  src: hideSecret ? ViewEye16GradientGrayIcon : EntityFilterIgnoreGradient16GrayIcon
@@ -11327,7 +11345,7 @@ function KeyValueSecret(props) {
11327
11345
  className: ButtonStyle,
11328
11346
  size: "small",
11329
11347
  children: hideSecret ? i18n2.t("dovetail.show_data_value") : i18n2.t("dovetail.hide_data_value")
11330
- });
11348
+ }) : null;
11331
11349
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ShowGroupComponent, {
11332
11350
  title: i18n2.t("dovetail.data"),
11333
11351
  operationEle: toggleButton,
@@ -11839,7 +11857,13 @@ const DataField = (i18n2) => {
11839
11857
  key: "data",
11840
11858
  path: ["data"],
11841
11859
  renderContent: (val) => {
11842
- return /* @__PURE__ */ jsxRuntimeExports.jsx(KeyValue, { data: val, empty: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.data") }) });
11860
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
11861
+ KeyValue,
11862
+ {
11863
+ data: val,
11864
+ empty: i18n2.t("dovetail.no_resource", { kind: i18n2.t("dovetail.data") })
11865
+ }
11866
+ );
11843
11867
  }
11844
11868
  };
11845
11869
  };
@@ -11964,12 +11988,12 @@ const ServiceInnerClusterAccessField = () => ({
11964
11988
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceInClusterAccessComponent, { service: record });
11965
11989
  }
11966
11990
  });
11967
- const ServiceOutClusterAccessField = (clusterVip) => ({
11991
+ const ServiceOutClusterAccessField = () => ({
11968
11992
  key: "innerClusterAccess",
11969
11993
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
11970
11994
  path: [],
11971
11995
  renderContent: (_, record) => {
11972
- return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, { service: record, clusterVip, breakLine: false });
11996
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, { service: record, breakLine: false });
11973
11997
  }
11974
11998
  });
11975
11999
  const PodSelectorField = () => ({
@@ -22876,7 +22900,7 @@ const Separator = () => {
22876
22900
  });
22877
22901
  };
22878
22902
  const MonacoYamlEditor = React__default.lazy(() => Promise.resolve().then(() => MonacoYamlEditor$2));
22879
- const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-7cb1e598.js"));
22903
+ const MonacoYamlDiffEditor = React__default.lazy(() => import("./MonacoYamlDiffEditor-b82fbea9.js"));
22880
22904
  const YamlEditorComponent = forwardRef(
22881
22905
  function YamlEditorComponent2(props, ref) {
22882
22906
  const {
@@ -23492,6 +23516,9 @@ function YamlForm(props) {
23492
23516
  errorNotification: false,
23493
23517
  transformInitValues,
23494
23518
  transformApplyValues,
23519
+ mutationMeta: {
23520
+ updateType: "put"
23521
+ },
23495
23522
  ...useFormProps
23496
23523
  });
23497
23524
  const kit = useUIKit();
@@ -23598,9 +23625,9 @@ function FormModal(props) {
23598
23625
  onErrorsChange(errors) {
23599
23626
  setIsError(!!errors.length);
23600
23627
  },
23601
- onFinish: usePopModal
23628
+ onFinish: popModal
23602
23629
  };
23603
- }, [props.formProps, (_a = config.formConfig) == null ? void 0 : _a.transformInitValues, (_b = config.formConfig) == null ? void 0 : _b.transformApplyValues, config == null ? void 0 : config.initValue, id, action]);
23630
+ }, [props.formProps, (_a = config.formConfig) == null ? void 0 : _a.transformInitValues, (_b = config.formConfig) == null ? void 0 : _b.transformApplyValues, config == null ? void 0 : config.initValue, id, action, popModal]);
23604
23631
  const refineFormResult = useRefineForm({
23605
23632
  config,
23606
23633
  id,
@@ -24004,41 +24031,45 @@ const TextTags = (props) => {
24004
24031
  });
24005
24032
  return /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: tags });
24006
24033
  };
24007
- const IngressRulesComponent = ({ ingress }) => {
24034
+ const index_18ct5u4 = "";
24035
+ const LinkStyle = "l25ca2k";
24036
+ const IngressRulesComponent = ({
24037
+ ingress
24038
+ }) => {
24008
24039
  const kit = useUIKit();
24009
24040
  const result = ingress.flattenedRules.map((r2) => {
24010
24041
  const divider = " > ";
24011
- let pre = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: r2.fullPath });
24042
+ let pre = /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
24043
+ children: r2.fullPath
24044
+ });
24012
24045
  if (r2.fullPath.includes("http") && !r2.fullPath.includes("*")) {
24013
- pre = /* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, { href: r2.fullPath, target: "_blank", children: r2.fullPath });
24046
+ pre = /* @__PURE__ */ jsxRuntimeExports.jsx(kit.Link, {
24047
+ className: LinkStyle,
24048
+ href: r2.fullPath,
24049
+ target: "_blank",
24050
+ children: r2.fullPath
24051
+ });
24014
24052
  }
24015
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
24016
- kit.overflowTooltip,
24017
- {
24018
- content: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
24019
- pre,
24020
- /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: divider }),
24021
- r2.serviceName ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
24022
- /* @__PURE__ */ jsxRuntimeExports.jsx(
24023
- ResourceLink,
24024
- {
24025
- name: "services",
24026
- namespace: ingress.metadata.namespace || "default",
24027
- resourceId: r2.serviceName
24028
- }
24029
- ),
24030
- /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
24031
- ":",
24032
- r2.servicePort
24033
- ] })
24034
- ] }) : r2.resourceName
24035
- ] }),
24036
- tooltip: `${r2.fullPath}${divider}:${r2.servicePort}`
24037
- },
24038
- r2.fullPath
24039
- );
24053
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(kit.overflowTooltip, {
24054
+ content: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
24055
+ children: [pre, /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
24056
+ children: divider
24057
+ }), r2.serviceName ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, {
24058
+ children: [/* @__PURE__ */ jsxRuntimeExports.jsx(ResourceLink, {
24059
+ name: "services",
24060
+ namespace: ingress.metadata.namespace || "default",
24061
+ resourceId: r2.serviceName
24062
+ }), /* @__PURE__ */ jsxRuntimeExports.jsxs("span", {
24063
+ children: [":", r2.servicePort]
24064
+ })]
24065
+ }) : r2.resourceName]
24066
+ }),
24067
+ tooltip: `${r2.fullPath}${divider}:${r2.servicePort}`
24068
+ }, r2.fullPath);
24069
+ });
24070
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
24071
+ children: result
24040
24072
  });
24041
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: result });
24042
24073
  };
24043
24074
  const columns_qgyagz = "";
24044
24075
  const DashedTitleStyle = "dh5j833";
@@ -24169,8 +24200,7 @@ const WorkloadRestartsColumnRenderer = (i18n2) => {
24169
24200
  width: 120,
24170
24201
  dataIndex,
24171
24202
  align: "right",
24172
- title: i18n2.t("dovetail.restarts"),
24173
- sortable: false
24203
+ title: i18n2.t("dovetail.restarts")
24174
24204
  };
24175
24205
  };
24176
24206
  const ReplicasColumnRenderer = (i18n2) => {
@@ -24180,7 +24210,7 @@ const ReplicasColumnRenderer = (i18n2) => {
24180
24210
  display: true,
24181
24211
  dataIndex,
24182
24212
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, {
24183
- title: i18n2.t("dovetail.completion_num_tooltip"),
24213
+ title: i18n2.t("dovetail.ready_num_tooltip"),
24184
24214
  children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
24185
24215
  className: DashedTitleStyle,
24186
24216
  children: i18n2.t("dovetail.pod_num")
@@ -24201,6 +24231,7 @@ const AgeColumnRenderer = (i18n2, config, {
24201
24231
  isRelativeTime = true
24202
24232
  } = {}) => {
24203
24233
  const dataIndex = ["metadata", "creationTimestamp"];
24234
+ const kit = useUIKit();
24204
24235
  return {
24205
24236
  key: "creationTimestamp",
24206
24237
  display: true,
@@ -24212,7 +24243,11 @@ const AgeColumnRenderer = (i18n2, config, {
24212
24243
  return isRelativeTime ? /* @__PURE__ */ jsxRuntimeExports.jsx(Time, {
24213
24244
  date: new Date(value2)
24214
24245
  }) : /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
24215
- value: dayjs(value2).format("YYYY-MM-DD hh:mm:ss")
24246
+ value: /* @__PURE__ */ jsxRuntimeExports.jsx(kit.time, {
24247
+ date: value2,
24248
+ timeTemplate: "HH:mm:ss",
24249
+ dateTemplate: "YYYY-MM-DD"
24250
+ })
24216
24251
  });
24217
24252
  },
24218
24253
  ...config
@@ -24373,7 +24408,7 @@ function ServiceOutClusterAccessTitle() {
24373
24408
  })
24374
24409
  });
24375
24410
  }
24376
- const ServiceOutClusterAccessColumnRenderer = (clusterVip) => {
24411
+ const ServiceOutClusterAccessColumnRenderer = () => {
24377
24412
  return {
24378
24413
  key: "outClusterAccess",
24379
24414
  title: /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessTitle, {}),
@@ -24382,8 +24417,7 @@ const ServiceOutClusterAccessColumnRenderer = (clusterVip) => {
24382
24417
  width: 160,
24383
24418
  render(_, record) {
24384
24419
  return /* @__PURE__ */ jsxRuntimeExports.jsx(ServiceOutClusterAccessComponent, {
24385
- service: record,
24386
- clusterVip
24420
+ service: record
24387
24421
  });
24388
24422
  }
24389
24423
  };
@@ -24546,15 +24580,15 @@ const PortMappingColumnRenderer = (i18n2) => {
24546
24580
  whiteSpace: "pre"
24547
24581
  },
24548
24582
  children: [record.displayType === "NodePort" ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link$1, {
24549
- href: `//${v.servicePort}`,
24583
+ href: `//${v.link}`,
24550
24584
  target: "_blank",
24551
24585
  children: v.servicePort
24552
- }) : v.servicePort, " > ", v.targetPort, "/", v.protocol]
24586
+ }) : v.servicePort, " ", "> ", v.targetPort, "/", v.protocol]
24553
24587
  }),
24554
24588
  tooltip: `${v.servicePort} > ${v.targetPort}/${v.protocol}`
24555
24589
  }, v.servicePort));
24556
- return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
24557
- children: content
24590
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDisplay, {
24591
+ value: content
24558
24592
  });
24559
24593
  }
24560
24594
  };
package/dist/refine.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b7, bL, A, aA, aC, ak, bn, aK, H, bB, bp, au, x, C, h, bP, an, aO, Z, bR, a1, a8, b_, ac, bq, bo, c1, aq, aU, v, ai, aZ, c0, bM, b1, D, aH, b3, b$, aI, ay, ba, bO, bQ, bz, al, a2, q, p, bS, I, aR, ax, s, br, bU, ap, aQ, ad, ae, U, af, aB, aj, a_, b2, V, M, bA, b6, N, J, c, az, Q, b9, aW, aV, bT, bl, f, bt, X, P, aM, t, _, bk, aJ, bY, bX, aF, aS, o, ao, aL, w, aT, aG, c5, bN, b4, bb, bc, am, R, a0, a6, a5, b5, a3, bZ, a4, a9, g, bG, bJ, bF, bE, bH, bI, bC, bu, bx, by, bw, bv, bs, bd, ar, aP, ag, l, bg, k, aD, c4, n, bh, aE, m, aw, aN, i, c3, at, av, aY, aX, as, S, b0, a$, c2, bD, bm, bi, bj, Y, bW, $, W, bV, a7, ab, aa, e, bK, ah, be, y, K, d, T, O, L, r, b, B, z, E, F, u, b8, G, bf, a } from "./index-8f27c902.js";
1
+ import { b7, bL, A, aA, aC, ak, bn, aK, H, bB, bp, au, x, C, h, bP, an, aO, Z, bR, a1, a8, b_, ac, bq, bo, c1, aq, aU, v, ai, aZ, c0, bM, b1, D, aH, b3, b$, aI, ay, ba, bO, bQ, bz, al, a2, q, p, bS, I, aR, ax, s, br, bU, ap, aQ, ad, ae, U, af, aB, aj, a_, b2, V, M, bA, b6, N, J, c, az, Q, b9, aW, aV, bT, bl, f, bt, X, P, aM, t, _, bk, aJ, bY, bX, aF, aS, o, ao, aL, w, aT, aG, c5, bN, b4, bb, bc, am, R, a0, a6, a5, b5, a3, bZ, a4, a9, g, bG, bJ, bF, bE, bH, bI, bC, bu, bx, by, bw, bv, bs, bd, ar, aP, ag, l, bg, k, aD, c4, n, bh, aE, m, aw, aN, i, c3, at, av, aY, aX, as, S, b0, a$, c2, bD, bm, bi, bj, Y, bW, $, W, bV, a7, ab, aa, e, bK, ah, be, y, K, d, T, O, L, r, b, B, z, E, F, u, b8, G, bf, a } from "./index-51cc13dd.js";
2
2
  import "@cloudtower/eagle";
3
3
  import "@refinedev/core";
4
4
  import "@cloudtower/icons-react";