@dovetail-v2/refine 0.0.12 → 0.0.14

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,4 +1,6 @@
1
1
  import { ResourceProps } from '@refinedev/core';
2
+ import { History } from 'history';
3
+ import { GlobalStoreInitParams } from 'k8s-api-provider';
2
4
  import React from 'react';
3
5
  import './i18n';
4
6
  import './styles.css';
@@ -8,9 +10,11 @@ import { ResourceConfig } from './types';
8
10
  type Props = {
9
11
  resourcesConfig: ResourceConfig[];
10
12
  useHashUrl?: boolean;
11
- urlPrefix: string;
13
+ urlPrefix?: string;
12
14
  refineResources?: ResourceProps[];
13
15
  Layout?: React.FC<unknown>;
16
+ history: History;
17
+ globalStoreParams: GlobalStoreInitParams;
14
18
  };
15
19
  export declare const Dovetail: React.FC<Props>;
16
20
  export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ type Props = {};
3
+ export declare const EventsTable: React.FC<Props>;
4
+ export {};
@@ -0,0 +1 @@
1
+ export * from './EventsTable';
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import { PodModel } from '../../model';
3
+ import '@patternfly/react-core/dist/styles/base-no-reset.css';
4
+ export declare const PodLog: React.FC<{
5
+ pod: PodModel;
6
+ }>;
@@ -9,9 +9,13 @@ export type ShowField<Model extends ResourceModel> = {
9
9
  };
10
10
  export declare const ImageField: (i18n: i18n) => ShowField<WorkloadModel>;
11
11
  export declare const ReplicaField: (i18n: i18n) => ShowField<WorkloadModel>;
12
- export declare const ConditionsField: (i18n: i18n) => ShowField<WorkloadModel>;
12
+ export declare const ConditionsField: (i18n: i18n) => ShowField<ResourceModel>;
13
13
  export declare const PodsField: (_: i18n) => ShowField<WorkloadModel>;
14
14
  export declare const JobsField: (_: i18n) => ShowField<WorkloadModel>;
15
15
  export declare const DataField: (i18n: i18n) => ShowField<ResourceModel>;
16
16
  export declare const SecretDataField: (i18n: i18n) => ShowField<ResourceModel>;
17
17
  export declare const StartTimeField: (i18n: i18n) => ShowField<JobModel>;
