@dovetail-v2/refine 0.0.32 → 0.0.33

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 (248) hide show
  1. package/dist/{MonacoYamlDiffEditor-6563a22b.js → MonacoYamlDiffEditor-cf5e1ebf.js} +3 -3
  2. package/dist/{MonacoYamlEditor-a6e20f8c.js → MonacoYamlEditor-816f672c.js} +3 -3
  3. package/dist/{index-3d05d4c7.js → index-57b8cbed.js} +11048 -7588
  4. package/dist/refine.js +158 -127
  5. package/dist/refine.umd.cjs +11248 -7788
  6. package/dist/style.css +69 -43
  7. package/lib/src/App.js +91 -0
  8. package/lib/src/Dovetail.js +45 -0
  9. package/lib/src/components/Breadcrumb/index.js +20 -0
  10. package/lib/src/components/ConditionsTable/ConditionsTable.js +56 -0
  11. package/lib/src/components/ConditionsTable/index.js +1 -0
  12. package/lib/src/components/CreateButton/index.js +10 -0
  13. package/lib/src/components/CronJobDropdown/index.js +26 -0
  14. package/lib/src/components/CronjobJobsTable/index.js +49 -0
  15. package/lib/src/components/DeleteButton/index.js +13 -0
  16. package/lib/src/components/DeleteManyButton/index.js +16 -0
  17. package/lib/src/components/DrawerShow/DrawerShow.js +13 -0
  18. package/lib/src/components/DrawerShow/index.js +1 -0
  19. package/lib/src/components/EditButton/index.js +13 -0
  20. package/lib/src/components/EditField/index.js +47 -0
  21. package/lib/src/components/ErrorContent/index.js +36 -0
  22. package/lib/src/components/EventsTable/EventsTable.js +59 -0
  23. package/lib/src/components/EventsTable/index.js +1 -0
  24. package/lib/src/components/Form/FormModal.d.ts +9 -0
  25. package/lib/src/components/Form/KeyValueListWidget.js +56 -0
  26. package/lib/src/components/Form/MetadataForm.js +9 -0
  27. package/lib/src/components/Form/NameInputWidget.js +50 -0
  28. package/lib/src/components/Form/NamespaceSelectWidget.js +21 -0
  29. package/lib/src/components/Form/RefineFormContent.d.ts +12 -0
  30. package/lib/src/components/Form/RefineFormPage.d.ts +7 -0
  31. package/lib/src/components/Form/YamlForm.d.ts +26 -0
  32. package/lib/src/components/Form/index.d.ts +7 -4
  33. package/lib/src/components/Form/index.js +4 -0
  34. package/lib/src/components/Form/type.d.ts +17 -0
  35. package/lib/src/components/Form/useRefineForm.d.ts +10 -0
  36. package/lib/src/components/Form/useYamlForm.d.ts +49 -0
  37. package/lib/src/components/Form/widget.js +1 -0
  38. package/lib/src/components/FormErrorAlert/index.d.ts +1 -0
  39. package/lib/src/components/FormErrorAlert/index.js +8 -0
  40. package/lib/src/components/FormLayout/index.js +21 -0
  41. package/lib/src/components/FormModal/index.js +51 -0
  42. package/lib/src/components/FormWidgets/KeyValueListWidget.d.ts +6 -0
  43. package/lib/src/components/FormWidgets/MetadataForm.d.ts +2 -0
  44. package/lib/src/components/FormWidgets/NameInputWidget.d.ts +51 -0
  45. package/lib/src/components/FormWidgets/NamespaceSelectWidget.d.ts +9 -0
  46. package/lib/src/components/FormWidgets/index.d.ts +4 -0
  47. package/lib/src/components/FormWidgets/widget.d.ts +5 -0
  48. package/lib/src/components/ImageNames/index.d.ts +1 -0
  49. package/lib/src/components/ImageNames/index.js +14 -0
  50. package/lib/src/components/IngressRulesComponent/index.js +11 -0
  51. package/lib/src/components/IngressRulesTable/IngressRulesTable.js +51 -0
  52. package/lib/src/components/IngressRulesTable/index.js +1 -0
  53. package/lib/src/components/K8sDropdown/index.js +31 -0
  54. package/lib/src/components/KeyValue/KeyValue.d.ts +5 -5
  55. package/lib/src/components/KeyValue/KeyValue.js +27 -0
  56. package/lib/src/components/KeyValue/KeyValueAnnotation.d.ts +6 -0
  57. package/lib/src/components/KeyValue/KeyValueSecret.d.ts +5 -0
  58. package/lib/src/components/KeyValue/index.d.ts +2 -0
  59. package/lib/src/components/KeyValue/index.js +1 -0
  60. package/lib/src/components/KeyValueData/index.js +50 -0
  61. package/lib/src/components/Layout/index.js +39 -0
  62. package/lib/src/components/ListPage/index.d.ts +0 -1
  63. package/lib/src/components/ListPage/index.js +25 -0
  64. package/lib/src/components/Menu/index.js +36 -0
  65. package/lib/src/components/NamespacesFilter/index.d.ts +6 -2
  66. package/lib/src/components/NamespacesFilter/index.js +34 -0
  67. package/lib/src/components/NetworkPolicyRulesTable/NetworkPolicyRulesTable.js +77 -0
  68. package/lib/src/components/NetworkPolicyRulesTable/index.js +1 -0
  69. package/lib/src/components/PageShow/PageShow.js +11 -0
  70. package/lib/src/components/PageShow/index.js +1 -0
  71. package/lib/src/components/PodContainersTable/PodContainersTable.js +78 -0
  72. package/lib/src/components/PodContainersTable/index.js +1 -0
  73. package/lib/src/components/PodLog/index.js +136 -0
  74. package/lib/src/components/PodSelectorTable/index.d.ts +6 -0
  75. package/lib/src/components/PortsTable/index.d.ts +7 -0
  76. package/lib/src/components/ReferenceLink/index.js +17 -0
  77. package/lib/src/components/RefineForm/RefineFormContent.d.ts +10 -0
  78. package/lib/src/components/RefineForm/RefineFormModal.d.ts +8 -0
  79. package/lib/src/components/RefineForm/RefineFormPage.d.ts +7 -0
  80. package/lib/src/components/RefineForm/index.d.ts +3 -0
  81. package/lib/src/components/RefineForm/type.d.ts +20 -0
  82. package/lib/src/components/RefineForm/useRefineForm.d.ts +10 -0
  83. package/lib/src/components/ReplicasDropdown/index.d.ts +9 -0
  84. package/lib/src/components/ResourceCRUD/ResourceCRUD.js +15 -0
  85. package/lib/src/components/ResourceCRUD/create/index.js +13 -0
  86. package/lib/src/components/ResourceCRUD/index.js +4 -0
  87. package/lib/src/components/ResourceCRUD/list/index.d.ts +3 -7
  88. package/lib/src/components/ResourceCRUD/list/index.js +19 -0
  89. package/lib/src/components/ResourceCRUD/show/index.d.ts +3 -7
  90. package/lib/src/components/ResourceCRUD/show/index.js +6 -0
  91. package/lib/src/components/ResourceLink/index.js +21 -0
  92. package/lib/src/components/ResourceUsageBar/index.js +81 -0
  93. package/lib/src/components/Separator/index.js +11 -0
  94. package/lib/src/components/ServiceComponents/index.d.ts +4 -1
  95. package/lib/src/components/ShowContent/ShowContent.d.ts +5 -0
  96. package/lib/src/components/ShowContent/ShowContent.js +157 -0
  97. package/lib/src/components/ShowContent/fields.d.ts +17 -11
  98. package/lib/src/components/ShowContent/fields.js +157 -0
  99. package/lib/src/components/ShowContent/groups.d.ts +11 -3
  100. package/lib/src/components/ShowContent/index.js +2 -0
  101. package/lib/src/components/ShowContent/tabs.d.ts +3 -7
  102. package/lib/src/components/StateTag/StateTag.d.ts +1 -0
  103. package/lib/src/components/StateTag/StateTag.js +22 -0
  104. package/lib/src/components/StateTag/index.js +1 -0
  105. package/lib/src/components/Table/ErrorContent.js +36 -0
  106. package/lib/src/components/Table/TableToolBar.d.ts +1 -1
  107. package/lib/src/components/Table/TableToolBar.js +14 -0
  108. package/lib/src/components/Table/TableWidgets.js +28 -0
  109. package/lib/src/components/Table/index.js +69 -0
  110. package/lib/src/components/Tags/index.js +22 -0
  111. package/lib/src/components/Time/index.js +14 -0
  112. package/lib/src/components/ValueDisplay/index.d.ts +8 -0
  113. package/lib/src/components/WorkloadDropdown/index.d.ts +2 -2
  114. package/lib/src/components/WorkloadDropdown/index.js +24 -0
  115. package/lib/src/components/WorkloadPodsTable/WorkloadPodsTable.js +39 -0
  116. package/lib/src/components/WorkloadPodsTable/index.js +1 -0
  117. package/lib/src/components/WorkloadReplicas/index.d.ts +11 -1
  118. package/lib/src/components/WorkloadReplicas/index.js +50 -0
  119. package/lib/src/components/YamlEditor/MonacoYamlDiffEditor.js +34 -0
  120. package/lib/src/components/YamlEditor/MonacoYamlEditor.js +149 -0
  121. package/lib/src/components/YamlEditor/YamlEditorComponent.js +90 -0
  122. package/lib/src/components/YamlEditor/index.js +1 -0
  123. package/lib/src/components/YamlEditor/style.js +102 -0
  124. package/lib/src/components/YamlEditor/yaml.worker.js +1 -0
  125. package/lib/src/components/YamlForm/index.js +61 -0
  126. package/lib/src/components/index.d.ts +2 -3
  127. package/lib/src/components/index.js +38 -0
  128. package/lib/src/constants/index.js +2 -0
  129. package/lib/src/constants/k8s.d.ts +289 -89
  130. package/lib/src/constants/k8s.js +203 -0
  131. package/lib/src/constants/state.d.ts +2 -1
  132. package/lib/src/constants/state.js +15 -0
  133. package/lib/src/contexts/component.js +3 -0
  134. package/lib/src/contexts/configs.js +3 -0
  135. package/lib/src/contexts/global-store.js +3 -0
  136. package/lib/src/contexts/index.js +3 -0
  137. package/lib/src/hooks/index.d.ts +1 -1
  138. package/lib/src/hooks/index.js +7 -0
  139. package/lib/src/hooks/useDeleteModal/index.js +1 -0
  140. package/lib/src/hooks/useDeleteModal/useDeleteManyModal.js +31 -0
  141. package/lib/src/hooks/useDeleteModal/useDeleteModal.js +38 -0
  142. package/lib/src/hooks/useDownloadYAML.js +10 -0
  143. package/lib/src/hooks/useEagleForm.js +177 -0
  144. package/lib/src/hooks/useEagleTable/columns.d.ts +7 -2
  145. package/lib/src/hooks/useEagleTable/columns.js +246 -0
  146. package/lib/src/hooks/useEagleTable/index.js +2 -0
  147. package/lib/src/hooks/useEagleTable/useEagleTable.js +63 -0
  148. package/lib/src/hooks/useEdit.js +19 -0
  149. package/lib/src/hooks/useGlobalStore.js +5 -0
  150. package/lib/src/hooks/useK8sYamlEditor.js +37 -0
  151. package/lib/src/hooks/useOpenForm.d.ts +3 -0
  152. package/lib/src/hooks/useOpenForm.js +43 -0
  153. package/lib/src/hooks/useSchema.js +37 -0
  154. package/lib/src/hooks/useSubmitForm.js +42 -0
  155. package/lib/src/i18n.d.ts +140 -13
  156. package/lib/src/i18n.js +19 -0
  157. package/lib/src/index.js +13 -0
  158. package/lib/src/locales/en-US/dovetail.json +18 -0
  159. package/lib/src/locales/en-US/index.d.ts +98 -1
  160. package/lib/src/locales/en-US/index.js +4 -0
  161. package/lib/src/locales/index.js +6 -0
  162. package/lib/src/locales/zh-CN/dovetail.json +91 -0
  163. package/lib/src/locales/zh-CN/index.d.ts +42 -12
  164. package/lib/src/locales/zh-CN/index.js +4 -0
  165. package/lib/src/main.js +12 -0
  166. package/lib/src/models/cronjob-model.js +32 -0
  167. package/lib/src/models/daemonset-model.d.ts +3 -1
  168. package/lib/src/models/daemonset-model.js +17 -0
  169. package/lib/src/models/deployment-model.d.ts +1 -1
  170. package/lib/src/models/deployment-model.js +17 -0
  171. package/lib/src/models/event-model.js +11 -0
  172. package/lib/src/models/index.js +14 -0
  173. package/lib/src/models/ingress-model.d.ts +5 -3
  174. package/lib/src/models/ingress-model.js +24 -0
  175. package/lib/src/models/job-model.js +56 -0
  176. package/lib/src/models/network-policy-model.js +10 -0
  177. package/lib/src/models/pod-metrics-model.js +34 -0
  178. package/lib/src/models/pod-model.js +78 -0
  179. package/lib/src/models/resource-model.js +34 -0
  180. package/lib/src/models/service-model.js +17 -0
  181. package/lib/src/models/statefulset-model.d.ts +1 -1
  182. package/lib/src/models/statefulset-model.js +17 -0
  183. package/lib/src/models/types/index.js +1 -0
  184. package/lib/src/models/types/metric.js +1 -0
  185. package/lib/src/models/workload-base-model.js +22 -0
  186. package/lib/src/models/workload-model.js +51 -0
  187. package/lib/src/pages/configmaps/index.js +15 -0
  188. package/lib/src/pages/cronjobs/create/index.js +6 -0
  189. package/lib/src/pages/cronjobs/index.js +3 -0
  190. package/lib/src/pages/cronjobs/list/index.js +42 -0
  191. package/lib/src/pages/cronjobs/show/index.js +16 -0
  192. package/lib/src/pages/daemonsets/create/index.js +6 -0
  193. package/lib/src/pages/daemonsets/index.js +3 -0
  194. package/lib/src/pages/daemonsets/list/index.js +32 -0
  195. package/lib/src/pages/daemonsets/show/index.js +16 -0
  196. package/lib/src/pages/deployments/create/index.js +7 -0
  197. package/lib/src/pages/deployments/index.d.ts +0 -1
  198. package/lib/src/pages/deployments/index.js +3 -0
  199. package/lib/src/pages/deployments/list/index.js +26 -0
  200. package/lib/src/pages/deployments/show/index.js +16 -0
  201. package/lib/src/pages/ingresses/index.js +26 -0
  202. package/lib/src/pages/jobs/index.js +34 -0
  203. package/lib/src/pages/networkPolicies/index.js +67 -0
  204. package/lib/src/pages/pods/create/index.js +6 -0
  205. package/lib/src/pages/pods/index.js +3 -0
  206. package/lib/src/pages/pods/list/index.js +81 -0
  207. package/lib/src/pages/pods/show/index.js +54 -0
  208. package/lib/src/pages/secrets/index.js +15 -0
  209. package/lib/src/pages/services/index.js +26 -0
  210. package/lib/src/pages/statefulsets/create/index.js +6 -0
  211. package/lib/src/pages/statefulsets/index.js +3 -0
  212. package/lib/src/pages/statefulsets/list/index.js +26 -0
  213. package/lib/src/pages/statefulsets/show/index.js +16 -0
  214. package/lib/src/plugins/index.js +3 -0
  215. package/lib/src/plugins/model-plugin.js +46 -0
  216. package/lib/src/plugins/relation-plugin.js +81 -0
  217. package/lib/src/plugins/type.js +1 -0
  218. package/lib/src/providers/index.js +1 -0
  219. package/lib/src/providers/router-provider/index.js +100 -0
  220. package/lib/src/types/index.js +1 -0
  221. package/lib/src/types/resource.d.ts +12 -3
  222. package/lib/src/types/resource.js +12 -0
  223. package/lib/src/utils/addId.js +8 -0
  224. package/lib/src/utils/download.js +9 -0
  225. package/lib/src/utils/error.js +53 -0
  226. package/lib/src/utils/form.js +9 -0
  227. package/lib/src/utils/k8s.js +6 -0
  228. package/lib/src/utils/labels.js +15 -0
  229. package/lib/src/utils/match-selector.js +12 -0
  230. package/lib/src/utils/openapi.js +33 -0
  231. package/lib/src/utils/schema.js +117 -0
  232. package/lib/src/utils/selector.js +12 -0
  233. package/lib/src/utils/string.js +6 -0
  234. package/lib/src/utils/time.js +46 -0
  235. package/lib/src/utils/unit.js +69 -0
  236. package/lib/src/utils/yaml.js +44 -0
  237. package/lib/vite.config.js +60 -0
  238. package/package.json +6 -4
  239. package/lib/src/components/ModalContextProvider/index.d.ts +0 -12
  240. package/lib/src/hooks/useModal.d.ts +0 -0
  241. package/lib/src/model/cronjob-model.d.ts +0 -9
  242. package/lib/src/model/index.d.ts +0 -6
  243. package/lib/src/model/job-model.d.ts +0 -10
  244. package/lib/src/model/pod-metrics-model.d.ts +0 -7
  245. package/lib/src/model/pod-model.d.ts +0 -15
  246. package/lib/src/model/resource-model.d.ts +0 -17
  247. package/lib/src/model/workload-model.d.ts +0 -17
  248. package/lib/src/types/metric.d.ts +0 -25
