@dovetail-v2/refine 0.1.8 → 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 (58) hide show
  1. package/dist/{MonacoYamlDiffEditor-1593cfad.js → MonacoYamlDiffEditor-effbc940.js} +1 -1
  2. package/dist/{index-45031697.js → index-a2e0edc2.js} +1440 -739
  3. package/dist/refine.js +216 -196
  4. package/dist/refine.umd.cjs +1239 -538
  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/Form/YamlForm.d.ts +1 -1
  16. package/lib/components/Form/useReactHookForm.d.ts +2 -1
  17. package/lib/components/Form/useYamlForm.d.ts +1 -1
  18. package/lib/components/InternalBaseTable/index.d.ts +43 -0
  19. package/lib/components/ListPage/index.d.ts +2 -2
  20. package/lib/components/NodeTaintsTable/NodeTaintsTable.d.ts +7 -0
  21. package/lib/components/NodeTaintsTable/index.d.ts +1 -0
  22. package/lib/components/PVCDistributeStorage/index.d.ts +16 -0
  23. package/lib/components/ResourceCRUD/list/index.d.ts +2 -2
  24. package/lib/components/ResourceFiledDisplays.d.ts +2 -3
  25. package/lib/components/ResourceLink/index.d.ts +2 -2
  26. package/lib/components/ResourceTable/index.d.ts +9 -0
  27. package/lib/components/ShowContent/fields.d.ts +10 -0
  28. package/lib/components/ShowContent/groups.d.ts +5 -2
  29. package/lib/components/StateTag/StateTag.d.ts +3 -3
  30. package/lib/components/Table/index.d.ts +11 -43
  31. package/lib/components/{Table/TableToolBar.d.ts → TableToolbar/index.d.ts} +1 -0
  32. package/lib/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +2 -0
  33. package/lib/components/index.d.ts +7 -5
  34. package/lib/constants/k8s.d.ts +36 -1
  35. package/lib/constants/state.d.ts +8 -3
  36. package/lib/contexts/component.d.ts +1 -1
  37. package/lib/hooks/useEagleTable/columns.d.ts +7 -1
  38. package/lib/hooks/useEagleTable/useEagleTable.d.ts +3 -3
  39. package/lib/hooks/useSubmitForm.d.ts +1 -1
  40. package/lib/hooks/useTableData.d.ts +1 -1
  41. package/lib/i18n.d.ts +41 -20
  42. package/lib/locales/en-US/index.d.ts +0 -1
  43. package/lib/locales/zh-CN/index.d.ts +41 -19
  44. package/lib/models/cronjob-model.d.ts +2 -2
  45. package/lib/models/daemonset-model.d.ts +2 -2
  46. package/lib/models/deployment-model.d.ts +2 -2
  47. package/lib/models/job-model.d.ts +2 -2
  48. package/lib/models/node-model.d.ts +2 -2
  49. package/lib/models/persistent-volume-claim.d.ts +6 -0
  50. package/lib/models/persistent-volume.d.ts +7 -0
  51. package/lib/models/statefulset-model.d.ts +2 -2
  52. package/lib/models/storage-class.d.ts +4 -0
  53. package/lib/pages/storageclasses/index.d.ts +7 -4
  54. package/lib/styles/tag.d.ts +1 -0
  55. package/lib/types/resource.d.ts +5 -6
  56. package/lib/utils/storage.d.ts +13 -0
  57. package/package.json +1 -1
  58. /package/lib/components/{Table → InternalBaseTable}/TableWidgets.d.ts +0 -0
