@dovetail-v2/refine 0.0.32-beta.0 → 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 (59) hide show
  1. package/dist/{MonacoYamlDiffEditor-0d108b88.js → MonacoYamlDiffEditor-cf5e1ebf.js} +3 -3
  2. package/dist/{MonacoYamlEditor-e382457d.js → MonacoYamlEditor-816f672c.js} +3 -3
  3. package/dist/{index-3a367ae3.js → index-57b8cbed.js} +11268 -10385
  4. package/dist/refine.js +158 -130
  5. package/dist/refine.umd.cjs +9177 -8294
  6. package/dist/style.css +69 -47
  7. package/lib/src/components/Form/FormModal.d.ts +9 -0
  8. package/lib/src/components/Form/RefineFormContent.d.ts +12 -0
  9. package/lib/src/components/Form/RefineFormPage.d.ts +7 -0
  10. package/lib/src/components/Form/YamlForm.d.ts +26 -0
  11. package/lib/src/components/Form/index.d.ts +7 -4
  12. package/lib/src/components/Form/type.d.ts +17 -0
  13. package/lib/src/components/Form/useRefineForm.d.ts +10 -0
  14. package/lib/src/components/Form/useYamlForm.d.ts +49 -0
  15. package/lib/src/components/FormErrorAlert/index.d.ts +1 -0
  16. package/lib/src/components/FormWidgets/KeyValueListWidget.d.ts +6 -0
  17. package/lib/src/components/FormWidgets/MetadataForm.d.ts +2 -0
  18. package/lib/src/components/FormWidgets/NameInputWidget.d.ts +51 -0
  19. package/lib/src/components/FormWidgets/NamespaceSelectWidget.d.ts +9 -0
  20. package/lib/src/components/FormWidgets/index.d.ts +4 -0
  21. package/lib/src/components/FormWidgets/widget.d.ts +5 -0
  22. package/lib/src/components/ImageNames/index.d.ts +1 -0
  23. package/lib/src/components/KeyValue/KeyValue.d.ts +5 -5
  24. package/lib/src/components/KeyValue/KeyValueAnnotation.d.ts +6 -0
  25. package/lib/src/components/KeyValue/KeyValueSecret.d.ts +5 -0
  26. package/lib/src/components/KeyValue/index.d.ts +2 -0
  27. package/lib/src/components/ListPage/index.d.ts +0 -1
  28. package/lib/src/components/NamespacesFilter/index.d.ts +6 -2
  29. package/lib/src/components/PodSelectorTable/index.d.ts +6 -0
  30. package/lib/src/components/PortsTable/index.d.ts +7 -0
  31. package/lib/src/components/ReplicasDropdown/index.d.ts +9 -0
  32. package/lib/src/components/ResourceCRUD/list/index.d.ts +3 -7
  33. package/lib/src/components/ResourceCRUD/show/index.d.ts +3 -7
  34. package/lib/src/components/ServiceComponents/index.d.ts +4 -1
  35. package/lib/src/components/ShowContent/ShowContent.d.ts +5 -0
  36. package/lib/src/components/ShowContent/fields.d.ts +17 -11
  37. package/lib/src/components/ShowContent/groups.d.ts +11 -3
  38. package/lib/src/components/ShowContent/tabs.d.ts +1 -5
  39. package/lib/src/components/StateTag/StateTag.d.ts +1 -0
  40. package/lib/src/components/Table/TableToolBar.d.ts +1 -1
  41. package/lib/src/components/ValueDisplay/index.d.ts +8 -0
  42. package/lib/src/components/WorkloadDropdown/index.d.ts +2 -2
  43. package/lib/src/components/WorkloadReplicas/index.d.ts +11 -1
  44. package/lib/src/components/index.d.ts +2 -4
  45. package/lib/src/constants/k8s.d.ts +271 -94
  46. package/lib/src/constants/state.d.ts +2 -1
  47. package/lib/src/hooks/index.d.ts +1 -1
  48. package/lib/src/hooks/useEagleTable/columns.d.ts +4 -1
  49. package/lib/src/hooks/useOpenForm.d.ts +3 -0
  50. package/lib/src/i18n.d.ts +22 -4
  51. package/lib/src/locales/en-US/index.d.ts +4 -1
  52. package/lib/src/locales/zh-CN/index.d.ts +18 -3
  53. package/lib/src/models/daemonset-model.d.ts +3 -1
  54. package/lib/src/models/deployment-model.d.ts +1 -1
  55. package/lib/src/models/ingress-model.d.ts +5 -3
  56. package/lib/src/models/statefulset-model.d.ts +1 -1
  57. package/lib/src/pages/deployments/index.d.ts +0 -1
  58. package/lib/src/types/resource.d.ts +12 -5
  59. package/package.json +1 -1
