@dovetail-v2/refine 0.1.9 → 0.1.10

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 (48) hide show
  1. package/dist/{MonacoYamlDiffEditor-0f76e977.js → MonacoYamlDiffEditor-effbc940.js} +1 -1
  2. package/dist/{index-aacb414b.js → index-a2e0edc2.js} +1435 -1163
  3. package/dist/refine.js +207 -203
  4. package/dist/refine.umd.cjs +1229 -957
  5. package/dist/style.css +44 -44
  6. package/lib/components/CreateButton/index.d.ts +5 -1
  7. package/lib/components/DropdownMenuItems/EditNodeTaintDropdownMenuItem.d.ts +12 -0
  8. package/lib/components/{CronJobDropdown → Dropdowns/CronJobDropdown}/index.d.ts +1 -1
  9. package/lib/components/{K8sDropdown → Dropdowns/K8sDropdown}/index.d.ts +1 -1
  10. package/lib/components/{PodDropdown → Dropdowns/PodDropdown}/index.d.ts +1 -1
  11. package/lib/components/{ReplicasDropdown → Dropdowns/ReplicasDropdown}/index.d.ts +1 -1
  12. package/lib/components/{WorkloadDropdown → Dropdowns/WorkloadDropdown}/index.d.ts +1 -1
  13. package/lib/components/EditField/index.d.ts +1 -1
  14. package/lib/components/EditMetadataForm/EditNodeTaintForm.d.ts +12 -0
  15. package/lib/components/InternalBaseTable/index.d.ts +43 -0
  16. package/lib/components/ListPage/index.d.ts +2 -2
  17. package/lib/components/NodeTaintsTable/NodeTaintsTable.d.ts +7 -0
  18. package/lib/components/NodeTaintsTable/index.d.ts +1 -0
  19. package/lib/components/PVCDistributeStorage/index.d.ts +1 -1
  20. package/lib/components/ResourceFiledDisplays.d.ts +2 -3
  21. package/lib/components/ResourceLink/index.d.ts +2 -2
  22. package/lib/components/ShowContent/fields.d.ts +2 -0
  23. package/lib/components/ShowContent/groups.d.ts +4 -2
  24. package/lib/components/StateTag/StateTag.d.ts +3 -3
  25. package/lib/components/Table/index.d.ts +11 -43
  26. package/lib/components/{Table/TableToolBar.d.ts → TableToolbar/index.d.ts} +1 -0
  27. package/lib/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +2 -0
  28. package/lib/components/index.d.ts +6 -5
  29. package/lib/constants/state.d.ts +8 -3
  30. package/lib/contexts/component.d.ts +1 -1
  31. package/lib/hooks/useEagleTable/columns.d.ts +2 -1
  32. package/lib/hooks/useEagleTable/useEagleTable.d.ts +3 -4
  33. package/lib/hooks/useSubmitForm.d.ts +1 -1
  34. package/lib/hooks/useTableData.d.ts +1 -1
  35. package/lib/i18n.d.ts +29 -18
  36. package/lib/locales/zh-CN/index.d.ts +29 -18
  37. package/lib/models/cronjob-model.d.ts +2 -2
  38. package/lib/models/daemonset-model.d.ts +2 -2
  39. package/lib/models/deployment-model.d.ts +2 -2
  40. package/lib/models/job-model.d.ts +2 -2
  41. package/lib/models/node-model.d.ts +2 -2
  42. package/lib/models/persistent-volume-claim.d.ts +2 -0
  43. package/lib/models/persistent-volume.d.ts +3 -0
  44. package/lib/models/statefulset-model.d.ts +2 -2
  45. package/lib/styles/tag.d.ts +1 -0
  46. package/lib/types/resource.d.ts +3 -3
  47. package/package.json +1 -1
  48. /package/lib/components/{Table → InternalBaseTable}/TableWidgets.d.ts +0 -0
