@dovetail-v2/refine 0.3.12-alpha.1 → 0.3.13-alpha.0

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.
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
+ import { ErrorContentType } from 'src/components/ErrorContent';
2
3
  export interface KeyValueProps {
3
4
  data: Record<string, string>;
4
5
  empty?: string;
5
6
  hideSecret?: boolean;
7
+ errorContent?: ErrorContentType;
6
8
  }
7
9
  export declare const KeyValue: React.FC<KeyValueProps>;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ interface LabelsAndAnnotationsShowProps {
3
+ labels: Record<string, string>;
4
+ annotations: Record<string, string>;
5
+ size?: 'small' | 'medium';
6
+ }
7
+ export declare const LabelsAndAnnotationsShow: ({ labels, annotations, size, }: LabelsAndAnnotationsShowProps) => JSX.Element;
8
+ export {};
@@ -7,6 +7,7 @@ type ResourceSelectProps = {
7
7
  namespace?: string;
8
8
  kind: string;
9
9
  value: string;
10
+ placeholder?: string;
10
11
  onChange: (value: string | string[], object: {
11
12
  object: Record<string, unknown>;
12
13
  } | {
@@ -13,13 +13,20 @@ export type ShowContentViewProps<Model extends ResourceModel> = React.PropsWithC
13
13
  canCollapseTabs?: boolean;
14
14
  hideTopBar?: boolean;
15
15
  className?: string;
16
+ size?: 'small' | 'medium';
16
17
  }>;
17
18
  type ShowGroupComponentProps = React.PropsWithChildren<{
18
19
  title: string;
19
20
  className?: string;
21
+ size?: 'small' | 'medium';
20
22
  operationEle?: React.ReactElement | null;
23
+ [key: string]: unknown;
21
24
  }>;
22
25
  export declare function ShowGroupWithTitleComponent(props: ShowGroupComponentProps): JSX.Element;
23
- export declare function BasicShowGroupComponent(props: React.PropsWithChildren<unknown>): JSX.Element;
26
+ type BasicShowGroupComponentProps = React.PropsWithChildren<{
27
+ size?: 'small' | 'medium';
28
+ [key: string]: unknown;
29
+ }>;
30
+ export declare function BasicShowGroupComponent(props: BasicShowGroupComponentProps): JSX.Element;
24
31
  export declare const ShowContentView: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(props: ShowContentViewProps<Model>) => JSX.Element | null;
25
32
  export {};
@@ -11,9 +11,9 @@ export type ShowField<Model extends ResourceModel> = {
11
11
  path: string[];
12
12
  labelWidth?: string;
13
13
  col?: number;
14
- hidden?: boolean;
15
- render?: (val: unknown, record: Model, field: ShowField<Model>) => React.ReactNode | undefined;
16
- renderContent?: (val: unknown, record: Model, field: ShowField<Model>) => React.ReactNode | undefined;
14
+ hidden?: boolean | ((record: Model) => boolean);
15
+ render?: (val: unknown, record: Model, field: ShowField<Model>, size: 'small' | 'medium') => React.ReactNode | undefined;
16
+ renderContent?: (val: unknown, record: Model, field: ShowField<Model>, size: 'small' | 'medium') => React.ReactNode | undefined;
17
17
  };
18
18
  export declare enum AreaType {
19
19
  Inline = "Inline",
@@ -31,6 +31,7 @@ export type ShowTab<Model extends ResourceModel> = {
31
31
  title: string;
32
32
  key: string;
33
33
  groups: ShowGroup<Model>[];
34
+ background?: 'white' | 'gray';
34
35
  };
35
36
  export interface ShowConfig<Model extends ResourceModel = ResourceModel> {
36
37
  basicGroup?: ShowGroup<Model>;
@@ -57,7 +58,9 @@ export declare const ClusterIpField: <Model extends ServiceModel>(i18n: I18nType
57
58
  export declare const SessionAffinityField: <Model extends ServiceModel>(i18n: I18nType) => ShowField<Model>;
58
59
  export declare const ServicePodsField: <Model extends ResourceModel<Unstructured>>() => ShowField<Model>;
59
60
  export declare const IngressRulesTableTabField: <Model extends IngressModel>() => ShowField<Model>;
60
- export declare const EventsTableTabField: <Model extends ResourceModel<Unstructured>>() => ShowField<Model>;
61
+ export declare const EventsTableTabField: <Model extends ResourceModel<Unstructured>>({ size, }: {
62
+ size?: "small" | "medium" | undefined;
63
+ }) => ShowField<Model>;
61
64
  export declare const NamespaceField: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowField<Model>;
62
65
  export declare const AgeField: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowField<Model>;
63
66
  export declare const LabelsField: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowField<Model>;
@@ -83,3 +86,4 @@ export declare const IsDefaultSCField: <Model extends StorageClassModel>(i18n: I
83
86
  export declare const SCReclaimPolicyField: <Model extends StorageClassModel>(i18n: I18nType) => ShowField<Model>;
84
87
  export declare const IsSCAllowVolumeExpansionField: <Model extends StorageClassModel>(i18n: I18nType) => ShowField<Model>;
85
88
  export declare const ResourceTableField: <Model extends ResourceModel<Unstructured>>(resource: string, useTableParams?: import("@refinedev/core").useTableProps<Model, import("@refinedev/core").HttpError, Model> | undefined) => ShowField<Model>;
89
+ export declare const PodCountOfJobField: <Model extends JobModel>(i18n: I18nType) => ShowField<Model>;
@@ -1,7 +1,7 @@
1
1
  import { i18n as I18nType } from 'i18next';
2
2
  import { Unstructured } from 'k8s-api-provider';
3
3
  import { NetworkPolicy } from 'kubernetes-types/networking/v1';
4
- import { ResourceModel, WorkloadBaseModel, ServiceModel, JobModel, CronJobModel, PodModel, IngressModel, StorageClassModel, PersistentVolumeClaimModel } from 'src/models';
4
+ import { ResourceModel, WorkloadBaseModel, ServiceModel, JobModel, CronJobModel, PodModel, StorageClassModel, PersistentVolumeClaimModel } from 'src/models';
5
5
  import { ShowField, ShowArea, ShowGroup } from './fields';
6
6
  export declare const BasicGroup: <Model extends ResourceModel<Unstructured>>(i18n: I18nType, { upAreas, downAreas, basicFields, }?: {
7
7
  upAreas?: ShowArea<Model>[] | undefined;
@@ -14,12 +14,9 @@ export declare const ServicePodsGroup: <Model extends ServiceModel>() => ShowGro
14
14
  export declare const PVCPodsGroup: <Model extends PersistentVolumeClaimModel>() => ShowGroup<Model>;
15
15
  export declare const ConditionsGroup: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowGroup<Model>;
16
16
  export declare const NodeTaintsGroup: (i18n: I18nType) => ShowGroup<ResourceModel<Node & Unstructured>>;
17
- export declare const SecretDataGroup: <Model extends ResourceModel<Unstructured>>() => ShowGroup<Model>;
18
17
  export declare const JobsGroup: <Model extends JobModel | CronJobModel>() => ShowGroup<Model>;
19
- export declare const IngressRulesGroup: <Model extends IngressModel>(i18n: I18nType) => ShowGroup<Model>;
20
18
  export declare const PodSelectorGroup: <Model extends ResourceModel<Required<Unstructured & import("kubernetes-types/core/v1").Service> | (NetworkPolicy & Unstructured)>>(i18n: I18nType) => ShowGroup<Model>;
21
19
  export declare const PortsGroup: <Model extends ServiceModel>(i18n: I18nType) => ShowGroup<Model>;
22
- export declare const DataGroup: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowGroup<Model>;
23
20
  export declare const NetworkPolicyIngressRulesGroup: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowGroup<Model>;
24
21
  export declare const NetworkPolicyEgressRulesGroup: <Model extends ResourceModel<Unstructured>>(i18n: I18nType) => ShowGroup<Model>;
25
22
  export declare const StorageClassPvGroup: <Model extends StorageClassModel>(i18n: I18nType) => ShowGroup<Model>;
@@ -1,7 +1,28 @@
1
1
  import { i18n as I18nType } from 'i18next';
2
- import { ResourceModel, PodModel } from 'src/models';
2
+ import { ResourceModel, PodModel, ServiceModel, IngressModel } from 'src/models';
3
3
  import { ShowTab } from './fields';
4
- export declare const EventsTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType) => ShowTab<Model>;
5
- export declare const ConditionsTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType) => ShowTab<Model>;
6
- export declare const LabelAnnotationsTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType) => ShowTab<Model>;
4
+ export declare const EventsTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>({ i18n, size, }: {
5
+ i18n: I18nType;
6
+ size?: "small" | "medium" | undefined;
7
+ }) => ShowTab<Model>;
8
+ export declare const ConditionsTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>({ i18n, size, }: {
9
+ i18n: I18nType;
10
+ size?: "small" | "medium" | undefined;
11
+ }) => ShowTab<Model>;
12
+ export declare const LabelAnnotationsTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>({ i18n, size, }: {
13
+ i18n: I18nType;
14
+ size?: "small" | "medium" | undefined;
15
+ }) => ShowTab<Model>;
7
16
  export declare const PodLogTab: <Model extends PodModel>(i18n: I18nType, apiUrl: string) => ShowTab<Model>;
17
+ export declare const PortsTab: <Model extends ServiceModel>({ i18n, }: {
18
+ i18n: I18nType;
19
+ }) => ShowTab<Model>;
20
+ export declare const IngressRulesTab: <Model extends IngressModel>({ i18n, }: {
21
+ i18n: I18nType;
22
+ }) => ShowTab<Model>;
23
+ export declare const DataTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>({ i18n, }: {
24
+ i18n: I18nType;
25
+ }) => ShowTab<Model>;
26
+ export declare const SecretDataTab: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>({ i18n, }: {
27
+ i18n: I18nType;
28
+ }) => ShowTab<Model>;
@@ -57,3 +57,4 @@ export * from './MatchLabelSelector';
57
57
  export * from './PortsConfigForm';
58
58
  export * from './SectionTitle';
59
59
  export * from './EditMetadataForm';
60
+ export * from './LabelsAndAnnotationsShow';
@@ -17,7 +17,7 @@ export declare const AgeColumnRenderer: <Model extends ResourceModel<import("k8s
17
17
  isRelativeTime?: boolean | undefined;
18
18
  }) => Column<Model>;
19
19
  export declare const NodeNameColumnRenderer: <Model extends PodModel>(i18n: I18nType, options?: Partial<Column<Model>> | undefined) => Column<Model>;
20
- export declare const CompletionsCountColumnRenderer: <Model extends JobModel>(i18n: I18nType) => Column<Model>;
20
+ export declare const PodCountOfJobColumnRenderer: <Model extends JobModel>(i18n: I18nType) => Column<Model>;
21
21
  export declare const DurationColumnRenderer: <Model extends JobModel | CronJobModel>(i18n: I18nType) => Column<Model>;
22
22
  export declare const ServiceTypeColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(i18n: I18nType) => Column<Model>;
23
23
  export declare function ServiceInClusterAccessTitle(): JSX.Element;
package/dist/i18n.d.ts CHANGED
@@ -109,7 +109,6 @@ export declare const resources: {
109
109
  create_failed_tip: string;
110
110
  save_failed: string;
111
111
  save_failed_tip: string;
112
- completion_num_tooltip: string;
113
112
  ready_num_tooltip: string;
114
113
  realtime_log: string;
115
114
  previous_log: string;
@@ -376,7 +375,7 @@ export declare const resources: {
376
375
  create_failed_tip: string;
377
376
  save_failed: string;
378
377
  save_failed_tip: string;
379
- completion_num_tooltip: string;
378
+ job_pod_count_tooltip: string;
380
379
  ready_num_tooltip: string;
381
380
  true: string;
382
381
  false: string;
@@ -522,6 +521,9 @@ export declare const resources: {
522
521
  all: string;
523
522
  optional_with_bracket: string;
524
523
  label_annotations: string;
524
+ target_service: string;
525
+ target_service_port: string;
526
+ select_workload: string;
525
527
  };
526
528
  };
527
529
  };
@@ -106,7 +106,6 @@ declare const _default: {
106
106
  create_failed_tip: string;
107
107
  save_failed: string;
108
108
  save_failed_tip: string;
109
- completion_num_tooltip: string;
110
109
  ready_num_tooltip: string;
111
110
  realtime_log: string;
112
111
  previous_log: string;
@@ -119,7 +119,7 @@ declare const _default: {
119
119
  create_failed_tip: string;
120
120
  save_failed: string;
121
121
  save_failed_tip: string;
122
- completion_num_tooltip: string;
122
+ job_pod_count_tooltip: string;
123
123
  ready_num_tooltip: string;
124
124
  true: string;
125
125
  false: string;
@@ -265,6 +265,9 @@ declare const _default: {
265
265
  all: string;
266
266
  optional_with_bracket: string;
267
267
  label_annotations: string;
268
+ target_service: string;
269
+ target_service_port: string;
270
+ select_workload: string;
268
271
  };
269
272
  };
270
273
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import { GlobalStore, Unstructured } from 'k8s-api-provider';
2
2
  import { CronJob } from 'kubernetes-types/batch/v1';
3
3
  import { ResourceState } from '../constants';
4
+ import { JobModel } from './job-model';
4
5
  import { WorkloadBaseModel } from './workload-base-model';
5
6
  type RequiredCronJob = Required<CronJob> & Unstructured;
6
7
  export declare class CronJobModel extends WorkloadBaseModel {
@@ -11,5 +12,6 @@ export declare class CronJobModel extends WorkloadBaseModel {
11
12
  get stateDisplay(): ResourceState.SUSPENDED | ResourceState.RUNNING;
12
13
  suspend(): RequiredCronJob;
13
14
  resume(): RequiredCronJob;
15
+ getJobsCountDisplay(jobs: JobModel[]): string;
14
16
  }
15
17
  export {};
@@ -15,6 +15,6 @@ export declare class IngressModel extends ResourceModel<IngressTypes> {
15
15
  _rawYaml: IngressTypes;
16
16
  constructor(_rawYaml: IngressTypes, _globalStore: GlobalStore);
17
17
  private getFullPath;
18
- getFlattenedRules(services: Service[]): RuleItem[];
18
+ getFlattenedRules(services?: Service[]): RuleItem[];
19
19
  }
20
20
  export {};
@@ -13,6 +13,7 @@ export declare class JobModel extends WorkloadBaseModel {
13
13
  private getRestarts;
14
14
  get duration(): number;
15
15
  get completionsDisplay(): string;
16
+ get podCountDisplay(): string;
16
17
  get succeeded(): number;
17
18
  get completions(): number | undefined;
18
19
  get stateDisplay(): ResourceState.COMPLETED | ResourceState.ABNORMAL | ResourceState.SUSPENDED | ResourceState.RUNNING;