@@ -1,5 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { YamlFormProps } from '../components';
1
3
  interface UseOpenFormOptions {
2
4
  id?: string;
5
+ renderForm?: (props: YamlFormProps) => React.ReactNode;
3
6
  }
4
7
  export declare function useOpenForm(options?: UseOpenFormOptions): () => void;
5
8
  export {};
package/lib/src/i18n.d.ts CHANGED
@@ -95,7 +95,6 @@ export declare const resources: {
95
95
  port_mapping: string;
96
96
  out_cluster_access: string;
97
97
  in_cluster_access: string;
98
- any_node_ip: string;
99
98
  fail_get_detail: string;
100
99
  basic_info: string;
101
100
  pod_selector: string;
@@ -113,6 +112,10 @@ export declare const resources: {
113
112
  path: string;
114
113
  backend: string;
115
114
  belong_to_node: string;
115
+ true: string;
116
+ false: string;
117
+ warning: string;
118
+ normal: string;
116
119
  };
117
120
  };
118
121
  'zh-CN': {
@@ -130,7 +133,9 @@ export declare const resources: {
130
133
  cancel: string;
131
134
  delete: string;
132
135
  create: string;
136
+ delete_resource: string;
133
137
  confirm_delete_text: string;
138
+ delete_tip: string;
134
139
  edit: string;
135
140
  namespace: string;
136
141
  name: string;
@@ -170,8 +175,6 @@ export declare const resources: {
170
175
  sessionAffinity: string;
171
176
  log: string;
172
177
  select_container: string;
173
- wrap: string;
174
- resume_log: string;
175
178
  log_new_lines: string;
176
179
  fetch_schema_fail: string;
177
180
  obtain_data_error: string;
@@ -208,7 +211,6 @@ export declare const resources: {
208
211
  port_mapping: string;
209
212
  out_cluster_access: string;
210
213
  in_cluster_access: string;
211
- any_node_ip: string;
212
214
  fail_get_detail: string;
213
215
  basic_info: string;
214
216
  pod: string;
@@ -223,10 +225,26 @@ export declare const resources: {
223
225
  protocol: string;
224
226
  key: string;
225
227
  value: string;
228
+ show_data_value: string;
229
+ hide_data_value: string;
226
230
  path_type: string;
227
231
  path: string;
228
232
  backend: string;
229
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;
230
248
  name_can_not_be_empty: string;
231
249
  password: string;
232
250
  username: string;
@@ -92,7 +92,6 @@ declare const _default: {
92
92
  port_mapping: string;
93
93
  out_cluster_access: string;
94
94
  in_cluster_access: string;
95
- any_node_ip: string;
96
95
  fail_get_detail: string;
97
96
  basic_info: string;
98
97
  pod_selector: string;
@@ -110,6 +109,10 @@ declare const _default: {
110
109
  path: string;
111
110
  backend: string;
112
111
  belong_to_node: string;
112
+ true: string;
113
+ false: string;
114
+ warning: string;
115
+ normal: string;
113
116
  };
114
117
  };
115
118
  export default _default;
@@ -13,7 +13,9 @@ 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;
@@ -53,8 +55,6 @@ declare const _default: {
53
55
  sessionAffinity: string;
54
56
  log: string;
55
57
  select_container: string;
56
- wrap: string;
57
- resume_log: string;
58
58
  log_new_lines: string;
59
59
  fetch_schema_fail: string;
60
60
  obtain_data_error: string;
@@ -91,7 +91,6 @@ declare const _default: {
91
91
  port_mapping: string;
92
92
  out_cluster_access: string;
93
93
  in_cluster_access: string;
94
- any_node_ip: string;
95
94
  fail_get_detail: string;
96
95
  basic_info: string;
97
96
  pod: string;
@@ -106,10 +105,26 @@ declare const _default: {
106
105
  protocol: string;
107
106
  key: string;
108
107
  value: string;
108
+ show_data_value: string;
109
+ hide_data_value: string;
109
110
  path_type: string;
110
111
  path: string;
111
112
  backend: string;
112
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;
113
128
  name_can_not_be_empty: string;
114
129
  password: string;
115
130
  username: string;
@@ -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 {};
@@ -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 {};
@@ -2,17 +2,19 @@ import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import type { Ingress } from 'kubernetes-types/networking/v1';
3
3
  import { ResourceModel } from './resource-model';
4
4
  type IngressTypes = Required<Ingress> & Unstructured;
5
- type RuleItem = {
6
- serviceName: string;
5
+ export type RuleItem = {
6
+ serviceName?: string;
7
+ resourceName?: string;
7
8
  fullPath: string;
8
9
  pathType: string;
9
10
  host?: string;
10
- servicePort?: number;
11
+ servicePort?: number | string;
11
12
  };
12
13
  export declare class IngressModel extends ResourceModel<IngressTypes> {
13
14
  _rawYaml: IngressTypes;
14
15
  _globalStore: GlobalStore;
15
16
  flattenedRules: RuleItem[];
16
17
  constructor(_rawYaml: IngressTypes, _globalStore: GlobalStore);
18
+ private getFullPath;
17
19
  }
18
20
  export {};
@@ -9,6 +9,6 @@ export declare class StatefulSetModel extends WorkloadModel {
9
9
  spec?: RequiredStatefulSet['spec'];
10
10
  status?: RequiredStatefulSet['status'];
11
11
  constructor(_rawYaml: RequiredStatefulSet, _globalStore: GlobalStore);
12
- get stateDisplay(): WorkloadState.UPDATEING | WorkloadState.READY;
12
+ get stateDisplay(): WorkloadState.UPDATING | WorkloadState.READY;
13
13
  }
14
14
  export {};
@@ -1,3 +1,2 @@
1
- export * from './create';
2
1
  export * from './list';
3
2
  export * from './show';
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { FormModalProps } from 'src/components/FormModal';
3
- import { RefineFormConfig } from '../components/RefineForm';
2
+ import { Unstructured } from 'k8s-api-provider';
3
+ import { YamlFormProps } from '../components';
4
+ import { RefineFormField } from '../components/Form';
4
5
  import { ShowConfig } from '../components/ShowContent';
5
6
  import { Column } from '../components/Table';
6
7
  import { ResourceModel } from '../models';
@@ -25,16 +26,22 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
25
26
  basePath: string;
26
27
  apiVersion: string;
27
28
  label: string;
29
+ description?: string;
28
30
  parent?: RESOURCE_GROUP;
29
31
  formatter?: (v: Model) => Model;
30
32
  initValue?: Record<string, unknown>;
31
33
  columns?: () => Column<Model>[];
34
+ noShow?: boolean;
32
35
  showConfig?: () => ShowConfig<Model>;
33
36
  Dropdown?: React.FC<{
34
37
  record: Model;
35
38
  }>;
36
- formType?: FormType;
37
- FormModal?: React.FC<FormModalProps>;
38
39
  isCustom?: boolean;
39
- formConfig?: RefineFormConfig;
40
+ formConfig?: {
41
+ fields?: RefineFormField[];
42
+ renderForm?: (props: YamlFormProps) => React.ReactNode;
43
+ formType?: FormType;
44
+ transformInitValues?: (values: Unstructured) => Unstructured;
45
+ transformApplyValues?: (values: Unstructured) => Unstructured;
46
+ };
40
47
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.32-beta.0",
3
+ "version": "0.0.33",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",