package/lib/i18n.d.ts CHANGED
@@ -235,18 +235,18 @@ export declare const resources: {
235
235
  fetch_schema_fail: string;
236
236
  obtain_data_error: string;
237
237
  retry: string;
238
- ready: string;
239
- updating: string;
240
- completed: string;
241
- failed: string;
242
- suspended: string;
243
- running: string;
244
- terminating: string;
245
- succeeded: string;
246
- terminated: string;
247
- unknown: string;
248
- pending: string;
249
- waiting: string;
238
+ ready_state: string;
239
+ updating_state: string;
240
+ completed_state: string;
241
+ abnormal_state: string;
242
+ suspended_state: string;
243
+ running_state: string;
244
+ terminating_state: string;
245
+ succeeded_state: string;
246
+ terminated_state: string;
247
+ unknown_state: string;
248
+ pending_state: string;
249
+ waiting_state: string;
250
250
  create_resource: string;
251
251
  edit_resource: string;
252
252
  sec: string;
@@ -283,6 +283,7 @@ export declare const resources: {
283
283
  protocol: string;
284
284
  key: string;
285
285
  value: string;
286
+ effect: string;
286
287
  show_data_value: string;
287
288
  hide_data_value: string;
288
289
  path_type: string;
@@ -333,7 +334,7 @@ export declare const resources: {
333
334
  only_support_one_yaml: string;
334
335
  support: string;
335
336
  not_support: string;
336
- stopped: string;
337
+ stopped_state: string;
337
338
  any_node_ip: string;
338
339
  storage_class: string;
339
340
  persistent_volume: string;
@@ -344,11 +345,11 @@ export declare const resources: {
344
345
  volume_mode: string;
345
346
  access_mode: string;
346
347
  block: string;
347
- pv_phase_available: string;
348
- pv_phase_bound: string;
349
- pv_phase_released: string;
350
- pv_phase_failed: string;
351
- pv_phase_pending: string;
348
+ available_state: string;
349
+ bound_state: string;
350
+ released_state: string;
351
+ failed_state: string;
352
+ lost_state: string;
352
353
  font_size: string;
353
354
  download_shell_content: string;
354
355
  clear_shell: string;
@@ -374,6 +375,16 @@ export declare const resources: {
374
375
  edit_distribute_storage: string;
375
376
  edit_distribute_storage_success_toast: string;
376
377
  edit_distribute_storage_failed_toast: string;
378
+ edit_node_taint: string;
379
+ edit_node_taint_success_toast: string;
380
+ node_taint_NoSchedule: string;
381
+ node_taint_PreferNoSchedule: string;
382
+ node_taint_NoExecute: string;
383
+ taint: string;
384
+ change_form_mode_alert: string;
385
+ pvc_storage_required: string;
386
+ pvc_storage_min: string;
387
+ pvc_storage_reduce_limit: string;
377
388
  };
378
389
  };
379
390
  };
@@ -57,18 +57,18 @@ declare const _default: {
57
57
  fetch_schema_fail: string;
58
58
  obtain_data_error: string;
59
59
  retry: string;
60
- ready: string;
61
- updating: string;
62
- completed: string;
63
- failed: string;
64
- suspended: string;
65
- running: string;
66
- terminating: string;
67
- succeeded: string;
68
- terminated: string;
69
- unknown: string;
70
- pending: string;
71
- waiting: string;
60
+ ready_state: string;
61
+ updating_state: string;
62
+ completed_state: string;
63
+ abnormal_state: string;
64
+ suspended_state: string;
65
+ running_state: string;
66
+ terminating_state: string;
67
+ succeeded_state: string;
68
+ terminated_state: string;
69
+ unknown_state: string;
70
+ pending_state: string;
71
+ waiting_state: string;
72
72
  create_resource: string;
73
73
  edit_resource: string;
74
74
  sec: string;
@@ -105,6 +105,7 @@ declare const _default: {
105
105
  protocol: string;
106
106
  key: string;
107
107
  value: string;
108
+ effect: string;
108
109
  show_data_value: string;
109
110
  hide_data_value: string;
110
111
  path_type: string;
@@ -155,7 +156,7 @@ declare const _default: {
155
156
  only_support_one_yaml: string;
156
157
  support: string;
157
158
  not_support: string;
158
- stopped: string;
159
+ stopped_state: string;
159
160
  any_node_ip: string;
160
161
  storage_class: string;
161
162
  persistent_volume: string;
@@ -166,11 +167,11 @@ declare const _default: {
166
167
  volume_mode: string;
167
168
  access_mode: string;
168
169
  block: string;
169
- pv_phase_available: string;
170
- pv_phase_bound: string;
171
- pv_phase_released: string;
172
- pv_phase_failed: string;
173
- pv_phase_pending: string;
170
+ available_state: string;
171
+ bound_state: string;
172
+ released_state: string;
173
+ failed_state: string;
174
+ lost_state: string;
174
175
  font_size: string;
175
176
  download_shell_content: string;
176
177
  clear_shell: string;
@@ -196,6 +197,16 @@ declare const _default: {
196
197
  edit_distribute_storage: string;
197
198
  edit_distribute_storage_success_toast: string;
198
199
  edit_distribute_storage_failed_toast: string;
200
+ edit_node_taint: string;
201
+ edit_node_taint_success_toast: string;
202
+ node_taint_NoSchedule: string;
203
+ node_taint_PreferNoSchedule: string;
204
+ node_taint_NoExecute: string;
205
+ taint: string;
206
+ change_form_mode_alert: string;
207
+ pvc_storage_required: string;
208
+ pvc_storage_min: string;
209
+ pvc_storage_reduce_limit: string;
199
210
  };
200
211
  };
201
212
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import { CronJob } from 'kubernetes-types/batch/v1';
3
- import { WorkloadState } from '../constants';
3
+ import { ResourceState } from '../constants';
4
4
  import { WorkloadBaseModel } from './workload-base-model';
5
5
  type RequiredCronJob = Required<CronJob> & Unstructured;
6
6
  export declare class CronJobModel extends WorkloadBaseModel {
@@ -8,7 +8,7 @@ export declare class CronJobModel extends WorkloadBaseModel {
8
8
  spec?: RequiredCronJob['spec'];
9
9
  status?: RequiredCronJob['status'];
10
10
  constructor(_rawYaml: RequiredCronJob, _globalStore: GlobalStore);
11
- get stateDisplay(): WorkloadState.SUSPENDED | WorkloadState.RUNNING;
11
+ get stateDisplay(): ResourceState.SUSPENDED | ResourceState.RUNNING;
12
12
  suspend(): RequiredCronJob;
13
13
  resume(): RequiredCronJob;
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import { DaemonSet } from 'kubernetes-types/apps/v1';
3
- import { WorkloadState } from '../constants';
3
+ import { ResourceState } from '../constants';
4
4
  import { WorkloadModel } from './workload-model';
5
5
  type RequiredDaemonSet = Required<DaemonSet> & Unstructured;
6
6
  export declare class DaemonSetModel extends WorkloadModel {
@@ -8,7 +8,7 @@ export declare class DaemonSetModel extends WorkloadModel {
8
8
  spec?: RequiredDaemonSet['spec'];
9
9
  status?: RequiredDaemonSet['status'];
10
10
  constructor(_rawYaml: RequiredDaemonSet, _globalStore: GlobalStore);
11
- get stateDisplay(): WorkloadState.UPDATING | WorkloadState.READY;
11
+ get stateDisplay(): ResourceState.UPDATING | ResourceState.READY;
12
12
  get replicas(): number;
13
13
  get readyReplicas(): number;
14
14
  }
@@ -1,6 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import { Deployment } from 'kubernetes-types/apps/v1';
3
- import { WorkloadState } from '../constants';
3
+ import { ResourceState } from '../constants';
4
4
  import { WorkloadModel } from './workload-model';
5
5
  type RequiredDeployment = Required<Deployment> & Unstructured;
6
6
  export declare class DeploymentModel extends WorkloadModel {
@@ -8,6 +8,6 @@ export declare class DeploymentModel extends WorkloadModel {
8
8
  spec?: RequiredDeployment['spec'];
9
9
  status?: RequiredDeployment['status'];
10
10
  constructor(_rawYaml: RequiredDeployment, _globalStore: GlobalStore);
11
- get stateDisplay(): WorkloadState.UPDATING | WorkloadState.READY | WorkloadState.STOPPED;
11
+ get stateDisplay(): ResourceState.UPDATING | ResourceState.READY | ResourceState.STOPPED;
12
12
  }
13
13
  export {};
@@ -1,6 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import { Job } from 'kubernetes-types/batch/v1';
3
- import { WorkloadState } from '../constants';
3
+ import { ResourceState } from '../constants';
4
4
  import { WorkloadBaseModel } from './workload-base-model';
5
5
  type RequiredJob = Required<Job> & Unstructured;
6
6
  export declare class JobModel extends WorkloadBaseModel {
@@ -15,6 +15,6 @@ export declare class JobModel extends WorkloadBaseModel {
15
15
  get completionsDisplay(): string;
16
16
  get succeeded(): number;
17
17
  get completions(): number | undefined;
18
- get stateDisplay(): WorkloadState.COMPLETED | WorkloadState.FAILED | WorkloadState.SUSPENDED | WorkloadState.RUNNING;
18
+ get stateDisplay(): ResourceState.COMPLETED | ResourceState.ABNORMAL | ResourceState.SUSPENDED | ResourceState.RUNNING;
19
19
  }
20
20
  export {};
@@ -1,12 +1,12 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import type { Node } from 'kubernetes-types/core/v1';
3
- import { WorkloadBaseModel } from './workload-base-model';
3
+ import { ResourceModel } from './resource-model';
4
4
  type RequiredNode = Required<Node> & Unstructured;
5
5
  export declare enum NodeRole {
6
6
  ControlPlane = "Control Plane",
7
7
  Worker = "Worker"
8
8
  }
9
- export declare class NodeModel extends WorkloadBaseModel {
9
+ export declare class NodeModel extends ResourceModel {
10
10
  _rawYaml: RequiredNode;
11
11
  constructor(_rawYaml: RequiredNode, _globalStore: GlobalStore);
12
12
  get role(): NodeRole;
@@ -1,5 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import type { PersistentVolumeClaim } from 'kubernetes-types/core/v1';
3
+ import { ResourceState } from 'src/constants';
3
4
  import { ResourceModel } from './resource-model';
4
5
  type RequiredPersistentClaimVolume = Required<PersistentVolumeClaim> & Unstructured;
5
6
  export declare class PersistentVolumeClaimModel extends ResourceModel {
@@ -8,6 +9,7 @@ export declare class PersistentVolumeClaimModel extends ResourceModel {
8
9
  constructor(_rawYaml: RequiredPersistentClaimVolume, _globalStore: GlobalStore);
9
10
  get phase(): string | undefined;
10
11
  get pv(): string | undefined;
12
+ get stateDisplay(): ResourceState.FAILED | ResourceState.PENDING | ResourceState.BOUND | ResourceState.LOST | undefined;
11
13
  updateDistributeStorage(distributeStorage: number): Unstructured;
12
14
  }
13
15
  export {};
@@ -1,5 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import type { PersistentVolume } from 'kubernetes-types/core/v1';
3
+ import { ResourceState } from 'src/constants';
3
4
  import { ResourceModel } from './resource-model';
4
5
  type RequiredPersistentVolume = Required<PersistentVolume> & Unstructured;
5
6
  export declare class PersistentVolumeModel extends ResourceModel {
@@ -7,7 +8,9 @@ export declare class PersistentVolumeModel extends ResourceModel {
7
8
  spec: PersistentVolume['spec'];
8
9
  constructor(_rawYaml: RequiredPersistentVolume, _globalStore: GlobalStore);
9
10
  get phase(): string | undefined;
11
+ get stateDisplay(): ResourceState.FAILED | ResourceState.UNKNOWN | ResourceState.PENDING | ResourceState.AVAILABLE | ResourceState.BOUND | ResourceState.RELEASED;
10
12
  get csi(): string | undefined;
11
13
  get pvc(): string | undefined;
14
+ get pvcNamespace(): string | undefined;
12
15
  }
13
16
  export {};
@@ -1,6 +1,6 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import { StatefulSet } from 'kubernetes-types/apps/v1';
3
- import { WorkloadState } from '../constants';
3
+ import { ResourceState } from '../constants';
4
4
  import { WorkloadModel } from './workload-model';
5
5
  type RequiredStatefulSet = Required<StatefulSet> & Unstructured;
6
6
  export declare class StatefulSetModel extends WorkloadModel {
@@ -8,6 +8,6 @@ export declare class StatefulSetModel extends WorkloadModel {
8
8
  spec?: RequiredStatefulSet['spec'];
9
9
  status?: RequiredStatefulSet['status'];
10
10
  constructor(_rawYaml: RequiredStatefulSet, _globalStore: GlobalStore);
11
- get stateDisplay(): WorkloadState.UPDATING | WorkloadState.READY | WorkloadState.STOPPED;
11
+ get stateDisplay(): ResourceState.UPDATING | ResourceState.READY | ResourceState.STOPPED;
12
12
  }
13
13
  export {};
@@ -0,0 +1 @@
1
+ export declare const StateTagStyle: import("@linaria/core").LinariaClassName;
@@ -3,7 +3,7 @@ import { UseFormProps } from '@refinedev/react-hook-form';
3
3
  import { YamlFormProps } from '../components';
4
4
  import { RefineFormField } from '../components/Form';
5
5
  import { ShowConfig } from '../components/ShowContent';
6
- import { Column, TableProps } from '../components/Table';
6
+ import { Column, InternalTableProps } from '../components/InternalBaseTable';
7
7
  import { ResourceModel } from '../models';
8
8
  export declare enum RESOURCE_GROUP {
9
9
  WORKLOAD = "WORKLOAD",
@@ -27,7 +27,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
27
27
  kind: string;
28
28
  basePath: string;
29
29
  apiVersion: string;
30
- label: string;
30
+ displayName?: string;
31
31
  hideListToolBar?: boolean;
32
32
  hideNamespacesFilter?: boolean;
33
33
  description?: string;
@@ -40,7 +40,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
40
40
  Dropdown?: React.FC<{
41
41
  record: Model;
42
42
  }>;
43
- tableProps?: Partial<TableProps<Model>>;
43
+ tableProps?: Partial<InternalTableProps<Model>>;
44
44
  isCustom?: boolean;
45
45
  formConfig?: {
46
46
  fields?: (props: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",