package/lib/src/i18n.d.ts CHANGED
@@ -18,7 +18,104 @@ export declare const resources: {
18
18
  retry: string;
19
19
  create_resource: string;
20
20
  edit_resource: string;
21
- status: string;
21
+ state: string;
22
+ name: string;
23
+ pod: string;
24
+ cancel: string;
25
+ delete: string;
26
+ create: string;
27
+ confirm_delete_text: string;
28
+ edit: string;
29
+ namespace: string;
30
+ image: string;
31
+ created_time: string;
32
+ label: string;
33
+ annotation: string;
34
+ type: string;
35
+ event: string;
36
+ reason: string;
37
+ object: string;
38
+ note: string;
39
+ condition: string;
40
+ download_yaml: string;
41
+ detail: string;
42
+ restarts: string;
43
+ updated_time: string;
44
+ message: string;
45
+ save: string;
46
+ more: string;
47
+ workload: string;
48
+ all_namespaces: string;
49
+ empty: string;
50
+ schedule: string;
51
+ lastScheduleTime: string;
52
+ duration: string;
53
+ started: string;
54
+ init_container: string;
55
+ regular_container: string;
56
+ container: string;
57
+ redeploy: string;
58
+ data: string;
59
+ suspend: string;
60
+ resume: string;
61
+ clusterIp: string;
62
+ sessionAffinity: string;
63
+ log: string;
64
+ select_container: string;
65
+ wrap: string;
66
+ resume_log: string;
67
+ log_new_lines: string;
68
+ ready: string;
69
+ updating: string;
70
+ completed: string;
71
+ failed: string;
72
+ suspended: string;
73
+ running: string;
74
+ terminating: string;
75
+ terminated: string;
76
+ succeeded: string;
77
+ unknown: string;
78
+ pending: string;
79
+ waiting: string;
80
+ sec: string;
81
+ min: string;
82
+ hr: string;
83
+ day: string;
84
+ expand: string;
85
+ fold: string;
86
+ rule: string;
87
+ default_backend: string;
88
+ ingress_class: string;
89
+ port: string;
90
+ pod_ready_num: string;
91
+ pod_replicas_num: string;
92
+ edit_replicas: string;
93
+ cert: string;
94
+ dns_record: string;
95
+ port_mapping: string;
96
+ out_cluster_access: string;
97
+ in_cluster_access: string;
98
+ fail_get_detail: string;
99
+ basic_info: string;
100
+ pod_selector: string;
101
+ ingress_rule: string;
102
+ egress_rule: string;
103
+ ip_address: string;
104
+ last_seen: string;
105
+ service_port: string;
106
+ pod_port: string;
107
+ node_port: string;
108
+ protocol: string;
109
+ key: string;
110
+ value: string;
111
+ path_type: string;
112
+ path: string;
113
+ backend: string;
114
+ belong_to_node: string;
115
+ true: string;
116
+ false: string;
117
+ warning: string;
118
+ normal: string;
22
119
  };