18
+ export declare const ServiceTypeField: (i18n: i18n) => ShowField<ResourceModel>;
19
+ export declare const ClusterIpField: (i18n: i18n) => ShowField<ResourceModel>;
20
+ export declare const SessionAffinityField: (i18n: i18n) => ShowField<ResourceModel>;
21
+ export declare const ServicePodsField: (_: i18n) => ShowField<ResourceModel>;
@@ -9,7 +9,7 @@ type Props = {
9
9
  onChange?: (val: string) => void;
10
10
  onValidate?: (valid: boolean, schemaValid: boolean) => void;
11
11
  isScrollOnFocus?: boolean;
12
- onEditorCreate?: (editor: monaco.editor.ICodeEditor) => void;
12
+ onEditorCreate?: (editor: monaco.editor.IStandaloneCodeEditor) => void;
13
13
  onBlur?: () => void;
14
14
  getInstance?: (ins: monaco.editor.IStandaloneCodeEditor) => void;
15
15
  schema?: JSONSchema7;
@@ -15,12 +15,13 @@ export type YamlEditorProps = {
15
15
  readOnly?: boolean;
16
16
  onChange?: (value: string) => void;
17
17
  onValidate?: (valid: boolean, schemaValid: boolean) => void;
18
- onEditorCreate?: (editor: monaco.editor.ICodeEditor) => void;
18
+ onEditorCreate?: (editor: monaco.editor.IStandaloneCodeEditor) => void;
19
19
  onBlur?: () => void;
20
20
  };
21
21
  export type YamlEditorHandle = {
22
22
  setValue: (value: string) => void;
23
23
  setEditorValue: (value: string) => void;
24
24
  getEditorValue: () => string;
25
+ getEditorInstance: () => monaco.editor.IStandaloneCodeEditor | null;
25
26
  };
26
27
  export declare const YamlEditorComponent: React.ForwardRefExoticComponent<YamlEditorProps & React.RefAttributes<YamlEditorHandle>>;
@@ -31,3 +31,4 @@ export * from './Table';
31
31
  export * from './EditButton';
32
32
  export * from './NamespacesFilter';
33
33
  export * from './Tags';
34
+ export * from './PodLog';
@@ -2,8 +2,13 @@ import { HttpError, BaseRecord, UseFormReturnType as UseFormReturnTypeCore, UseF
2
2
  import { ButtonProps } from 'antd/lib/button';
3
3
  import { FormInstance, FormProps } from 'antd/lib/form';
4
4
  import { JSONSchema7 } from 'json-schema';
5
+ import { Unstructured } from 'k8s-api-provider';
5
6
  import React from 'react';
6
- import { type YamlEditorHandle } from 'src/components/YamlEditor';
7
+ import { type YamlEditorHandle, type YamlEditorProps } from 'src/components/YamlEditor';
8
+ type EditorProps = Omit<YamlEditorProps, 'schema'> & {
9
+ ref: React.RefObject<YamlEditorHandle>;
10
+ schema: JSONSchema7 | null;
11
+ };
7
12
  export type UseFormProps<TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables extends object = object, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError> = UseFormPropsCore<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError> & {
8
13
  submitOnEnter?: boolean;
9
14
  /**
@@ -20,20 +25,17 @@ export type UseFormReturnType<TQueryFnData extends BaseRecord = BaseRecord, TErr
20
25
  saveButtonProps: ButtonProps & {
21
26
  onClick: () => void;
22
27
  };
23
- editorProps: {
24
- ref: React.RefObject<YamlEditorHandle>;
25
- defaultValue: string;
26
- schema: JSONSchema7 | null;
27
- id: string;
28
- };
28
+ editorProps: EditorProps;
29
29
  enableEditor: boolean;
30
30
  errorResponseBody?: Record<string, unknown> | null;
31
31
  switchEditor: () => void;
32
32
  onFinish: (values?: TVariables) => Promise<CreateResponse<TResponse> | UpdateResponse<TResponse> | void>;
33
33
  };
34
- declare const useEagleForm: <TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables extends {
34
+ declare const useEagleForm: <TQueryFnData extends Unstructured = Unstructured & {
35
+ id: string;
36
+ }, TError extends HttpError = HttpError, TVariables extends {
35
37
  [prop: string]: unknown;
36
38
  } = {
37
39
  [prop: string]: unknown;
38
- }, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError>({ action, resource, onMutationSuccess: onMutationSuccessProp, onMutationError, submitOnEnter, warnWhenUnsavedChanges: warnWhenUnsavedChangesProp, redirect, successNotification, errorNotification, meta, metaData, queryMeta, mutationMeta, liveMode, liveParams, mutationMode, dataProviderName, onLiveEvent, invalidates, undoableTimeout, queryOptions, createMutationOptions, updateMutationOptions, id: idFromProps, overtimeOptions, editorOptions, }?: UseFormProps<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>) => UseFormReturnType<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>;
40
+ }, TData extends Unstructured = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError>({ action, resource, onMutationSuccess: onMutationSuccessProp, onMutationError, submitOnEnter, warnWhenUnsavedChanges: warnWhenUnsavedChangesProp, redirect, successNotification, errorNotification, meta, metaData, queryMeta, mutationMeta, liveMode, liveParams, mutationMode, dataProviderName, onLiveEvent, invalidates, undoableTimeout, queryOptions, createMutationOptions, updateMutationOptions, id: idFromProps, overtimeOptions, editorOptions, }?: UseFormProps<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>) => UseFormReturnType<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>;
39
41
  export default useEagleForm;
@@ -13,3 +13,4 @@ export declare const NodeNameColumnRenderer: <Model extends PodModel>(i18n: i18n
13
13
  export declare const RestartCountColumnRenderer: <Model extends PodModel>(i18n: i18n) => Column<Model>;
14
14
  export declare const CompletionsCountColumnRenderer: <Model extends JobModel>(i18n: i18n) => Column<Model>;
15
15
  export declare const DurationColumnRenderer: <Model extends JobModel>(i18n: i18n) => Column<Model>;
16
+ export declare const ServiceTypeColumnRenderer: <Model extends ResourceModel>(i18n: i18n) => Column<Model>;
@@ -0,0 +1,5 @@
1
+ import * as monaco from 'monaco-editor';
2
+ declare function useK8sYamlEditor(): {
3
+ fold: (editor: monaco.editor.IStandaloneCodeEditor) => Promise<void>;
4
+ };
5
+ export default useK8sYamlEditor;
package/lib/src/i18n.d.ts CHANGED
@@ -42,6 +42,10 @@ export declare const resources: {
42
42
  label: string;
43
43
  annotation: string;
44
44
  type: string;
45
+ event: string;
46
+ reason: string;
47
+ object: string;
48
+ note: string;
45
49
  condition: string;
46
50
  download_yaml: string;
47
51
  detail: string;
@@ -66,6 +70,16 @@ export declare const resources: {
66
70
  data: string;
67
71
  suspend: string;
68
72
  resume: string;
73
+ cluster: string;
74
+ storage: string;
75
+ network: string;
76
+ clusterIp: string;
77
+ sessionAffinity: string;
78
+ log: string;
79
+ select_container: string;
80
+ wrap: string;
81
+ resume_log: string;
82
+ log_new_lines: string;
69
83
  };
70
84
  };
71
85
  };
@@ -26,6 +26,10 @@ declare const _default: {
26
26
  label: string;
27
27
  annotation: string;
28
28
  type: string;
29
+ event: string;
30
+ reason: string;
31
+ object: string;
32
+ note: string;
29
33
  condition: string;
30
34
  download_yaml: string;
31
35
  detail: string;
@@ -50,6 +54,16 @@ declare const _default: {
50
54
  data: string;
51
55
  suspend: string;
52
56
  resume: string;
57
+ cluster: string;
58
+ storage: string;
59
+ network: string;
60
+ clusterIp: string;
61
+ sessionAffinity: string;
62
+ log: string;
63
+ select_container: string;
64
+ wrap: string;
65
+ resume_log: string;
66
+ log_new_lines: string;
53
67
  };
54
68
  };
55
69
  export default _default;
@@ -0,0 +1,3 @@
1
+ import { ResourceModel } from '../../model';
2
+ import { Resource, ResourceConfig } from '../../types';
3
+ export declare const ServicesConfig: ResourceConfig<Resource, ResourceModel>;
@@ -6,7 +6,9 @@ import { Column } from '../components/Table';
6
6
  import { ResourceModel } from '../model';
7
7
  export declare enum RESOURCE_GROUP {
8
8
  WORKLOAD = "WORKLOAD",
9
- CORE = "CORE"
9
+ STORAGE = "STORAGE",
10
+ NETWORK = "NETWORK",
11
+ CLUSTER = "CLUSTER"
10
12
  }
11
13
  export type WithId<T> = T & {
12
14
  id: string;
@@ -0,0 +1,3 @@
1
+ import { LabelSelector } from 'kubernetes-types/meta/v1';
2
+ import { PodModel } from 'src/model';
3
+ export declare function matchSelector(pod: PodModel, selector: LabelSelector): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dovetail-v2/refine",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -12,13 +12,15 @@
12
12
  "dependencies": {
13
13
  "@cloudtower/eagle": "^0.26.11",
14
14
  "@cloudtower/icons-react": "^0.26.11",
15
+ "@patternfly/react-core": "^5.1.1",
16
+ "@patternfly/react-log-viewer": "^5.0.0",
15
17
  "@refinedev/core": "^4.38.0",
16
18
  "@refinedev/inferencer": "^4.5.4",
17
19
  "antd": "4.5.0",
18
20
  "dayjs": "^1.11.10",
19
- "i18next": "^20.1.0",
21
+ "i18next": "^23.2.3",
20
22
  "js-yaml": "^4.1.0",
21
- "k8s-api-provider": "^0.0.6",
23
+ "k8s-api-provider": "^0.0.9",
22
24
  "ky": "^0.33.3",
23
25
  "lodash-es": "^4.17.21",
24
26
  "mitt": "^3.0.1",
@@ -54,14 +56,15 @@
54
56
  "eslint-plugin-react-hooks": "^4.6.0",
55
57
  "eslint-plugin-react-refresh": "^0.3.4",
56
58
  "kubernetes-types": "^1.26.0",
57
- "vite": "^3.2.7"
59
+ "vite": "^3.2.7",
60
+ "vite-plugin-commonjs": "^0.10.0"
58
61
  },
59
62
  "peerDependencies": {
60
63
  "@cloudtower/eagle": "^0.26.9",
61
64
  "@cloudtower/icons-react": "^0.26.9",
62
65
  "@refinedev/core": "^4.38.0",
63
66
  "antd": "4.5.0",
64
- "i18next": "^20.1.0",
67
+ "i18next": "^23.2.3",
65
68
  "react": "^16.12.0",
66
69
  "react-dom": "^16.12.0",
67
70
  "react-router-dom": "^5.1.2"