@dovetail-v2/refine 0.0.16 → 0.0.17
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.
- package/dist/{MonacoYamlDiffEditor.4fe9fad1.js → MonacoYamlDiffEditor.dc83b657.js} +1 -1
- package/dist/{index.8dfa48ab.js → index.d48047e6.js} +4471 -2658
- package/dist/refine.js +44 -35
- package/dist/refine.umd.cjs +4385 -2572
- package/dist/style.css +16 -15
- package/lib/src/Dovetail.d.ts +2 -2
- package/lib/src/components/EditField/index.d.ts +15 -0
- package/lib/src/components/FormErrorAlert/index.d.ts +8 -0
- package/lib/src/components/FormLayout/index.d.ts +5 -1
- package/lib/src/components/FormModal/index.d.ts +12 -0
- package/lib/src/components/ModalContextProvider/index.d.ts +12 -0
- package/lib/src/components/ResourceCRUD/ResourceCRUD.d.ts +3 -3
- package/lib/src/components/StateTag/StateTag.d.ts +2 -1
- package/lib/src/components/Table/index.d.ts +3 -2
- package/lib/src/components/WorkloadDropdown/index.d.ts +2 -0
- package/lib/src/components/YamlForm/index.d.ts +12 -3
- package/lib/src/components/index.d.ts +1 -0
- package/lib/src/constants/index.d.ts +1 -0
- package/lib/src/constants/state.d.ts +13 -0
- package/lib/src/contexts/configs.d.ts +4 -0
- package/lib/src/contexts/index.d.ts +2 -0
- package/lib/src/hooks/useEagleForm.d.ts +2 -1
- package/lib/src/hooks/useEagleTable/columns.d.ts +2 -2
- package/lib/src/hooks/useModal.d.ts +0 -0
- package/lib/src/hooks/useOpenForm.d.ts +5 -0
- package/lib/src/hooks/useSubmitForm.d.ts +13 -0
- package/lib/src/i18n.d.ts +15 -1
- package/lib/src/index.d.ts +1 -0
- package/lib/src/locales/en-US/index.d.ts +2 -0
- package/lib/src/locales/zh-CN/index.d.ts +13 -1
- package/lib/src/models/cronjob-model.d.ts +2 -0
- package/lib/src/models/daemonset-model.d.ts +14 -0
- package/lib/src/models/deployment-model.d.ts +14 -0
- package/lib/src/models/index.d.ts +3 -0
- package/lib/src/models/job-model.d.ts +2 -0
- package/lib/src/models/pod-model.d.ts +1 -0
- package/lib/src/models/statefulset-model.d.ts +14 -0
- package/lib/src/pages/deployments/create/index.d.ts +2 -2
- package/lib/src/types/resource.d.ts +7 -0
- package/lib/src/utils/form.d.ts +3 -0
- package/package.json +4 -4
package/dist/style.css
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
.m1u1f5zp{color:#bec1d2;}
|
|
2
2
|
.m8ychfk{margin-right:8px;}
|
|
3
3
|
.p1o004do{margin-left:8px;}
|
|
4
|
-
.
|
|
5
|
-
.
|
|
6
|
-
.
|
|
7
|
-
.
|
|
8
|
-
.
|
|
9
|
-
.t1v3ienx{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:100%;margin-bottom:16px;}
|
|
10
|
-
.c16agr8o{width:100%;}
|
|
11
|
-
.c1dicff8{width:100%;}
|
|
4
|
+
.egn3dbn{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;}
|
|
5
|
+
.e136jgy8{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.e136jgy8 .title{margin-bottom:8px;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-image:linear-gradient(211.41deg,#929dad 0%,#d3dbe3 100%);}
|
|
6
|
+
.w1akirqw{height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
7
|
+
.t30srnq{line-height:32px !important;}
|
|
8
|
+
.s1bsn3us{width:1px;height:16px;border-radius:1px;background:rgba(172,186,211,0.6);}
|
|
12
9
|
.t1joof7s{width:100%;padding:11px;border-bottom:1px solid rgba(211,218,235,0.6);background:rgba(225,230,241,0.6);border-top-left-radius:8px;border-top-right-radius:8px;}.t1joof7s.collapsed{border-bottom:0;}.t1joof7s svg{margin:auto;}.t1joof7s > .dovetail-ant-space-item{line-height:16px;}
|
|
13
10
|
.tti58uh{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;width:100%;height:20px;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}.tti58uh .ant-space-item{line-height:1;}
|
|
14
11
|
.e15yt16p{margin-top:1px;}
|
|
@@ -20,20 +17,24 @@
|
|
|
20
17
|
.eh2qjnl{color:#f0483e;font-size:12px;line-height:18px;word-break:break-all;}
|
|
21
18
|
.e19q2bnp{margin-top:8px;}
|
|
22
19
|
.y16u5v3w .monaco-editor{border-bottom-left-radius:8px;border-bottom-right-radius:8px;}.y16u5v3w .monaco-editor .margin{border-bottom-left-radius:8px;}.y16u5v3w .monaco-editor .monaco-scrollable-element{border-bottom-right-radius:8px;}
|
|
20
|
+
|
|
21
|
+
.e1tqaxpu{-webkit-flex:1;-ms-flex:1;flex:1;height:100%;margin-bottom:16px;}
|
|
22
|
+
.fbinl28.ant-modal.fullscreen .ant-modal-header{padding:60px 128px 32px 128px;}.fbinl28.ant-modal.fullscreen .ant-modal-body{padding:0 128px;}.fbinl28.ant-modal.fullscreen .ant-modal-footer{padding:15px 128px;}
|
|
23
|
+
.b142d7q8{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}.b142d7q8 .breadcrumb-item:not(:last-of-type):after{content:'>';margin:0 8px;}
|
|
24
|
+
.eckm4od{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;}
|
|
25
|
+
.e1hl982n{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.e1hl982n .title{margin-bottom:8px;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-image:linear-gradient(211.41deg,#929dad 0%,#d3dbe3 100%);}
|
|
26
|
+
.ax1qopv{position:absolute;top:0;left:0;bottom:0;width:1px;background:$blue-60;-webkit-transform:translateX(-9999px);-ms-transform:translateX(-9999px);transform:translateX(-9999px);z-index:999;}.ax1qopv::before{content:'';position:absolute;height:34px;width:3px;top:0;left:-1px;background:$blue-60;}
|
|
27
|
+
.t1upn1sz{width:100%;border-top:1px solid rgba(211,218,235,0.6);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.t1upn1sz .ant-table-pagination{display:none;}.t1upn1sz .table-container{min-height:0;}
|
|
28
|
+
.t1v3ienx{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:100%;margin-bottom:16px;}
|
|
29
|
+
.c16agr8o{width:100%;}
|
|
30
|
+
.c1dicff8{width:100%;}
|
|
23
31
|
.t13a6vox{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;max-width:100%;}
|
|
24
32
|
.t12ikbmp{max-width:256px;overflow:hidden;text-overflow:ellipsis;}
|
|
25
33
|
.t9agep2{-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;width:100%;}
|
|
26
34
|
.so89gfi{width:100%;overflow:auto;height:100%;width:100%;}
|
|
27
35
|
.e1ohe42f{margin-top:16px;}
|
|
28
|
-
.w1akirqw{height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
29
|
-
.t30srnq{line-height:32px !important;}
|
|
30
36
|
.laykzsq{width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}
|
|
31
37
|
.t1ng0psc.table-wrapper{height:auto;-webkit-flex-shrink:1;-ms-flex-negative:1;flex-shrink:1;min-height:0;}
|
|
32
|
-
.egn3dbn{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:100%;}
|
|
33
|
-
.e136jgy8{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.e136jgy8 .title{margin-bottom:8px;background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-image:linear-gradient(211.41deg,#929dad 0%,#d3dbe3 100%);}
|
|
34
|
-
.s1bsn3us{width:1px;height:16px;border-radius:1px;background:rgba(172,186,211,0.6);}
|
|
35
|
-
.f5ks0bl{height:100%;}
|
|
36
|
-
.e1tqaxpu{-webkit-flex:1;-ms-flex:1;flex:1;height:100%;}
|
|
37
38
|
.wfg6u6g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.wfg6u6g .usage-text{width:50px;text-align:right;}.wfg6u6g .usage-bar{height:12px;width:100px;position:relative;border-radius:2px;}.wfg6u6g .request-anchor{position:absolute;left:10%;top:-3px;height:18px;width:2px;background:#777;z-index:9;}.wfg6u6g .usage-fill-bar{position:absolute;left:0;top:0;height:100%;background:rgba(0,128,255,0.6);z-index:7;}.wfg6u6g .request-bar{position:absolute;left:0;top:0;height:100%;background:#d8deeb;z-index:5;}.wfg6u6g .request-to-limit-bar{position:absolute;right:0;top:0;height:100%;background:#d8deeb;z-index:5;}.wfg6u6g .request-to-limit-bar.no-limit{background:linear-gradient(to right,#d8deeb 50%,#d8deeb 50%);background-size:4px 100%;}.wfg6u6g .request-to-limit-bar.no-limit.exceed-request{background:linear-gradient(to right,#d8deeb 50%,rgba(0,128,255,0.6) 50%);background-size:4px 100%;}
|
|
38
39
|
.mdppgn0.ant-menu{background:#edf0f7;padding:8px;}.mdppgn0.ant-menu .ant-menu-item-selected{background:linear-gradient(90deg,#0080ff,#005ed1);border-radius:6px;box-shadow:0 1px 2px rgba(184,192,204,0.6);color:#fff;}.mdppgn0.ant-menu .ant-menu-item-selected a:hover{color:#fff;}.mdppgn0.ant-menu .ant-menu-item:not(.ant-menu-item-selected):hover{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0.6));border-radius:6px;box-shadow:0 0 4px rgba(235,239,245,0.6),0 8px 16px rgba(129,138,153,0.18);}
|
|
39
40
|
.h16z07g.ant-layout-header{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:#fff;border-bottom:2px solid #edf0f7;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;height:50px;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;padding:0 24px 0 14px;position:relative;z-index:10;}
|
package/lib/src/Dovetail.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResourceProps } from '@refinedev/core';
|
|
2
2
|
import { History } from 'history';
|
|
3
|
-
import {
|
|
3
|
+
import { GlobalStore } from 'k8s-api-provider';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import './i18n';
|
|
6
6
|
import './styles.css';
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
refineResources?: ResourceProps[];
|
|
13
13
|
Layout?: React.FC<unknown>;
|
|
14
14
|
history: History;
|
|
15
|
-
|
|
15
|
+
globalStore: GlobalStore;
|
|
16
16
|
};
|
|
17
17
|
export declare const Dovetail: React.FC<Props>;
|
|
18
18
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface EditFieldModalProps {
|
|
3
|
+
title?: string;
|
|
4
|
+
submitting?: boolean;
|
|
5
|
+
errorMsgs?: string[];
|
|
6
|
+
formRef: React.MutableRefObject<{
|
|
7
|
+
submit: () => (Promise<unknown> | undefined);
|
|
8
|
+
} | null>;
|
|
9
|
+
renderContent: () => React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function EditFieldModal(props: EditFieldModalProps): JSX.Element;
|
|
12
|
+
export interface EditField {
|
|
13
|
+
modalProps: EditFieldModalProps;
|
|
14
|
+
}
|
|
15
|
+
export declare function EditField(props: EditField): JSX.Element;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { ButtonProps } from '@cloudtower/eagle';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
+
type FormLayoutProps = {
|
|
4
|
+
saveButtonProps?: ButtonProps;
|
|
5
|
+
};
|
|
6
|
+
declare function FormLayout(props: React.PropsWithChildren<FormLayoutProps>): JSX.Element;
|
|
3
7
|
export default FormLayout;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { YamlFormProps, YamlFormHandler } from 'src/components/YamlForm';
|
|
3
|
+
export type FormModalProps = {
|
|
4
|
+
resource?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
formProps?: YamlFormProps;
|
|
7
|
+
renderForm?: (props: YamlFormProps & {
|
|
8
|
+
ref: React.MutableRefObject<YamlFormHandler | null>;
|
|
9
|
+
}) => React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function FormModal(props: FormModalProps): JSX.Element;
|
|
12
|
+
export default FormModal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface ModalInfo {
|
|
3
|
+
resource: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
}
|
|
6
|
+
type ModalContextValue = ModalInfo & {
|
|
7
|
+
open: (info: ModalInfo) => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const ModalContext: React.Context<ModalContextValue>;
|
|
11
|
+
declare function ModalContextProvider(props: React.PropsWithChildren<Record<string, unknown>>): JSX.Element;
|
|
12
|
+
export default ModalContextProvider;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
import { ResourceConfig } from '
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ResourceConfig } from 'src/types';
|
|
3
3
|
type Props = {
|
|
4
4
|
configs: ResourceConfig[];
|
|
5
5
|
urlPrefix?: string;
|
|
6
6
|
};
|
|
7
|
-
export declare
|
|
7
|
+
export declare function ResourceCRUD(props: Props): JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { TableProps as BaseTableProps } from '@cloudtower/eagle';
|
|
2
|
-
import { RequiredColumnProps } from '@cloudtower/eagle/dist/spec/base';
|
|
1
|
+
import { TableProps as BaseTableProps, RequiredColumnProps } from '@cloudtower/eagle';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { FormType } from 'src/types';
|
|
4
4
|
import { ResourceModel } from '../../models';
|
|
5
5
|
export type IDObject = {
|
|
6
6
|
id: string;
|
|
@@ -26,6 +26,7 @@ export type TableProps<Data extends ResourceModel> = {
|
|
|
26
26
|
onSizeChange?: (size: number) => void;
|
|
27
27
|
RowMenu?: React.FC<{
|
|
28
28
|
record: Data;
|
|
29
|
+
formType?: FormType;
|
|
29
30
|
}>;
|
|
30
31
|
};
|
|
31
32
|
declare function Table<Data extends ResourceModel>(props: TableProps<Data>): JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { FormType } from 'src/types';
|
|
2
3
|
import { WorkloadModel } from '../../models';
|
|
3
4
|
type Props<Model extends WorkloadModel> = {
|
|
4
5
|
record: Model;
|
|
6
|
+
formType?: FormType;
|
|
5
7
|
};
|
|
6
8
|
export declare function WorkloadDropdown<Model extends WorkloadModel>(props: Props<Model>): JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
export declare enum SchemaStrategy {
|
|
3
3
|
Required = "Required",
|
|
4
4
|
Optional = "Optional",
|
|
5
5
|
None = "None"
|
|
6
6
|
}
|
|
7
|
-
interface YamlFormProps {
|
|
7
|
+
export interface YamlFormProps {
|
|
8
|
+
id?: string;
|
|
8
9
|
initialValues?: Record<string, unknown>;
|
|
9
10
|
schemaStrategy?: SchemaStrategy;
|
|
11
|
+
isShowLayout?: boolean;
|
|
12
|
+
onFinish?: () => void;
|
|
10
13
|
}
|
|
11
|
-
|
|
14
|
+
export interface YamlFormHandler {
|
|
15
|
+
saveButtonProps: {
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onClick: () => void;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare const YamlForm: React.ForwardRefExoticComponent<YamlFormProps & React.RefAttributes<YamlFormHandler>>;
|
|
12
21
|
export default YamlForm;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum WorkloadState {
|
|
2
|
+
UPDATEING = "updating",
|
|
3
|
+
READY = "ready",
|
|
4
|
+
COMPLETED = "completed",
|
|
5
|
+
FAILED = "failed",
|
|
6
|
+
SUSPENDED = "suspended",
|
|
7
|
+
RUNNING = "running",
|
|
8
|
+
SUCCEEDED = "succeeded",
|
|
9
|
+
UNKNOWN = "unknown",
|
|
10
|
+
TERMINATING = "terminating",
|
|
11
|
+
PENDING = "pending",
|
|
12
|
+
WAITING = "waiting"
|
|
13
|
+
}
|
|
@@ -19,6 +19,7 @@ export type UseFormProps<TQueryFnData extends BaseRecord = BaseRecord, TError ex
|
|
|
19
19
|
isGenerateAnnotations?: boolean;
|
|
20
20
|
isSkipSchema?: boolean;
|
|
21
21
|
};
|
|
22
|
+
initialValuesForCreate?: Record<string, unknown>;
|
|
22
23
|
};
|
|
23
24
|
export type UseFormReturnType<TQueryFnData extends BaseRecord = BaseRecord, TError extends HttpError = HttpError, TVariables extends object = object, TData extends BaseRecord = TQueryFnData, TResponse extends BaseRecord = TData, TResponseError extends HttpError = TError> = UseFormReturnTypeCore<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError> & {
|
|
24
25
|
form: FormInstance;
|
|
@@ -42,5 +43,5 @@ declare const useEagleForm: <TQueryFnData extends Unstructured = Unstructured &
|
|
|
42
43
|
[prop: string]: unknown;
|
|
43
44
|
} = {
|
|
44
45
|
[prop: string]: unknown;
|
|
45
|
-
}, 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>;
|
|
46
|
+
}, 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, initialValuesForCreate, }?: UseFormProps<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>) => UseFormReturnType<TQueryFnData, TError, TVariables, TData, TResponse, TResponseError>;
|
|
46
47
|
export default useEagleForm;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Column } from '../../components/Table';
|
|
2
2
|
import { JobModel, PodModel, ResourceModel, WorkloadModel, WorkloadBaseModel, CronJobModel } from '../../models';
|
|
3
|
-
export declare const CommonSorter: (dataIndex: string[]) => (a: unknown, b: unknown) =>
|
|
3
|
+
export declare const CommonSorter: (dataIndex: string[]) => (a: unknown, b: unknown) => 1 | 0 | -1;
|
|
4
4
|
export declare const NameColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>(resource?: string) => Column<Model>;
|
|
5
5
|
export declare const NameSpaceColumnRenderer: <Model extends ResourceModel<import("k8s-api-provider").Unstructured>>() => Column<Model>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const StateDisplayColumnRenderer: <Model extends PodModel | WorkloadModel | CronJobModel>() => Column<Model>;
|
|
7
7
|
export declare const WorkloadImageColumnRenderer: <Model extends WorkloadBaseModel>() => Column<Model>;
|
|
8
8
|
export declare const WorkloadRestartsColumnRenderer: <Model extends WorkloadModel>() => Column<Model>;
|
|
9
9
|
export declare const ReplicasColumnRenderer: <Model extends WorkloadModel>() => Column<Model>;
|
|
File without changes
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface UseSubmitFormOptions {
|
|
3
|
+
formRef: React.MutableRefObject<{
|
|
4
|
+
submit: () => (Promise<unknown> | undefined);
|
|
5
|
+
} | null>;
|
|
6
|
+
onSubmitSuccess?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function useSubmitForm(options: UseSubmitFormOptions): {
|
|
9
|
+
submitting: boolean;
|
|
10
|
+
errorMsgs: string[];
|
|
11
|
+
onSubmit: () => Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
package/lib/src/i18n.d.ts
CHANGED
|
@@ -15,6 +15,8 @@ export declare const resources: {
|
|
|
15
15
|
fetch_schema_fail: string;
|
|
16
16
|
obtain_data_error: string;
|
|
17
17
|
retry: string;
|
|
18
|
+
create_resource: string;
|
|
19
|
+
edit_resource: string;
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
'zh-CN': {
|
|
@@ -66,7 +68,6 @@ export declare const resources: {
|
|
|
66
68
|
duration: string;
|
|
67
69
|
completions: string;
|
|
68
70
|
started: string;
|
|
69
|
-
ready: string;
|
|
70
71
|
init_container: string;
|
|
71
72
|
container: string;
|
|
72
73
|
redeploy: string;
|
|
@@ -86,6 +87,19 @@ export declare const resources: {
|
|
|
86
87
|
fetch_schema_fail: string;
|
|
87
88
|
obtain_data_error: string;
|
|
88
89
|
retry: string;
|
|
90
|
+
ready: string;
|
|
91
|
+
updating: string;
|
|
92
|
+
completed: string;
|
|
93
|
+
failed: string;
|
|
94
|
+
suspended: string;
|
|
95
|
+
running: string;
|
|
96
|
+
terminating: string;
|
|
97
|
+
succeeded: string;
|
|
98
|
+
unknown: string;
|
|
99
|
+
pending: string;
|
|
100
|
+
waiting: string;
|
|
101
|
+
create_resource: string;
|
|
102
|
+
edit_resource: string;
|
|
89
103
|
};
|
|
90
104
|
};
|
|
91
105
|
};
|
package/lib/src/index.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ declare const _default: {
|
|
|
47
47
|
duration: string;
|
|
48
48
|
completions: string;
|
|
49
49
|
started: string;
|
|
50
|
-
ready: string;
|
|
51
50
|
init_container: string;
|
|
52
51
|
container: string;
|
|
53
52
|
redeploy: string;
|
|
@@ -67,6 +66,19 @@ declare const _default: {
|
|
|
67
66
|
fetch_schema_fail: string;
|
|
68
67
|
obtain_data_error: string;
|
|
69
68
|
retry: string;
|
|
69
|
+
ready: string;
|
|
70
|
+
updating: string;
|
|
71
|
+
completed: string;
|
|
72
|
+
failed: string;
|
|
73
|
+
suspended: string;
|
|
74
|
+
running: string;
|
|
75
|
+
terminating: string;
|
|
76
|
+
succeeded: string;
|
|
77
|
+
unknown: string;
|
|
78
|
+
pending: string;
|
|
79
|
+
waiting: string;
|
|
80
|
+
create_resource: string;
|
|
81
|
+
edit_resource: string;
|
|
70
82
|
};
|
|
71
83
|
};
|
|
72
84
|
export default _default;
|
|
@@ -1,5 +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
4
|
import { WorkloadBaseModel } from './workload-base-model';
|
|
4
5
|
type RequiredCronJob = Required<CronJob> & Unstructured;
|
|
5
6
|
export declare class CronJobModel extends WorkloadBaseModel {
|
|
@@ -8,6 +9,7 @@ export declare class CronJobModel extends WorkloadBaseModel {
|
|
|
8
9
|
spec?: RequiredCronJob['spec'];
|
|
9
10
|
status?: RequiredCronJob['status'];
|
|
10
11
|
constructor(_rawYaml: RequiredCronJob, _globalStore: GlobalStore);
|
|
12
|
+
get stateDisplay(): WorkloadState.SUSPENDED | WorkloadState.RUNNING;
|
|
11
13
|
suspend(): RequiredCronJob;
|
|
12
14
|
resume(): RequiredCronJob;
|
|
13
15
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlobalStore, Unstructured } from 'k8s-api-provider';
|
|
2
|
+
import { DaemonSet } from 'kubernetes-types/apps/v1';
|
|
3
|
+
import { WorkloadState } from '../constants';
|
|
4
|
+
import { WorkloadModel } from './workload-model';
|
|
5
|
+
type RequiredDaemonSet = Required<DaemonSet> & Unstructured;
|
|
6
|
+
export declare class DaemonSetModel extends WorkloadModel {
|
|
7
|
+
_rawYaml: RequiredDaemonSet;
|
|
8
|
+
_globalStore: GlobalStore;
|
|
9
|
+
spec?: RequiredDaemonSet['spec'];
|
|
10
|
+
status?: RequiredDaemonSet['status'];
|
|
11
|
+
constructor(_rawYaml: RequiredDaemonSet, _globalStore: GlobalStore);
|
|
12
|
+
get stateDisplay(): WorkloadState.UPDATEING | WorkloadState.READY;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlobalStore, Unstructured } from 'k8s-api-provider';
|
|
2
|
+
import { Deployment } from 'kubernetes-types/apps/v1';
|
|
3
|
+
import { WorkloadState } from '../constants';
|
|
4
|
+
import { WorkloadModel } from './workload-model';
|
|
5
|
+
type RequiredDeployment = Required<Deployment> & Unstructured;
|
|
6
|
+
export declare class DeploymentModel extends WorkloadModel {
|
|
7
|
+
_rawYaml: RequiredDeployment;
|
|
8
|
+
_globalStore: GlobalStore;
|
|
9
|
+
spec?: RequiredDeployment['spec'];
|
|
10
|
+
status?: RequiredDeployment['status'];
|
|
11
|
+
constructor(_rawYaml: RequiredDeployment, _globalStore: GlobalStore);
|
|
12
|
+
get stateDisplay(): WorkloadState.UPDATEING | WorkloadState.READY;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,5 +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
4
|
import { WorkloadBaseModel } from './workload-base-model';
|
|
4
5
|
type RequiredJob = Required<Job> & Unstructured;
|
|
5
6
|
export declare class JobModel extends WorkloadBaseModel {
|
|
@@ -11,5 +12,6 @@ export declare class JobModel extends WorkloadBaseModel {
|
|
|
11
12
|
get duration(): number;
|
|
12
13
|
get durationDisplay(): string | undefined;
|
|
13
14
|
get completionsDisplay(): string;
|
|
15
|
+
get stateDisplay(): WorkloadState.COMPLETED | WorkloadState.FAILED | WorkloadState.SUSPENDED | WorkloadState.RUNNING;
|
|
14
16
|
}
|
|
15
17
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlobalStore, Unstructured } from 'k8s-api-provider';
|
|
2
|
+
import { StatefulSet } from 'kubernetes-types/apps/v1';
|
|
3
|
+
import { WorkloadState } from '../constants';
|
|
4
|
+
import { WorkloadModel } from './workload-model';
|
|
5
|
+
type RequiredStatefulSet = Required<StatefulSet> & Unstructured;
|
|
6
|
+
export declare class StatefulSetModel extends WorkloadModel {
|
|
7
|
+
_rawYaml: RequiredStatefulSet;
|
|
8
|
+
_globalStore: GlobalStore;
|
|
9
|
+
spec?: RequiredStatefulSet['spec'];
|
|
10
|
+
status?: RequiredStatefulSet['status'];
|
|
11
|
+
constructor(_rawYaml: RequiredStatefulSet, _globalStore: GlobalStore);
|
|
12
|
+
get stateDisplay(): WorkloadState.UPDATEING | WorkloadState.READY;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { FormModalProps } from 'src/components/FormModal';
|
|
2
3
|
import { ShowField } from '../components/ShowContent';
|
|
3
4
|
import { Column } from '../components/Table';
|
|
4
5
|
import { ResourceModel } from '../models';
|
|
@@ -8,6 +9,10 @@ export declare enum RESOURCE_GROUP {
|
|
|
8
9
|
NETWORK = "NETWORK",
|
|
9
10
|
CLUSTER = "CLUSTER"
|
|
10
11
|
}
|
|
12
|
+
export declare enum FormType {
|
|
13
|
+
PAGE = "PAGE",
|
|
14
|
+
MODAL = "MODAL"
|
|
15
|
+
}
|
|
11
16
|
export type WithId<T> = T & {
|
|
12
17
|
id: string;
|
|
13
18
|
};
|
|
@@ -25,5 +30,7 @@ export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
|
|
|
25
30
|
Dropdown?: React.FC<{
|
|
26
31
|
record: Model;
|
|
27
32
|
}>;
|
|
33
|
+
formType?: FormType;
|
|
34
|
+
FormModal?: React.FC<FormModalProps>;
|
|
28
35
|
isCustom?: boolean;
|
|
29
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dovetail-v2/refine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"module": "./dist/refine.js",
|
|
11
11
|
"types": "./lib/src/index.d.ts",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@cloudtower/eagle": "^0.
|
|
14
|
-
"@cloudtower/icons-react": "^0.
|
|
13
|
+
"@cloudtower/eagle": "^0.27.59",
|
|
14
|
+
"@cloudtower/icons-react": "^0.27.59",
|
|
15
15
|
"@patternfly/react-core": "^5.1.1",
|
|
16
16
|
"@patternfly/react-log-viewer": "^5.0.0",
|
|
17
17
|
"@refinedev/core": "^4.38.0",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dayjs": "^1.11.10",
|
|
21
21
|
"i18next": "^23.2.3",
|
|
22
22
|
"js-yaml": "^4.1.0",
|
|
23
|
-
"k8s-api-provider": "0.0.15-beta.
|
|
23
|
+
"k8s-api-provider": "0.0.15-beta.6",
|
|
24
24
|
"ky": "^0.33.3",
|
|
25
25
|
"lodash-es": "^4.17.21",
|
|
26
26
|
"mitt": "^3.0.1",
|