23
120
  };
24
121
  'zh-CN': {
@@ -36,15 +133,14 @@ export declare const resources: {
36
133
  cancel: string;
37
134
  delete: string;
38
135
  create: string;
136
+ delete_resource: string;
39
137
  confirm_delete_text: string;
138
+ delete_tip: string;
40
139
  edit: string;
41
140
  namespace: string;
42
141
  name: string;
43
142
  state: string;
44
- status: string;
45
- phase: string;
46
143
  image: string;
47
- replicas: string;
48
144
  created_time: string;
49
145
  label: string;
50
146
  annotation: string;
@@ -56,7 +152,6 @@ export declare const resources: {
56
152
  condition: string;
57
153
  download_yaml: string;
58
154
  detail: string;
59
- node_name: string;
60
155
  restarts: string;
61
156
  updated_time: string;
62
157
  message: string;
@@ -68,23 +163,18 @@ export declare const resources: {
68
163
  schedule: string;
69
164
  lastScheduleTime: string;
70
165
  duration: string;
71
- completions: string;
72
166
  started: string;
73
167
  init_container: string;
168
+ regular_container: string;
74
169
  container: string;
75
170
  redeploy: string;
76
171
  data: string;
77
172
  suspend: string;
78
173
  resume: string;
79
- cluster: string;
80
- storage: string;
81
- network: string;
82
174
  clusterIp: string;
83
175
  sessionAffinity: string;
84
176
  log: string;
85
177
  select_container: string;
86
- wrap: string;
87
- resume_log: string;
88
178
  log_new_lines: string;
89
179
  fetch_schema_fail: string;
90
180
  obtain_data_error: string;
@@ -97,6 +187,7 @@ export declare const resources: {
97
187
  running: string;
98
188
  terminating: string;
99
189
  succeeded: string;
190
+ terminated: string;
100
191
  unknown: string;
101
192
  pending: string;
102
193
  waiting: string;
@@ -110,7 +201,6 @@ export declare const resources: {
110
201
  fold: string;
111
202
  rule: string;
112
203
  default_backend: string;
113
- ingress_rule_type: string;
114
204
  ingress_class: string;
115
205
  port: string;
116
206
  pod_ready_num: string;
@@ -121,9 +211,46 @@ export declare const resources: {
121
211
  port_mapping: string;
122
212
  out_cluster_access: string;
123
213
  in_cluster_access: string;
124
- any_node_ip: string;
125
214
  fail_get_detail: string;
126
215
  basic_info: string;
216
+ pod: string;
217
+ pod_selector: string;
218
+ ingress_rule: string;
219
+ egress_rule: string;
220
+ ip_address: string;
221
+ last_seen: string;
222
+ service_port: string;
223
+ pod_port: string;
224
+ node_port: string;
225
+ protocol: string;
226
+ key: string;
227
+ value: string;
228
+ show_data_value: string;
229
+ hide_data_value: string;
230
+ path_type: string;
231
+ path: string;
232
+ backend: string;
233
+ belong_to_node: string;
234
+ please_input: string;
235
+ create_failed: string;
236
+ create_failed_tip: string;
237
+ save_failed: string;
238
+ save_failed_tip: string;
239
+ completion_num_tooltip: string;
240
+ ready_num_tooltip: string;
241
+ true: string;
242
+ false: string;
243
+ warning: string;
244
+ normal: string;
245
+ realtime_log: string;
246
+ previous_log: string;
247
+ auto_wrap: string;
248
+ name_can_not_be_empty: string;
249
+ password: string;
250
+ username: string;
251
+ host: string;
252
+ create_resource_success: string;
253
+ edit_resource_success: string;
127
254
  };
128
255
  };
129
256
  };
@@ -0,0 +1,19 @@
1
+ import i18n from 'i18next';
2
+ import { initReactI18next, useTranslation } from 'react-i18next';
3
+ import { D2Locales } from 'src/locales';
4
+ export const resources = D2Locales;
5
+ i18n.use(initReactI18next).init({
6
+ supportedLngs: ['en-US', 'zh-CN'],
7
+ resources,
8
+ ns: Object.keys(resources['zh-CN']),
9
+ defaultNS: 'dovetail',
10
+ fallbackLng: ['en-US', 'zh-CN'],
11
+ lng: 'zh-CN',
12
+ nsSeparator: '.',
13
+ });
14
+ export const useD2Translation = () => {
15
+ return useTranslation(undefined, {
16
+ i18n,
17
+ });
18
+ };
19
+ export default i18n;
@@ -0,0 +1,13 @@
1
+ import i18n from './i18n';
2
+ export const dovetailRefineI18n = i18n;
3
+ export { D2Locales } from './locales';
4
+ export * from './providers';
5
+ export * from './hooks';
6
+ export * from './components';
7
+ export * from './constants';
8
+ export * from './hooks';
9
+ export * from './Dovetail';
10
+ export * from './types';
11
+ export * from './contexts';
12
+ export * from './models';
13
+ export * from './plugins';
@@ -0,0 +1,18 @@
1
+ {
2
+ "copy": "Copy",
3
+ "reset_arguments": "Reset",
4
+ "view_changes": "Show Diff",
5
+ "back_to_edit": "Edit",
6
+ "configure_file": "Configuration",
7
+ "yaml_format_wrong": "Configuration is in an invalid YAML format.",
8
+ "yaml_value_wrong": "Configuration has invalid values.",
9
+ "edit_yaml": "Edit YAML",
10
+ "copied": "Copied",
11
+ "already_reset": "Already reset",
12
+ "fetch_schema_fail": "Failed to fetch schema.",
13
+ "obtain_data_error": "Having trouble getting data.",
14
+ "retry": "Retry",
15
+ "create_resource": "Create {{resource}}",
16
+ "edit_resource": "Edit {{resource}}",
17
+ "status": "Status"
18
+ }
@@ -15,7 +15,104 @@ declare const _default: {
15
15
  retry: string;
16
16
  create_resource: string;
17
17
  edit_resource: string;
18
- status: string;
18
+ state: string;
19
+ name: string;
20
+ pod: string;
21
+ cancel: string;
22
+ delete: string;
23
+ create: string;
24
+ confirm_delete_text: string;
25
+ edit: string;
26
+ namespace: string;
27
+ image: string;
28
+ created_time: string;
29
+ label: string;
30
+ annotation: string;
31
+ type: string;
32
+ event: string;
33
+ reason: string;
34
+ object: string;
35
+ note: string;
36
+ condition: string;
37
+ download_yaml: string;
38
+ detail: string;
39
+ restarts: string;
40
+ updated_time: string;
41
+ message: string;
42
+ save: string;
43
+ more: string;
44
+ workload: string;
45
+ all_namespaces: string;
46
+ empty: string;
47
+ schedule: string;
48
+ lastScheduleTime: string;
49
+ duration: string;
50
+ started: string;
51
+ init_container: string;
52
+ regular_container: string;
53
+ container: string;
54
+ redeploy: string;
55
+ data: string;
56
+ suspend: string;
57
+ resume: string;
58
+ clusterIp: string;
59
+ sessionAffinity: string;
60
+ log: string;
61
+ select_container: string;
62
+ wrap: string;
63
+ resume_log: string;
64
+ log_new_lines: string;
65
+ ready: string;
66
+ updating: string;
67
+ completed: string;
68
+ failed: string;
69
+ suspended: string;
70
+ running: string;
71
+ terminating: string;
72
+ terminated: string;
73
+ succeeded: string;
74
+ unknown: string;
75
+ pending: string;
76
+ waiting: string;
77
+ sec: string;
78
+ min: string;
79
+ hr: string;
80
+ day: string;
81
+ expand: string;
82
+ fold: string;
83
+ rule: string;
84
+ default_backend: string;
85
+ ingress_class: string;
86
+ port: string;
87
+ pod_ready_num: string;
88
+ pod_replicas_num: string;
89
+ edit_replicas: string;
90
+ cert: string;
91
+ dns_record: string;
92
+ port_mapping: string;
93
+ out_cluster_access: string;
94
+ in_cluster_access: string;
95
+ fail_get_detail: string;
96
+ basic_info: string;
97
+ pod_selector: string;
98
+ ingress_rule: string;
99
+ egress_rule: string;
100
+ ip_address: string;
101
+ last_seen: string;
102
+ service_port: string;
103
+ pod_port: string;
104
+ node_port: string;
105
+ protocol: string;
106
+ key: string;
107
+ value: string;
108
+ path_type: string;
109
+ path: string;
110
+ backend: string;
111
+ belong_to_node: string;
112
+ true: string;
113
+ false: string;
114
+ warning: string;
115
+ normal: string;
19
116
  };
20
117
  };
21
118
  export default _default;
@@ -0,0 +1,4 @@
1
+ import dovetail from './dovetail.json';
2
+ export default {
3
+ dovetail,
4
+ };
@@ -0,0 +1,6 @@
1
+ import D2LocalesEN from './en-US';
2
+ import D2LocalesZH from './zh-CN';
3
+ export const D2Locales = {
4
+ 'en-US': D2LocalesEN,
5
+ 'zh-CN': D2LocalesZH,
6
+ };
@@ -0,0 +1,91 @@
1
+ {
2
+ "copy": "复制",
3
+ "reset_arguments": "重置",
4
+ "view_changes": "查看改动",
5
+ "back_to_edit": "编辑",
6
+ "configure_file": "配置内容",
7
+ "yaml_format_wrong": "配置内容不是有效的 yaml 格式。",
8
+ "yaml_value_wrong": "配置内容中存在不合法的值。",
9
+ "edit_yaml": "编辑 YAML",
10
+ "copied": "已复制",
11
+ "already_reset": "已重置",
12
+ "cancel": "取消",
13
+ "delete": "删除",
14
+ "create": "创建",
15
+ "confirm_delete_text": "确定要删除 {{target}} 吗?",
16
+ "edit": "编辑",
17
+ "namespace": "名字空间",
18
+ "name": "名称",
19
+ "state": "状态",
20
+ "status": "状态",
21
+ "phase": "状态",
22
+ "image": "容器镜像",
23
+ "replicas": "副本数",
24
+ "created_time": "创建时间",
25
+ "label": "标签",
26
+ "annotation": "注释",
27
+ "type": "类型",
28
+ "event": "事件",
29
+ "reason": "原因",
30
+ "object": "对象",
31
+ "note": "事件信息",
32
+ "condition": "Condition",
33
+ "download_yaml": "下载 YAML",
34
+ "detail": "详情",
35
+ "node_name": "主机名称",
36
+ "restarts": "重启次数",
37
+ "updated_time": "更新时间",
38
+ "message": "消息",
39
+ "save": "保存",
40
+ "more": "更多",
41
+ "workload": "工作负载",
42
+ "all_namespaces": "所有名字空间",
43
+ "empty": "无可显示的数据",
44
+ "schedule": "调度时间表",
45
+ "lastScheduleTime": "上次调度时间",
46
+ "duration": "持续时间",
47
+ "completions": "完成 Job 历史数",
48
+ "started": "开始时间",
49
+ "init_container": "初始化容器",
50
+ "container": "容器",
51
+ "redeploy": "重新部署",
52
+ "data": "数据",
53
+ "suspend": "暂停",
54
+ "resume": "重新开始",
55
+ "cluster": "集群",
56
+ "storage": "存储",
57
+ "network": "网络",
58
+ "clusterIp": "集群 IP",
59
+ "sessionAffinity": "会话保持",
60
+ "log": "日志",
61
+ "select_container": "选择容器",
62
+ "wrap": "折叠",
63
+ "resume_log": "继续",
64
+ "log_new_lines": ",并展示 {{ count }} 行新日志",
65
+ "fetch_schema_fail": "获取 schema 失败。",
66
+ "obtain_data_error": "获取数据时遇到问题。",
67
+ "retry": "重试",
68
+ "ready": "就绪",
69
+ "updating": "更新中",
70
+ "completed": "完成",
71
+ "failed": "异常",
72
+ "suspended": "挂起",
73
+ "running": "运行中",
74
+ "terminating": "终止",
75
+ "succeeded": "成功终止",
76
+ "unknown": "未知",
77
+ "pending": "待处理",
78
+ "waiting": "等待中",
79
+ "create_resource": "创建 {{resource}}",
80
+ "edit_resource": "编辑 {{resource}}",
81
+ "sec": "秒",
82
+ "min": "分",
83
+ "hr": "小时",
84
+ "day": "天",
85
+ "expand": "展开",
86
+ "fold": "收起",
87
+ "rule": "规则",
88
+ "default_backend": "默认后端",
89
+ "ingress_rule_type": "规则类型",
90
+ "port": "端口"
91
+ }
@@ -13,15 +13,14 @@ declare const _default: {
13
13
  cancel: string;
14
14
  delete: string;
15
15
  create: string;
16
+ delete_resource: string;
16
17
  confirm_delete_text: string;
18
+ delete_tip: string;
17
19
  edit: string;
18
20
  namespace: string;
19
21
  name: string;
20
22
  state: string;
21
- status: string;
22
- phase: string;
23
23
  image: string;
24
- replicas: string;
25
24
  created_time: string;
26
25
  label: string;
27
26
  annotation: string;
@@ -33,7 +32,6 @@ declare const _default: {
33
32
  condition: string;
34
33
  download_yaml: string;
35
34
  detail: string;
36
- node_name: string;
37
35
  restarts: string;
38
36
  updated_time: string;
39
37
  message: string;
@@ -45,23 +43,18 @@ declare const _default: {
45
43
  schedule: string;
46
44
  lastScheduleTime: string;
47
45
  duration: string;
48
- completions: string;
49
46
  started: string;
50
47
  init_container: string;
48
+ regular_container: string;
51
49
  container: string;
52
50
  redeploy: string;
53
51
  data: string;
54
52
  suspend: string;
55
53
  resume: string;
56
- cluster: string;
57
- storage: string;
58
- network: string;
59
54
  clusterIp: string;
60
55
  sessionAffinity: string;
61
56
  log: string;
62
57
  select_container: string;
63
- wrap: string;
64
- resume_log: string;
65
58
  log_new_lines: string;
66
59
  fetch_schema_fail: string;
67
60
  obtain_data_error: string;
@@ -74,6 +67,7 @@ declare const _default: {
74
67
  running: string;
75
68
  terminating: string;
76
69
  succeeded: string;
70
+ terminated: string;
77
71
  unknown: string;
78
72
  pending: string;
79
73
  waiting: string;
@@ -87,7 +81,6 @@ declare const _default: {
87
81
  fold: string;
88
82
  rule: string;
89
83
  default_backend: string;
90
- ingress_rule_type: string;
91
84
  ingress_class: string;
92
85
  port: string;
93
86
  pod_ready_num: string;
@@ -98,9 +91,46 @@ declare const _default: {
98
91
  port_mapping: string;
99
92
  out_cluster_access: string;
100
93
  in_cluster_access: string;
101
- any_node_ip: string;
102
94
  fail_get_detail: string;
103
95
  basic_info: string;
96
+ pod: string;
97
+ pod_selector: string;
98
+ ingress_rule: string;
99
+ egress_rule: string;
100
+ ip_address: string;
101
+ last_seen: string;
102
+ service_port: string;
103
+ pod_port: string;
104
+ node_port: string;
105
+ protocol: string;
106
+ key: string;
107
+ value: string;
108
+ show_data_value: string;
109
+ hide_data_value: string;
110
+ path_type: string;
111
+ path: string;
112
+ backend: string;
113
+ belong_to_node: string;
114
+ please_input: string;
115
+ create_failed: string;
116
+ create_failed_tip: string;
117
+ save_failed: string;
118
+ save_failed_tip: string;
119
+ completion_num_tooltip: string;
120
+ ready_num_tooltip: string;
121
+ true: string;
122
+ false: string;
123
+ warning: string;
124
+ normal: string;
125
+ realtime_log: string;
126
+ previous_log: string;
127
+ auto_wrap: string;
128
+ name_can_not_be_empty: string;
129
+ password: string;
130
+ username: string;
131
+ host: string;
132
+ create_resource_success: string;
133
+ edit_resource_success: string;
104
134
  };
105
135
  };
106
136
  export default _default;
@@ -0,0 +1,4 @@
1
+ import dovetail from './dovetail.json';
2
+ export default {
3
+ dovetail,
4
+ };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { initParrotI18n } from '@cloudtower/eagle';
3
+ import React from 'react';
4
+ // eslint-disable-next-line react/no-deprecated
5
+ import { render } from 'react-dom';
6
+ import App from './App';
7
+ import './i18n';
8
+ import 'antd/dist/antd.css';
9
+ import '@cloudtower/eagle/dist/style.css';
10
+ initParrotI18n();
11
+ const container = document.getElementById('root');
12
+ render(_jsx(React.StrictMode, { children: _jsx(React.Suspense, { fallback: "loading", children: _jsx(App, {}) }) }), container);
@@ -0,0 +1,32 @@
1
+ import { set, cloneDeep } from 'lodash';
2
+ import { WorkloadState } from '../constants';
3
+ import { WorkloadBaseModel } from './workload-base-model';
4
+ export class CronJobModel extends WorkloadBaseModel {
5
+ _rawYaml;
6
+ _globalStore;
7
+ constructor(_rawYaml, _globalStore) {
8
+ super(_rawYaml, _globalStore);
9
+ this._rawYaml = _rawYaml;
10
+ this._globalStore = _globalStore;
11
+ }
12
+ get stateDisplay() {
13
+ if (!this.spec?.suspend) {
14
+ return WorkloadState.SUSPENDED;
15
+ }
16
+ return WorkloadState.RUNNING;
17
+ }
18
+ suspend() {
19
+ const newOne = cloneDeep(this._rawYaml);
20
+ if (this._rawYaml.kind === 'CronJob') {
21
+ set(newOne, 'spec.suspend', true);
22
+ }
23
+ return newOne;
24
+ }
25
+ resume() {
26
+ const newOne = cloneDeep(this._rawYaml);
27
+ if (this._rawYaml.kind === 'CronJob') {
28
+ set(newOne, 'spec.suspend', false);
29
+ }
30
+ return newOne;
31
+ }
32
+ }
@@ -9,6 +9,8 @@ export declare class DaemonSetModel extends WorkloadModel {
9
9
  spec?: RequiredDaemonSet['spec'];
10
10
  status?: RequiredDaemonSet['status'];
11
11
  constructor(_rawYaml: RequiredDaemonSet, _globalStore: GlobalStore);
12
- get stateDisplay(): WorkloadState.UPDATEING | WorkloadState.READY;
12
+ get stateDisplay(): WorkloadState.UPDATING | WorkloadState.READY;
13
+ get replicas(): number;
14
+ get readyReplicas(): number;
13
15
  }
14
16
  export {};
@@ -0,0 +1,17 @@
1
+ import { WorkloadState } from '../constants';
2
+ import { WorkloadModel } from './workload-model';
3
+ export class DaemonSetModel extends WorkloadModel {
4
+ _rawYaml;
5
+ _globalStore;
6
+ constructor(_rawYaml, _globalStore) {
7
+ super(_rawYaml, _globalStore);
8
+ this._rawYaml = _rawYaml;
9
+ this._globalStore = _globalStore;
10
+ }
11
+ get stateDisplay() {
12
+ if (this.status?.desiredNumberScheduled !== this.status?.numberReady) {
13
+ return WorkloadState.UPDATEING;
14
+ }
15
+ return WorkloadState.READY;
16
+ }
17
+ }
@@ -9,6 +9,6 @@ export declare class DeploymentModel extends WorkloadModel {
9
9
  spec?: RequiredDeployment['spec'];
10
10
  status?: RequiredDeployment['status'];
11
11
  constructor(_rawYaml: RequiredDeployment, _globalStore: GlobalStore);
12
- get stateDisplay(): WorkloadState.UPDATEING | WorkloadState.READY;
12
+ get stateDisplay(): WorkloadState.UPDATING | WorkloadState.READY;
13
13
  }
14
14
  export {};