@dovetail-v2/refine 0.1.4 → 0.1.5-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.
- package/dist/{MonacoYamlDiffEditor-4060eeb6.js → MonacoYamlDiffEditor-c27ab21c.js} +1 -1
- package/dist/{index-9767c246.js → index-984f2ec7.js} +16296 -2217
- package/dist/refine.js +163 -158
- package/dist/refine.umd.cjs +16049 -1970
- package/dist/style.css +231 -3
- package/lib/App.d.ts +2 -0
- package/lib/Dovetail.d.ts +18 -0
- package/lib/components/Breadcrumb/index.d.ts +5 -0
- package/lib/components/ConditionsTable/ConditionsTable.d.ts +7 -0
- package/lib/components/ConditionsTable/index.d.ts +1 -0
- package/lib/components/CreateButton/index.d.ts +1 -0
- package/lib/components/CronJobDropdown/index.d.ts +8 -0
- package/lib/components/CronjobJobsTable/index.d.ts +8 -0
- package/lib/components/DeleteButton/index.d.ts +2 -0
- package/lib/components/DeleteManyButton/index.d.ts +4 -0
- package/lib/components/DrawerShow/DrawerShow.d.ts +8 -0
- package/lib/components/DrawerShow/index.d.ts +1 -0
- package/lib/components/DurationTime/index.d.ts +5 -0
- package/lib/components/EditButton/index.d.ts +2 -0
- package/lib/components/EditField/index.d.ts +15 -0
- package/lib/components/ErrorContent/index.d.ts +17 -0
- package/lib/components/EventsTable/EventsTable.d.ts +6 -0
- package/lib/components/EventsTable/index.d.ts +1 -0
- package/lib/components/Form/FormModal.d.ts +10 -0
- package/lib/components/Form/RefineFormContent.d.ts +11 -0
- package/lib/components/Form/RefineFormPage.d.ts +6 -0
- package/lib/components/Form/YamlForm.d.ts +28 -0
- package/lib/components/Form/index.d.ts +7 -0
- package/lib/components/Form/type.d.ts +17 -0
- package/lib/components/Form/useReactHookForm.d.ts +29 -0
- package/lib/components/Form/useRefineForm.d.ts +13 -0
- package/lib/components/Form/useYamlForm.d.ts +51 -0
- package/lib/components/FormErrorAlert/index.d.ts +9 -0
- package/lib/components/FormLayout/index.d.ts +7 -0
- package/lib/components/FormWidgets/KeyValueListWidget.d.ts +5 -0
- package/lib/components/FormWidgets/MetadataForm.d.ts +1 -0
- package/lib/components/FormWidgets/NameInputWidget.d.ts +50 -0
- package/lib/components/FormWidgets/NamespaceSelectWidget.d.ts +8 -0
- package/lib/components/FormWidgets/index.d.ts +4 -0
- package/lib/components/FormWidgets/widget.d.ts +5 -0
- package/lib/components/ImageNames/index.d.ts +5 -0
- package/lib/components/IngressRulesComponent/index.d.ts +5 -0
- package/lib/components/IngressRulesTable/IngressRulesTable.d.ts +7 -0
- package/lib/components/IngressRulesTable/index.d.ts +1 -0
- package/lib/components/K8sDropdown/index.d.ts +9 -0
- package/lib/components/KeyValue/KeyValue.d.ts +7 -0
- package/lib/components/KeyValue/KeyValueAnnotation.d.ts +5 -0
- package/lib/components/KeyValue/KeyValueSecret.d.ts +4 -0
- package/lib/components/KeyValue/index.d.ts +3 -0
- package/lib/components/Layout/index.d.ts +3 -0
- package/lib/components/LinkFallback/index.d.ts +3 -0
- package/lib/components/ListPage/index.d.ts +9 -0
- package/lib/components/Menu/index.d.ts +1 -0
- package/lib/components/NamespacesFilter/index.d.ts +11 -0
- package/lib/components/NetworkPolicyRulesViewer/NetworkPolicyRulesViewer.d.ts +8 -0
- package/lib/components/NetworkPolicyRulesViewer/index.d.ts +1 -0
- package/lib/components/PageShow/PageShow.d.ts +12 -0
- package/lib/components/PageShow/index.d.ts +1 -0
- package/lib/components/PodContainersTable/PodContainersTable.d.ts +8 -0
- package/lib/components/PodContainersTable/index.d.ts +1 -0
- package/lib/components/PodDropdown/index.d.ts +9 -0
- package/lib/components/PodLog/index.d.ts +6 -0
- package/lib/components/PodSelectorTable/index.d.ts +6 -0
- package/lib/components/PodShellModal/PodShell.d.ts +18 -0
- package/lib/components/PodShellModal/index.d.ts +9 -0
- package/lib/components/PortsTable/index.d.ts +7 -0
- package/lib/components/ReferenceLink/index.d.ts +8 -0
- package/lib/components/ReplicasDropdown/index.d.ts +9 -0
- package/lib/components/ResourceCRUD/ResourceCRUD.d.ts +7 -0
- package/lib/components/ResourceCRUD/create/index.d.ts +7 -0
- package/lib/components/ResourceCRUD/index.d.ts +4 -0
- package/lib/components/ResourceCRUD/list/index.d.ts +8 -0
- package/lib/components/ResourceCRUD/show/index.d.ts +8 -0
- package/lib/components/ResourceFiledDisplays.d.ts +6 -0
- package/lib/components/ResourceLink/index.d.ts +8 -0
- package/lib/components/ResourceSelect/index.d.ts +11 -0
- package/lib/components/ResourceUsageBar/index.d.ts +8 -0
- package/lib/components/Separator/index.d.ts +2 -0
- package/lib/components/ServiceComponents/index.d.ts +10 -0
- package/lib/components/Shell/index.d.ts +54 -0
- package/lib/components/ShowContent/ShowContent.d.ts +18 -0
- package/lib/components/ShowContent/fields.d.ts +68 -0
- package/lib/components/ShowContent/groups.d.ts +23 -0
- package/lib/components/ShowContent/index.d.ts +4 -0
- package/lib/components/ShowContent/tabs.d.ts +5 -0
- package/lib/components/StateTag/StateTag.d.ts +10 -0
- package/lib/components/StateTag/index.d.ts +1 -0
- package/lib/components/Table/TableToolBar.d.ts +8 -0
- package/lib/components/Table/TableWidgets.d.ts +6 -0
- package/lib/components/Table/index.d.ts +43 -0
- package/lib/components/Tabs/index.d.ts +10 -0
- package/lib/components/Tags/index.d.ts +6 -0
- package/lib/components/TextTags/index.d.ts +6 -0
- package/lib/components/Time/index.d.ts +8 -0
- package/lib/components/ValueDisplay/index.d.ts +9 -0
- package/lib/components/WorkloadDropdown/index.d.ts +9 -0
- package/lib/components/WorkloadPodsTable/WorkloadPodsTable.d.ts +9 -0
- package/lib/components/WorkloadPodsTable/index.d.ts +1 -0
- package/lib/components/WorkloadReplicas/index.d.ts +17 -0
- package/lib/components/YamlEditor/MonacoYamlDiffEditor.d.ts +9 -0
- package/lib/components/YamlEditor/MonacoYamlEditor.d.ts +19 -0
- package/lib/components/YamlEditor/YamlEditorComponent.d.ts +27 -0
- package/lib/components/YamlEditor/index.d.ts +1 -0
- package/lib/components/YamlEditor/style.d.ts +11 -0
- package/lib/components/YamlEditor/yaml.worker.d.ts +1 -0
- package/lib/components/index.d.ts +47 -0
- package/lib/constants/auth.d.ts +5 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/k8s.d.ts +487 -0
- package/lib/constants/state.d.ts +15 -0
- package/lib/contexts/component.d.ts +7 -0
- package/lib/contexts/configs.d.ts +3 -0
- package/lib/contexts/global-store.d.ts +5 -0
- package/lib/contexts/index.d.ts +3 -0
- package/lib/hooks/index.d.ts +8 -0
- package/lib/hooks/useDeleteModal/index.d.ts +1 -0
- package/lib/hooks/useDeleteModal/useDeleteManyModal.d.ts +7 -0
- package/lib/hooks/useDeleteModal/useDeleteModal.d.ts +7 -0
- package/lib/hooks/useDownloadYAML.d.ts +7 -0
- package/lib/hooks/useEagleTable/columns.d.ts +41 -0
- package/lib/hooks/useEagleTable/index.d.ts +2 -0
- package/lib/hooks/useEagleTable/useEagleTable.d.ts +55 -0
- package/lib/hooks/useEdit.d.ts +4 -0
- package/lib/hooks/useGlobalStore.d.ts +3 -0
- package/lib/hooks/useK8sYamlEditor.d.ts +5 -0
- package/lib/hooks/useNamespaceRefineFilter.d.ts +5 -0
- package/lib/hooks/useOpenForm.d.ts +7 -0
- package/lib/hooks/useSchema.d.ts +14 -0
- package/lib/hooks/useSubmitForm.d.ts +14 -0
- package/lib/hooks/useTableData.d.ts +19 -0
- package/lib/i18n.d.ts +353 -0
- package/lib/index.d.ts +11 -0
- package/lib/locales/en-US/index.d.ts +175 -0
- package/lib/locales/index.d.ts +2 -0
- package/lib/locales/zh-CN/index.d.ts +175 -0
- package/lib/main.d.ts +3 -0
- package/lib/models/cronjob-model.d.ts +15 -0
- package/lib/models/daemonset-model.d.ts +15 -0
- package/lib/models/deployment-model.d.ts +13 -0
- package/lib/models/event-model.d.ts +7 -0
- package/lib/models/index.d.ts +19 -0
- package/lib/models/ingress-model.d.ts +20 -0
- package/lib/models/job-model.d.ts +20 -0
- package/lib/models/network-policy-model.d.ts +9 -0
- package/lib/models/node-model.d.ts +17 -0
- package/lib/models/persistent-volume-claim.d.ts +9 -0
- package/lib/models/persistent-volume.d.ts +9 -0
- package/lib/models/pod-metrics-model.d.ts +8 -0
- package/lib/models/pod-model.d.ts +20 -0
- package/lib/models/resource-model.d.ts +21 -0
- package/lib/models/service-model.d.ts +24 -0
- package/lib/models/statefulset-model.d.ts +13 -0
- package/lib/models/storage-class.d.ts +12 -0
- package/lib/models/types/index.d.ts +1 -0
- package/lib/models/types/metric.d.ts +25 -0
- package/lib/models/workload-base-model.d.ts +12 -0
- package/lib/models/workload-model.d.ts +18 -0
- package/lib/pages/configmaps/index.d.ts +4 -0
- package/lib/pages/cronjobs/create/index.d.ts +3 -0
- package/lib/pages/cronjobs/index.d.ts +3 -0
- package/lib/pages/cronjobs/list/index.d.ts +3 -0
- package/lib/pages/cronjobs/show/index.d.ts +3 -0
- package/lib/pages/daemonsets/create/index.d.ts +3 -0
- package/lib/pages/daemonsets/index.d.ts +3 -0
- package/lib/pages/daemonsets/list/index.d.ts +3 -0
- package/lib/pages/daemonsets/show/index.d.ts +3 -0
- package/lib/pages/deployments/index.d.ts +2 -0
- package/lib/pages/deployments/list/index.d.ts +3 -0
- package/lib/pages/deployments/show/index.d.ts +3 -0
- package/lib/pages/ingresses/index.d.ts +4 -0
- package/lib/pages/jobs/index.d.ts +4 -0
- package/lib/pages/networkPolicies/index.d.ts +4 -0
- package/lib/pages/nodes/index.d.ts +2 -0
- package/lib/pages/nodes/list/index.d.ts +3 -0
- package/lib/pages/nodes/show/index.d.ts +3 -0
- package/lib/pages/persistentvolumeclaims/index.d.ts +4 -0
- package/lib/pages/persistentvolumes/index.d.ts +4 -0
- package/lib/pages/pods/create/index.d.ts +3 -0
- package/lib/pages/pods/index.d.ts +3 -0
- package/lib/pages/pods/list/index.d.ts +3 -0
- package/lib/pages/pods/show/index.d.ts +3 -0
- package/lib/pages/secrets/index.d.ts +4 -0
- package/lib/pages/services/index.d.ts +4 -0
- package/lib/pages/statefulsets/index.d.ts +4 -0
- package/lib/pages/storageclasses/form/index.d.ts +9 -0
- package/lib/pages/storageclasses/index.d.ts +44 -0
- package/lib/plugins/index.d.ts +4 -0
- package/lib/plugins/model-plugin.d.ts +13 -0
- package/lib/plugins/relation-plugin.d.ts +26 -0
- package/lib/plugins/type.d.ts +8 -0
- package/lib/providers/index.d.ts +1 -0
- package/lib/providers/router-provider/index.d.ts +21 -0
- package/lib/src/components/PodDropdown/index.d.ts +9 -0
- package/lib/src/components/PodShellModal/PodShell.d.ts +18 -0
- package/lib/src/components/PodShellModal/index.d.ts +10 -0
- package/lib/src/components/Shell/ShellToolbar.d.ts +16 -0
- package/lib/src/components/Shell/index.d.ts +74 -0
- package/lib/src/components/index.d.ts +3 -0
- package/lib/src/i18n.d.ts +8 -0
- package/lib/src/locales/en-US/index.d.ts +1 -0
- package/lib/src/locales/zh-CN/index.d.ts +7 -0
- package/lib/src/styles/modal.d.ts +1 -0
- package/lib/src/utils/index.d.ts +1 -0
- package/lib/src/utils/shell.d.ts +16 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/resource.d.ts +62 -0
- package/lib/utils/addId.d.ts +3 -0
- package/lib/utils/download.d.ts +1 -0
- package/lib/utils/error.d.ts +20 -0
- package/lib/utils/form.d.ts +3 -0
- package/lib/utils/k8s.d.ts +3 -0
- package/lib/utils/labels.d.ts +9 -0
- package/lib/utils/match-selector.d.ts +3 -0
- package/lib/utils/openapi.d.ts +45 -0
- package/lib/utils/schema.d.ts +17 -0
- package/lib/utils/selector.d.ts +3 -0
- package/lib/utils/shell.d.ts +15 -0
- package/lib/utils/string.d.ts +1 -0
- package/lib/utils/time.d.ts +13 -0
- package/lib/utils/unit.d.ts +12 -0
- package/lib/utils/yaml.d.ts +2 -0
- package/package.json +14 -5
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ResourceModel } from 'src/models';
|
|
2
|
+
import { ResourceConfig } from 'src/types';
|
|
3
|
+
type GenerateStorageClassFormConfig = {
|
|
4
|
+
isEnabledZbs?: boolean;
|
|
5
|
+
isEnabledElf?: boolean;
|
|
6
|
+
isVmKsc?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function generateStorageClassFormConfig(options: GenerateStorageClassFormConfig): ResourceConfig<ResourceModel>['formConfig'];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { i18n as I18n } from 'i18next';
|
|
2
|
+
import { RESOURCE_GROUP } from 'src/types';
|
|
3
|
+
export declare const StorageClassConfig: (i18n: I18n) => {
|
|
4
|
+
name: string;
|
|
5
|
+
basePath: string;
|
|
6
|
+
kind: string;
|
|
7
|
+
parent: RESOURCE_GROUP;
|
|
8
|
+
label: string;
|
|
9
|
+
initValue: {
|
|
10
|
+
apiVersion: string;
|
|
11
|
+
kind: string;
|
|
12
|
+
metadata: {
|
|
13
|
+
name: string;
|
|
14
|
+
namespace: string;
|
|
15
|
+
};
|
|
16
|
+
spec: {};
|
|
17
|
+
};
|
|
18
|
+
formConfig: {
|
|
19
|
+
fields?: ((props: {
|
|
20
|
+
record?: import("../..").ResourceModel<import("k8s-api-provider").Unstructured> | undefined;
|
|
21
|
+
records: import("../..").ResourceModel<import("k8s-api-provider").Unstructured>[];
|
|
22
|
+
action: "create" | "edit";
|
|
23
|
+
}) => import("../../components").RefineFormField[]) | undefined;
|
|
24
|
+
saveButtonText?: string;
|
|
25
|
+
renderForm?: (props: import("../../components").YamlFormProps) => React.ReactNode;
|
|
26
|
+
formType?: import("src/types").FormType;
|
|
27
|
+
transformInitValues?: (values: import("k8s-api-provider").Unstructured) => import("k8s-api-provider").Unstructured;
|
|
28
|
+
transformApplyValues?: (values: import("k8s-api-provider").Unstructured) => import("k8s-api-provider").Unstructured;
|
|
29
|
+
formTitle?: string | ((action: "create" | "edit") => string);
|
|
30
|
+
formDesc?: string | ((action: "create" | "edit") => string);
|
|
31
|
+
formatError?: (errorBody: any) => string;
|
|
32
|
+
refineCoreProps?: import("@refinedev/react-hook-form").UseFormProps["refineCoreProps"];
|
|
33
|
+
useFormProps?: import("@refinedev/react-hook-form").UseFormProps;
|
|
34
|
+
} | undefined;
|
|
35
|
+
columns: () => (import("../../components").Column<import("../..").ResourceModel<import("k8s-api-provider").Unstructured>> | import("../../components").Column<import("../..").StorageClassModel>)[];
|
|
36
|
+
showConfig: () => {
|
|
37
|
+
tabs: {
|
|
38
|
+
title: string;
|
|
39
|
+
key: string;
|
|
40
|
+
groups: import("../../components").ShowGroup<import("../..").StorageClassModel>[];
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
export * from './form';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GlobalStore, Unstructured, UnstructuredList, IProviderPlugin, DataList } from 'k8s-api-provider';
|
|
2
|
+
import { ResourceModel } from '../models';
|
|
3
|
+
export declare class ModelPlugin implements IProviderPlugin<ResourceModel> {
|
|
4
|
+
_globalStore?: GlobalStore;
|
|
5
|
+
private ModelMap;
|
|
6
|
+
init(globalStore: GlobalStore): void;
|
|
7
|
+
processData(res: UnstructuredList): Promise<DataList<ResourceModel<Unstructured>>>;
|
|
8
|
+
processItem(item: Unstructured): Promise<ResourceModel>;
|
|
9
|
+
restoreData(res: DataList<ResourceModel>): UnstructuredList;
|
|
10
|
+
restoreItem(item: ResourceModel): Unstructured;
|
|
11
|
+
setModelMap(key: string, model: ResourceModel): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const modelPlugin: ModelPlugin;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { GlobalStore, Unstructured, UnstructuredList } from 'k8s-api-provider';
|
|
2
|
+
import { LabelSelector, ObjectMeta } from 'kubernetes-types/meta/v1';
|
|
3
|
+
import { ResourceModel } from '../models';
|
|
4
|
+
export type Relation = {
|
|
5
|
+
kind: string;
|
|
6
|
+
apiVersion: string;
|
|
7
|
+
type: 'creates' | 'uses' | 'applies' | 'owner' | 'selects';
|
|
8
|
+
inbound: boolean;
|
|
9
|
+
name?: string;
|
|
10
|
+
namespace?: string;
|
|
11
|
+
selector?: LabelSelector;
|
|
12
|
+
};
|
|
13
|
+
export type ExtendObjectMeta = ObjectMeta & {
|
|
14
|
+
relations?: Relation[];
|
|
15
|
+
};
|
|
16
|
+
export declare class RelationPlugin {
|
|
17
|
+
private globalStore?;
|
|
18
|
+
init(globalStore: GlobalStore): void;
|
|
19
|
+
processData(res: UnstructuredList): Promise<UnstructuredList>;
|
|
20
|
+
processItem(item: Unstructured): Promise<ResourceModel>;
|
|
21
|
+
restoreData(res: UnstructuredList): UnstructuredList;
|
|
22
|
+
restoreItem(item: Unstructured): Unstructured;
|
|
23
|
+
private processPodSelector;
|
|
24
|
+
private appendRelation;
|
|
25
|
+
}
|
|
26
|
+
export declare const relationPlugin: RelationPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Unstructured } from 'k8s-api-provider';
|
|
2
|
+
import { ListMeta } from 'kubernetes-types/meta/v1';
|
|
3
|
+
export type DataList<Output extends Unstructured = Unstructured> = {
|
|
4
|
+
apiVersion: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
metadata: ListMeta;
|
|
7
|
+
items: Array<Unstructured & Output>;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { routerProvider } from './router-provider';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { GoConfig, ParseResponse } from '@refinedev/core';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const stringifyConfig: {
|
|
4
|
+
addQueryPrefix: boolean;
|
|
5
|
+
skipNulls: boolean;
|
|
6
|
+
arrayFormat: "indices";
|
|
7
|
+
encode: boolean;
|
|
8
|
+
encodeValuesOnly: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const convertToNumberIfPossible: (value: string | undefined) => string | number | undefined;
|
|
11
|
+
export declare const routerProvider: {
|
|
12
|
+
go: () => ({ to, type, query, hash, options: { keepQuery, keepHash } }: GoConfig) => string | void;
|
|
13
|
+
back: () => () => void;
|
|
14
|
+
parse: () => () => ParseResponse;
|
|
15
|
+
Link: React.ForwardRefExoticComponent<Pick<{
|
|
16
|
+
[prop: string]: any;
|
|
17
|
+
to: string;
|
|
18
|
+
} & {
|
|
19
|
+
children?: React.ReactNode | undefined;
|
|
20
|
+
}, string | number> & React.RefAttributes<HTMLAnchorElement>>;
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PodModel } from '../../models';
|
|
3
|
+
import { DropdownSize } from '../K8sDropdown';
|
|
4
|
+
type Props<Model extends PodModel> = {
|
|
5
|
+
record: Model;
|
|
6
|
+
size?: DropdownSize;
|
|
7
|
+
};
|
|
8
|
+
export declare function PodDropdown<Model extends PodModel>(props: React.PropsWithChildren<Props<Model>>): JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SocketStatus } from 'src/components/Shell';
|
|
3
|
+
import '@xterm/xterm/css/xterm.css';
|
|
4
|
+
import { PodModel } from 'src/models/pod-model';
|
|
5
|
+
export declare enum OS {
|
|
6
|
+
Linux = "linux",
|
|
7
|
+
Windows = "windows"
|
|
8
|
+
}
|
|
9
|
+
interface PodShellProps {
|
|
10
|
+
pod: PodModel;
|
|
11
|
+
basePath: string;
|
|
12
|
+
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
13
|
+
}
|
|
14
|
+
interface PodShellHandler {
|
|
15
|
+
getAllTerminalContents: () => string[];
|
|
16
|
+
}
|
|
17
|
+
export declare const PodShell: React.ForwardRefExoticComponent<PodShellProps & React.RefAttributes<PodShellHandler>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SocketStatus } from 'src/components/Shell';
|
|
3
|
+
import { PodModel } from 'src/models';
|
|
4
|
+
import { PodShell } from './PodShell';
|
|
5
|
+
interface PodShellModalProps {
|
|
6
|
+
pod: PodModel;
|
|
7
|
+
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function PodShellModal(props: PodShellModalProps): JSX.Element;
|
|
10
|
+
export { PodShell };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type OperationType = ('fontSize' | 'downloadLog' | 'clear');
|
|
3
|
+
export interface ShellToolbarProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
leftSlot?: React.ReactNode;
|
|
6
|
+
operations?: (OperationType | React.ReactNode)[];
|
|
7
|
+
searchMatchedTotal: number;
|
|
8
|
+
onSearchNext: (search: string) => void;
|
|
9
|
+
onSearchPre: (search: string) => void;
|
|
10
|
+
onSetFontSize?: (size: number) => void;
|
|
11
|
+
onDownFontSize?: () => void;
|
|
12
|
+
onDownloadLog?: () => void;
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare function ShellToolbar(props: ShellToolbarProps): JSX.Element;
|
|
16
|
+
export default ShellToolbar;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Terminal } from '@xterm/xterm';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ShellToolbarProps } from './ShellToolbar';
|
|
4
|
+
import '@xterm/xterm/css/xterm.css';
|
|
5
|
+
export declare enum SocketStatus {
|
|
6
|
+
Opening = "Opening",
|
|
7
|
+
Open = "Open",
|
|
8
|
+
Disconnected = "Disconnected"
|
|
9
|
+
}
|
|
10
|
+
export type ShellProps = React.PropsWithChildren<{
|
|
11
|
+
url: string;
|
|
12
|
+
protocols?: string;
|
|
13
|
+
timeout?: number;
|
|
14
|
+
className?: string;
|
|
15
|
+
logFileName?: string;
|
|
16
|
+
isHideToolbar?: boolean;
|
|
17
|
+
toolbarLeftSlot?: React.ReactNode;
|
|
18
|
+
operations?: ShellToolbarProps['operations'];
|
|
19
|
+
shellOptions?: Record<string, unknown>;
|
|
20
|
+
loadingElement?: React.ReactNode;
|
|
21
|
+
encode: (input: string) => string | ArrayBufferLike | Blob | ArrayBufferView;
|
|
22
|
+
decode?: (output: string | ArrayBufferLike | Blob | ArrayBufferView) => string | ArrayBuffer;
|
|
23
|
+
fit?: (layout: {
|
|
24
|
+
rows: number;
|
|
25
|
+
cols: number;
|
|
26
|
+
}) => void;
|
|
27
|
+
onReconnect?: () => void;
|
|
28
|
+
onSocketInit?: (socket: WebSocket) => void;
|
|
29
|
+
onTermInit?: (term: Terminal) => void;
|
|
30
|
+
onSocketMessage?: (e: MessageEvent, socket: WebSocket, term: Terminal | null) => void;
|
|
31
|
+
onSocketOpen?: (socket: WebSocket) => void;
|
|
32
|
+
onSocketClose?: (socket: WebSocket, term: Terminal | null) => void;
|
|
33
|
+
onSocketStatusChange?: (socketStatus: SocketStatus) => void;
|
|
34
|
+
}>;
|
|
35
|
+
export interface ShellHandler {
|
|
36
|
+
clear: () => void;
|
|
37
|
+
send: (data: string | ArrayBufferLike | Blob | ArrayBufferView, callback?: () => void) => void;
|
|
38
|
+
connect: () => void;
|
|
39
|
+
fit: () => void;
|
|
40
|
+
getAllTerminalContents: () => string[];
|
|
41
|
+
setSocketStatus: React.Dispatch<React.SetStateAction<SocketStatus>>;
|
|
42
|
+
searchNext: (search: string) => void;
|
|
43
|
+
searchPrevious: (search: string) => void;
|
|
44
|
+
setOptions: (options: Record<string, unknown>) => void;
|
|
45
|
+
setLoading: (loading: boolean) => void;
|
|
46
|
+
setError: (error: unknown) => void;
|
|
47
|
+
}
|
|
48
|
+
export declare const Shell: React.ForwardRefExoticComponent<{
|
|
49
|
+
url: string;
|
|
50
|
+
protocols?: string | undefined;
|
|
51
|
+
timeout?: number | undefined;
|
|
52
|
+
className?: string | undefined;
|
|
53
|
+
logFileName?: string | undefined;
|
|
54
|
+
isHideToolbar?: boolean | undefined;
|
|
55
|
+
toolbarLeftSlot?: React.ReactNode;
|
|
56
|
+
operations?: ShellToolbarProps['operations'];
|
|
57
|
+
shellOptions?: Record<string, unknown> | undefined;
|
|
58
|
+
loadingElement?: React.ReactNode;
|
|
59
|
+
encode: (input: string) => string | ArrayBufferLike | Blob | ArrayBufferView;
|
|
60
|
+
decode?: ((output: string | ArrayBufferLike | Blob | ArrayBufferView) => string | ArrayBuffer) | undefined;
|
|
61
|
+
fit?: ((layout: {
|
|
62
|
+
rows: number;
|
|
63
|
+
cols: number;
|
|
64
|
+
}) => void) | undefined;
|
|
65
|
+
onReconnect?: (() => void) | undefined;
|
|
66
|
+
onSocketInit?: ((socket: WebSocket) => void) | undefined;
|
|
67
|
+
onTermInit?: ((term: Terminal) => void) | undefined;
|
|
68
|
+
onSocketMessage?: ((e: MessageEvent, socket: WebSocket, term: Terminal | null) => void) | undefined;
|
|
69
|
+
onSocketOpen?: ((socket: WebSocket) => void) | undefined;
|
|
70
|
+
onSocketClose?: ((socket: WebSocket, term: Terminal | null) => void) | undefined;
|
|
71
|
+
onSocketStatusChange?: ((socketStatus: SocketStatus) => void) | undefined;
|
|
72
|
+
} & {
|
|
73
|
+
children?: React.ReactNode;
|
|
74
|
+
} & React.RefAttributes<ShellHandler>>;
|
|
@@ -7,6 +7,7 @@ export * from './FormLayout';
|
|
|
7
7
|
export * from './PodContainersTable';
|
|
8
8
|
export * from './WorkloadDropdown';
|
|
9
9
|
export * from './ReplicasDropdown';
|
|
10
|
+
export * from './PodDropdown';
|
|
10
11
|
export * from './CreateButton';
|
|
11
12
|
export * from './ImageNames';
|
|
12
13
|
export * from './ResourceCRUD';
|
|
@@ -42,3 +43,5 @@ export * from './ResourceFiledDisplays';
|
|
|
42
43
|
export * from './Tabs';
|
|
43
44
|
export * as ValueDisplay from './ValueDisplay';
|
|
44
45
|
export * from './ResourceSelect';
|
|
46
|
+
export * from './Shell';
|
|
47
|
+
export * from './PodShellModal';
|
package/lib/src/i18n.d.ts
CHANGED
|
@@ -172,6 +172,7 @@ export declare const resources: {
|
|
|
172
172
|
pv_phase_released: string;
|
|
173
173
|
pv_phase_failed: string;
|
|
174
174
|
pv_phase_pending: string;
|
|
175
|
+
exec_pod: string;
|
|
175
176
|
};
|
|
176
177
|
};
|
|
177
178
|
'zh-CN': {
|
|
@@ -346,6 +347,13 @@ export declare const resources: {
|
|
|
346
347
|
pv_phase_released: string;
|
|
347
348
|
pv_phase_failed: string;
|
|
348
349
|
pv_phase_pending: string;
|
|
350
|
+
font_size: string;
|
|
351
|
+
download_shell_content: string;
|
|
352
|
+
clear_shell: string;
|
|
353
|
+
disconnected: string;
|
|
354
|
+
connecting: string;
|
|
355
|
+
reconnect: string;
|
|
356
|
+
search: string;
|
|
349
357
|
};
|
|
350
358
|
};
|
|
351
359
|
};
|
|
@@ -170,6 +170,13 @@ declare const _default: {
|
|
|
170
170
|
pv_phase_released: string;
|
|
171
171
|
pv_phase_failed: string;
|
|
172
172
|
pv_phase_pending: string;
|
|
173
|
+
font_size: string;
|
|
174
|
+
download_shell_content: string;
|
|
175
|
+
clear_shell: string;
|
|
176
|
+
disconnected: string;
|
|
177
|
+
connecting: string;
|
|
178
|
+
reconnect: string;
|
|
179
|
+
search: string;
|
|
173
180
|
};
|
|
174
181
|
};
|
|
175
182
|
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FullscreenModalStyle: import("@linaria/core").LinariaClassName;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './schema';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Buffer } from 'buffer';
|
|
3
|
+
export type QueryParams = {
|
|
4
|
+
[key: string]: string | string[];
|
|
5
|
+
};
|
|
6
|
+
export declare const stdin: (characters: string) => Buffer;
|
|
7
|
+
export declare function addParam(url: string, key: string, val: string | string[]): string;
|
|
8
|
+
export declare function addParams(url: string, params: QueryParams): string;
|
|
9
|
+
declare enum Alphabet {
|
|
10
|
+
NORMAL = "normal",
|
|
11
|
+
URL = "url"
|
|
12
|
+
}
|
|
13
|
+
export declare function base64Encode(str: string, alphabet?: Alphabet): string;
|
|
14
|
+
export declare function base64DecodeToBuffer(str: string): Buffer;
|
|
15
|
+
export declare function base64Decode(str: string): string;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './resource';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { UseFormProps } from '@refinedev/react-hook-form';
|
|
2
|
+
import { Unstructured } from 'k8s-api-provider';
|
|
3
|
+
import { YamlFormProps } from '../components';
|
|
4
|
+
import { RefineFormField } from '../components/Form';
|
|
5
|
+
import { ShowConfig } from '../components/ShowContent';
|
|
6
|
+
import { Column, TableProps } from '../components/Table';
|
|
7
|
+
import { ResourceModel } from '../models';
|
|
8
|
+
export declare enum RESOURCE_GROUP {
|
|
9
|
+
WORKLOAD = "WORKLOAD",
|
|
10
|
+
STORAGE = "STORAGE",
|
|
11
|
+
NETWORK = "NETWORK",
|
|
12
|
+
CLUSTER = "CLUSTER",
|
|
13
|
+
SERVICE = "SERVICE",
|
|
14
|
+
SERVICE_AND_NETWORK = "SERVICE_AND_NETWORK",
|
|
15
|
+
CONFIG = "CONFIG",
|
|
16
|
+
NODE_MANAGEMENT = "NODE_MANAGEMENT"
|
|
17
|
+
}
|
|
18
|
+
export declare enum FormType {
|
|
19
|
+
PAGE = "PAGE",
|
|
20
|
+
MODAL = "MODAL"
|
|
21
|
+
}
|
|
22
|
+
export type WithId<T> = T & {
|
|
23
|
+
id: string;
|
|
24
|
+
};
|
|
25
|
+
export type ResourceConfig<Model extends ResourceModel = ResourceModel> = {
|
|
26
|
+
name: string;
|
|
27
|
+
kind: string;
|
|
28
|
+
basePath: string;
|
|
29
|
+
apiVersion: string;
|
|
30
|
+
label: string;
|
|
31
|
+
hideListToolBar?: boolean;
|
|
32
|
+
hideNamespacesFilter?: boolean;
|
|
33
|
+
description?: string;
|
|
34
|
+
parent?: RESOURCE_GROUP;
|
|
35
|
+
formatter?: (v: Model) => Model;
|
|
36
|
+
initValue?: Record<string, unknown>;
|
|
37
|
+
columns?: () => Column<Model>[];
|
|
38
|
+
noShow?: boolean;
|
|
39
|
+
showConfig?: () => ShowConfig<Model>;
|
|
40
|
+
Dropdown?: React.FC<{
|
|
41
|
+
record: Model;
|
|
42
|
+
}>;
|
|
43
|
+
tableProps?: Partial<TableProps<Model>>;
|
|
44
|
+
isCustom?: boolean;
|
|
45
|
+
formConfig?: {
|
|
46
|
+
fields?: (props: {
|
|
47
|
+
record?: Model;
|
|
48
|
+
records: Model[];
|
|
49
|
+
action: 'create' | 'edit';
|
|
50
|
+
}) => RefineFormField[];
|
|
51
|
+
saveButtonText?: string;
|
|
52
|
+
renderForm?: (props: YamlFormProps) => React.ReactNode;
|
|
53
|
+
formType?: FormType;
|
|
54
|
+
transformInitValues?: (values: Unstructured) => Unstructured;
|
|
55
|
+
transformApplyValues?: (values: Unstructured) => Unstructured;
|
|
56
|
+
formTitle?: string | ((action: 'create' | 'edit') => string);
|
|
57
|
+
formDesc?: string | ((action: 'create' | 'edit') => string);
|
|
58
|
+
formatError?: (errorBody: any) => string;
|
|
59
|
+
refineCoreProps?: UseFormProps['refineCoreProps'];
|
|
60
|
+
useFormProps?: UseFormProps;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function download(filename: string, content: string): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { i18n as I18n } from 'i18next';
|
|
2
|
+
type Cause = {
|
|
3
|
+
code?: string;
|
|
4
|
+
reason?: string;
|
|
5
|
+
message: string;
|
|
6
|
+
field?: string;
|
|
7
|
+
};
|
|
8
|
+
export type ErrorResponseBody = {
|
|
9
|
+
message?: string;
|
|
10
|
+
code?: number;
|
|
11
|
+
reason?: string;
|
|
12
|
+
details?: {
|
|
13
|
+
causes?: Cause[];
|
|
14
|
+
};
|
|
15
|
+
graphQLErrors?: Cause[];
|
|
16
|
+
};
|
|
17
|
+
export declare function isNetworkError(errors?: Cause[]): boolean;
|
|
18
|
+
export declare function getSubmitError(errorResponse: ErrorResponseBody | undefined, text: string, i18n: I18n): string;
|
|
19
|
+
export declare function getCommonErrors(responseBody: ErrorResponseBody, i18n: I18n): string[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Labels = Record<string, string>;
|
|
2
|
+
type LabelsArray = {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
export declare function toLabelStrings(labels?: Labels): string[];
|
|
7
|
+
export declare function toLabelsArray(labels?: Labels): LabelsArray;
|
|
8
|
+
export declare function toLabelsRecord(labels: LabelsArray): Labels;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JSONSchema7 } from 'json-schema';
|
|
2
|
+
interface OpenAPIResponse {
|
|
3
|
+
openapi: string;
|
|
4
|
+
paths: {
|
|
5
|
+
[prop: string]: {
|
|
6
|
+
get: {
|
|
7
|
+
responses: {
|
|
8
|
+
200: {
|
|
9
|
+
content: {
|
|
10
|
+
'application/json': {
|
|
11
|
+
schema: JSONSchema7;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
components: {
|
|
20
|
+
schemas: {
|
|
21
|
+
[prop: string]: JSONSchema7 & {
|
|
22
|
+
'x-kubernetes-group-version-kind': {
|
|
23
|
+
group: string;
|
|
24
|
+
kind: string;
|
|
25
|
+
version: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare class K8sOpenAPI {
|
|
32
|
+
resourceBasePath: string;
|
|
33
|
+
response: OpenAPIResponse | null;
|
|
34
|
+
apiVersion: string;
|
|
35
|
+
constructor(resourceBasePath: string);
|
|
36
|
+
fetch(): Promise<OpenAPIResponse>;
|
|
37
|
+
findSchema(kind: string): Promise<(JSONSchema7 & {
|
|
38
|
+
'x-kubernetes-group-version-kind': {
|
|
39
|
+
group: string;
|
|
40
|
+
kind: string;
|
|
41
|
+
version: string;
|
|
42
|
+
}[];
|
|
43
|
+
}) | undefined>;
|
|
44
|
+
}
|
|
45
|
+
export default K8sOpenAPI;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { JSONSchema7, JSONSchema7Type } from 'json-schema';
|
|
2
|
+
type TransformOptions = {
|
|
3
|
+
generateValue?: (schema: JSONSchema7) => JSONSchema7Type | undefined | null | Record<string, unknown>;
|
|
4
|
+
};
|
|
5
|
+
export declare function generateValueFromSchema(schema: JSONSchema7, options: TransformOptions): JSONSchema7Type | undefined | Record<string, unknown>;
|
|
6
|
+
export declare function generateSchemaTypeValue(schema: JSONSchema7): JSONSchema7Type | undefined | Record<string, unknown>;
|
|
7
|
+
type ResolveOptions = {
|
|
8
|
+
prune: {
|
|
9
|
+
description: boolean;
|
|
10
|
+
optional: boolean;
|
|
11
|
+
metadata: boolean;
|
|
12
|
+
fields: string[];
|
|
13
|
+
xProperty: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function resolveRef(schema: JSONSchema7, schemas: Record<string, JSONSchema7>, options: ResolveOptions): JSONSchema7;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
2
|
+
export type QueryParams = {
|
|
3
|
+
[key: string]: string | string[];
|
|
4
|
+
};
|
|
5
|
+
export declare const stdin: (characters: string) => Buffer;
|
|
6
|
+
export declare function addParam(url: string, key: string, val: string | string[]): string;
|
|
7
|
+
export declare function addParams(url: string, params: QueryParams): string;
|
|
8
|
+
declare enum Alphabet {
|
|
9
|
+
NORMAL = "normal",
|
|
10
|
+
URL = "url"
|
|
11
|
+
}
|
|
12
|
+
export declare function base64Encode(str: string, alphabet?: Alphabet): string;
|
|
13
|
+
export declare function base64DecodeToBuffer(str: string): Buffer;
|
|
14
|
+
export declare function base64Decode(str: string): string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shortenedImage(image: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function getSecondsDiff(startDate: string, endDate: string): number;
|
|
2
|
+
export declare function elapsedTime(seconds: number, i18nMap: {
|
|
3
|
+
min: string;
|
|
4
|
+
sec: string;
|
|
5
|
+
hr: string;
|
|
6
|
+
day: string;
|
|
7
|
+
}): {
|
|
8
|
+
diff?: undefined;
|
|
9
|
+
label?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
diff: number;
|
|
12
|
+
label: string;
|
|
13
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type FormatOptions = {
|
|
2
|
+
increment: number;
|
|
3
|
+
suffix: string | null;
|
|
4
|
+
firstSuffix: string | null;
|
|
5
|
+
startingExponent: number;
|
|
6
|
+
minExponent: number;
|
|
7
|
+
maxPrecision: number;
|
|
8
|
+
atLeastOne: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function formatSi(inValue: number, options?: Partial<FormatOptions>): string;
|
|
11
|
+
export declare function parseSi(inValue: string, increment?: number | null, allowFractional?: boolean): number;
|
|
12
|
+
export {};
|