@@ -1,8 +1,9 @@
1
- export declare enum WorkloadState {
2
- Terminated = "terminated",
1
+ export declare enum ResourceState {
2
+ TERMINATED = "terminated",
3
3
  UPDATING = "updating",
4
4
  READY = "ready",
5
5
  COMPLETED = "completed",
6
+ ABNORMAL = "abnormal",
6
7
  FAILED = "failed",
7
8
  SUSPENDED = "suspended",
8
9
  RUNNING = "running",
@@ -11,5 +12,9 @@ export declare enum WorkloadState {
11
12
  TERMINATING = "terminating",
12
13
  PENDING = "pending",
13
14
  WAITING = "waiting",
14
- STOPPED = "stopped"
15
+ STOPPED = "stopped",
16
+ AVAILABLE = "available",
17
+ BOUND = "bound",
18
+ RELEASED = "released",
19
+ LOST = "lost"
15
20
  }
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import Table from 'src/components/Table';
2
+ import Table from 'src/components/InternalBaseTable';
3
3
  import { Tabs } from 'src/components/Tabs';
4
4
  declare const ComponentContext: import("react").Context<{
5
5
  Table?: typeof Table | undefined;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { i18n as I18nType } from 'i18next';
3
- import { Column } from '../../components/Table';
3
+ import { Column } from '../../components/InternalBaseTable';
4
4
  import { JobModel, PodModel, ResourceModel, WorkloadModel, WorkloadBaseModel, CronJobModel, IngressModel, ServiceModel, DaemonSetModel, StorageClassModel, PersistentVolumeModel, PersistentVolumeClaimModel } from '../../models';
5
5
  export declare const CommonSorter: (dataIndex: string[]) => (a: unknown, b: unknown) => 0 | 1 | -1;
6
6
  export declare const NameColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType, resource?: string) => Column<Model>;
@@ -36,7 +36,13 @@ export declare const PortMappingColumnRenderer: <Model extends ServiceModel>(i18
36
36
  export declare const ProvisionerColumnRenderer: <Model extends StorageClassModel>(i18n: I18nType) => Column<Model>;
37
37
  export declare const PVCapacityColumnRenderer: <Model extends PersistentVolumeModel>(i18n: I18nType) => Column<Model>;
38
38
  export declare const PVCStorageColumnRenderer: <Model extends PersistentVolumeClaimModel>(i18n: I18nType) => Column<Model>;
39
+ export declare const PVRefColumnRenderer: <Model extends PersistentVolumeClaimModel>(i18n: I18nType) => Column<Model>;
39
40
  export declare const PVStorageClassColumnRenderer: <Model extends PersistentVolumeModel | PersistentVolumeClaimModel>(i18n: I18nType) => Column<Model>;
40
41
  export declare const PVPhaseColumnRenderer: <Model extends PersistentVolumeModel | PersistentVolumeClaimModel>(i18n: I18nType) => Column<Model>;
42
+ export declare const PVCRefColumnRenderer: <Model extends PersistentVolumeModel>(i18n: I18nType) => Column<Model>;
43
+ export declare const PVCSIRefColumnRenderer: <Model extends PersistentVolumeModel>(i18n: I18nType) => Column<Model>;
41
44
  export declare const PVVolumeModeColumnRenderer: <Model extends PersistentVolumeModel | PersistentVolumeClaimModel>(i18n: I18nType) => Column<Model>;
42
45
  export declare const PVAccessModeColumnRenderer: <Model extends PersistentVolumeModel | PersistentVolumeClaimModel>(i18n: I18nType) => Column<Model>;
46
+ export declare const IsDefaultSCColumnRenderer: <Model extends StorageClassModel>(i18n: I18nType) => Column<Model>;
47
+ export declare const SCReclaimPolicyColumnRenderer: <Model extends StorageClassModel>(i18n: I18nType) => Column<Model>;
48
+ export declare const SCAllowExpandColumnRenderer: <Model extends StorageClassModel>(i18n: I18nType) => Column<Model>;
@@ -1,12 +1,12 @@
1
1
  import { RequiredColumnProps } from '@cloudtower/eagle';
2
2
  import { useTable } from '@refinedev/core';
3
3
  import React from 'react';
4
- import { Column, TableProps } from '../../components/Table';
4
+ import { Column, InternalTableProps } from '../../components/InternalBaseTable';
5
5
  import { ResourceModel } from '../../models';
6
6
  type Params<Model extends ResourceModel> = {
7
7
  useTableParams: Parameters<typeof useTable<Model>>[0];
8
8
  columns: Column<Model>[];
9
- tableProps?: Partial<TableProps<Model>>;
9
+ tableProps?: Partial<InternalTableProps<Model>>;
10
10
  formatter?: (d: Model) => Model;
11
11
  Dropdown?: React.FC<{
12
12
  record: Model;
@@ -49,7 +49,7 @@ export declare const useEagleTable: <Model extends ResourceModel<import("k8s-api
49
49
  overtime: {
50
50
  elapsedTime?: number | undefined;
51
51
  };
52
- tableProps: TableProps<Model>;
52
+ tableProps: InternalTableProps<Model>;
53
53
  selectedKeys: string[];
54
54
  };
55
55
  export {};
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  interface UseSubmitFormOptions {
3
3
  formRef: React.MutableRefObject<{
4
- submit: () => (Promise<unknown> | undefined);
4
+ submit: () => (Promise<unknown> | boolean | undefined);
5
5
  } | null>;
6
6
  onSubmitSuccess?: () => void;
7
7
  }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CrudSorting } from '@refinedev/core';
3
- import { Column, SorterOrder } from 'src/components/Table';
3
+ import { Column, SorterOrder } from 'src/components/InternalBaseTable';
4
4
  type UseTableDataProps<Data extends {
5
5
  id: string;
6
6
  }> = {
package/lib/i18n.d.ts CHANGED
@@ -163,7 +163,6 @@ export declare const resources: {
163
163
  provisioner: string;
164
164
  file_system: string;
165
165
  capacity: string;
166
- phase: string;
167
166
  volume_mode: string;
168
167
  access_mode: string;
169
168
  block: string;
@@ -236,18 +235,18 @@ export declare const resources: {
236
235
  fetch_schema_fail: string;
237
236
  obtain_data_error: string;
238
237
  retry: string;
239
- ready: string;
240
- updating: string;
241
- completed: string;
242
- failed: string;
243
- suspended: string;
244
- running: string;
245
- terminating: string;
246
- succeeded: string;
247
- terminated: string;
248
- unknown: string;
249
- pending: string;
250
- 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;
251
250
  create_resource: string;
252
251
  edit_resource: string;
253
252
  sec: string;
@@ -284,6 +283,7 @@ export declare const resources: {
284
283
  protocol: string;
285
284
  key: string;
286
285
  value: string;
286
+ effect: string;
287
287
  show_data_value: string;
288
288
  hide_data_value: string;
289
289
  path_type: string;
@@ -332,23 +332,24 @@ export declare const resources: {
332
332
  out_cluster_lb_desc: string;
333
333
  out_external_name_desc: string;
334
334
  only_support_one_yaml: string;
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;
340
341
  provisioner: string;
341
342
  file_system: string;
342
343
  capacity: string;
343
- phase: string;
344
+ distributed: string;
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;
@@ -364,6 +365,26 @@ export declare const resources: {
364
365
  edit_label_success_toast: string;
365
366
  edit_annotation: string;
366
367
  edit_annotation_success_toast: string;
368
+ pvc: string;
369
+ pv: string;
370
+ csi: string;
371
+ retain: string;
372
+ default_sc: string;
373
+ reclaim_policy: string;
374
+ allow_expand: string;
375
+ edit_distribute_storage: string;
376
+ edit_distribute_storage_success_toast: string;
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;
367
388
  };
368
389
  };
369
390
  };
@@ -160,7 +160,6 @@ declare const _default: {
160
160
  provisioner: string;
161
161
  file_system: string;
162
162
  capacity: string;
163
- phase: string;
164
163
  volume_mode: string;
165
164
  access_mode: string;
166
165
  block: string;
@@ -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;
@@ -153,23 +154,24 @@ declare const _default: {
153
154
  out_cluster_lb_desc: string;
154
155
  out_external_name_desc: string;
155
156
  only_support_one_yaml: string;
157
+ support: string;
156
158
  not_support: string;
157
- stopped: string;
159
+ stopped_state: string;
158
160
  any_node_ip: string;
159
161
  storage_class: string;
160
162
  persistent_volume: string;
161
163
  provisioner: string;
162
164
  file_system: string;
163
165
  capacity: string;
164
- phase: string;
166
+ distributed: string;
165
167
  volume_mode: string;
166
168
  access_mode: string;
167
169
  block: string;
168
- pv_phase_available: string;
169
- pv_phase_bound: string;
170
- pv_phase_released: string;
171
- pv_phase_failed: string;
172
- pv_phase_pending: string;
170
+ available_state: string;
171
+ bound_state: string;
172
+ released_state: string;
173
+ failed_state: string;
174
+ lost_state: string;
173
175
  font_size: string;
174
176
  download_shell_content: string;
175
177
  clear_shell: string;
@@ -185,6 +187,26 @@ declare const _default: {
185
187
  edit_label_success_toast: string;
186
188
  edit_annotation: string;
187
189
  edit_annotation_success_toast: string;
190
+ pvc: string;
191
+ pv: string;
192
+ csi: string;
193
+ retain: string;
194
+ default_sc: string;
195
+ reclaim_policy: string;
196
+ allow_expand: string;
197
+ edit_distribute_storage: string;
198
+ edit_distribute_storage_success_toast: string;
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;
188
210
  };
189
211
  };
190
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,9 +1,15 @@
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 {
6
7
  _rawYaml: RequiredPersistentClaimVolume;
8
+ spec: Required<PersistentVolumeClaim>['spec'];
7
9
  constructor(_rawYaml: RequiredPersistentClaimVolume, _globalStore: GlobalStore);
10
+ get phase(): string | undefined;
11
+ get pv(): string | undefined;
12
+ get stateDisplay(): ResourceState.FAILED | ResourceState.PENDING | ResourceState.BOUND | ResourceState.LOST | undefined;
13
+ updateDistributeStorage(distributeStorage: number): Unstructured;
8
14
  }
9
15
  export {};
@@ -1,9 +1,16 @@
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 {
6
7
  _rawYaml: RequiredPersistentVolume;
8
+ spec: PersistentVolume['spec'];
7
9
  constructor(_rawYaml: RequiredPersistentVolume, _globalStore: GlobalStore);
10
+ get phase(): string | undefined;
11
+ get stateDisplay(): ResourceState.FAILED | ResourceState.UNKNOWN | ResourceState.PENDING | ResourceState.AVAILABLE | ResourceState.BOUND | ResourceState.RELEASED;
12
+ get csi(): string | undefined;
13
+ get pvc(): string | undefined;
14
+ get pvcNamespace(): string | undefined;
8
15
  }
9
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 {};
@@ -1,4 +1,5 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
+ import type { PersistentVolume } from 'kubernetes-types/core/v1';
2
3
  import type { StorageClass } from 'kubernetes-types/storage/v1';
3
4
  import { PersistentVolumeModel } from './persistent-volume';
4
5
  import { ResourceModel } from './resource-model';
@@ -8,5 +9,8 @@ export declare class StorageClassModel extends ResourceModel {
8
9
  pvs: PersistentVolumeModel[];
9
10
  constructor(_rawYaml: RequiredStorageClass, _globalStore: GlobalStore);
10
11
  init(): Promise<void>;
12
+ filterPV(pv: PersistentVolume | PersistentVolumeModel, scName?: string): boolean;
13
+ get isDefaultSC(): string | undefined;
14
+ get reclaimPolicy(): string;
11
15
  }
12
16
  export {};
@@ -12,9 +12,12 @@ export declare const StorageClassConfig: (i18n: I18n) => {
12
12
  kind: string;
13
13
  metadata: {
14
14
  name: string;
15
- namespace: string;
16
15
  };
17
- spec: {};
16
+ parameters: {};
17
+ provisioner: string;
18
+ reclaimPolicy: string;
19
+ allowVolumeExpansion: boolean;
20
+ volumeBindingMode: string;
18
21
  };
19
22
  formConfig: {
20
23
  fields?: ((props: {
@@ -25,8 +28,8 @@ export declare const StorageClassConfig: (i18n: I18n) => {
25
28
  saveButtonText?: string | undefined;
26
29
  renderForm?: ((props: import("../../components").YamlFormProps) => import("react").ReactNode) | undefined;
27
30
  formType?: import("src/types").FormType | undefined;
28
- transformInitValues?: ((values: import("k8s-api-provider").Unstructured) => import("k8s-api-provider").Unstructured) | undefined;
29
- transformApplyValues?: ((values: import("k8s-api-provider").Unstructured) => import("k8s-api-provider").Unstructured) | undefined;
31
+ transformInitValues?: ((values: Record<string, unknown>) => Record<string, unknown>) | undefined;
32
+ transformApplyValues?: ((values: Record<string, unknown>) => import("k8s-api-provider").Unstructured) | undefined;
30
33
  formTitle?: string | ((action: "create" | "edit") => string) | undefined;
31
34
  formDesc?: string | ((action: "create" | "edit") => string) | undefined;
32
35
  formatError?: ((errorBody: unknown) => string) | undefined;
@@ -0,0 +1 @@
1
+ export declare const StateTagStyle: import("@linaria/core").LinariaClassName;
@@ -1,10 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { UseFormProps } from '@refinedev/react-hook-form';
3
- import { Unstructured } from 'k8s-api-provider';
4
3
  import { YamlFormProps } from '../components';
5
4
  import { RefineFormField } from '../components/Form';
6
5
  import { ShowConfig } from '../components/ShowContent';
7
- import { Column, TableProps } from '../components/Table';
6
+ import { Column, InternalTableProps } from '../components/InternalBaseTable';
8
7
  import { ResourceModel } from '../models';
9
8
  export declare enum RESOURCE_GROUP {
10
9
  WORKLOAD = "WORKLOAD",
@@ -28,7 +27,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
28
27
  kind: string;
29
28
  basePath: string;
30
29
  apiVersion: string;
31
- label: string;
30
+ displayName?: string;
32
31
  hideListToolBar?: boolean;
33
32
  hideNamespacesFilter?: boolean;
34
33
  description?: string;
@@ -41,7 +40,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
41
40
  Dropdown?: React.FC<{
42
41
  record: Model;
43
42
  }>;
44
- tableProps?: Partial<TableProps<Model>>;
43
+ tableProps?: Partial<InternalTableProps<Model>>;
45
44
  isCustom?: boolean;
46
45
  formConfig?: {
47
46
  fields?: (props: {
@@ -52,8 +51,8 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
52
51
  saveButtonText?: string;
53
52
  renderForm?: (props: YamlFormProps) => React.ReactNode;
54
53
  formType?: FormType;
55
- transformInitValues?: (values: Unstructured) => Unstructured;
56
- transformApplyValues?: (values: Unstructured) => Unstructured;
54
+ transformInitValues?: (values: Record<string, unknown>) => Record<string, unknown>;
55
+ transformApplyValues?: (values: Record<string, unknown>) => Model['_rawYaml'];
57
56
  formTitle?: string | ((action: 'create' | 'edit') => string);
58
57
  formDesc?: string | ((action: 'create' | 'edit') => string);
59
58
  formatError?: (errorBody: unknown) => string;
@@ -0,0 +1,13 @@
1
+ export declare enum StorageUnit {
2
+ Pi = "Pi",
3
+ PiB = "PiB",
4
+ Ti = "Ti",
5
+ TiB = "TiB",
6
+ Gi = "Gi",
7
+ GiB = "GiB",
8
+ Mi = "Mi",
9
+ MiB = "MiB",
10
+ Ki = "Ki",
11
+ KiB = "KiB"
12
+ }
13
+ export declare function transformStorageUnit(value: string, toUnit?: StorageUnit): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",