@devtron-labs/devtron-fe-common-lib 1.5.9 → 1.5.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.
- package/dist/{@code-editor-DL3a4lEb.js → @code-editor-DXxCcqw7.js} +4884 -4752
- package/dist/{@common-rjsf-BLBH_JtG.js → @common-rjsf-CdO37-4J.js} +1 -1
- package/dist/Common/RJSF/Form.d.ts +1 -1
- package/dist/Pages/ResourceBrowser/NodeDrainOptions.d.ts +3 -0
- package/dist/Pages/ResourceBrowser/ResourceBrowser.Types.d.ts +6 -1
- package/dist/Pages/ResourceBrowser/constants.d.ts +46 -0
- package/dist/Pages/ResourceBrowser/index.d.ts +1 -0
- package/dist/Pages/ResourceBrowser/service.d.ts +3 -1
- package/dist/Pages/ResourceBrowser/types.d.ts +24 -0
- package/dist/Shared/Components/ConfirmationModal/index.d.ts +1 -1
- package/dist/Shared/Components/ConfirmationModal/types.d.ts +7 -16
- package/dist/Shared/Components/ConfirmationModal/utils.d.ts +2 -2
- package/dist/assets/ic-medium-clean-brush.cb5ff0b0.svg +8 -0
- package/dist/assets/ic-medium-pause.4a3c2b4e.svg +3 -0
- package/dist/assets/ic-medium-play.6b657ef2.svg +3 -0
- package/dist/index.js +670 -664
- package/package.json +1 -1
@@ -2,7 +2,7 @@ import { j as t, J as $ } from "./@vendor-ROKJESOw.js";
|
|
2
2
|
import A, { forwardRef as E } from "react";
|
3
3
|
import L, { getDefaultRegistry as D } from "@rjsf/core";
|
4
4
|
import H from "@rjsf/validator-ajv8";
|
5
|
-
import { T as v, c as U, a as k, i as J, b as w, d as S } from "./@code-editor-
|
5
|
+
import { T as v, c as U, a as k, i as J, b as w, d as S } from "./@code-editor-DXxCcqw7.js";
|
6
6
|
import M, { components as B } from "react-select";
|
7
7
|
import { ReactComponent as W } from "./assets/ic-chevron-down.fc70d7a7.svg";
|
8
8
|
import { getUiOptions as C, getTemplate as I, getSubmitButtonOptions as V, ADDITIONAL_PROPERTY_FLAG as P, errorId as q, englishStringTranslator as K, TranslatableString as Y, titleId as z, canExpand as G, deepEquals as Q } from "@rjsf/utils";
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import { default as RJSF } from '@rjsf/core';
|
2
2
|
import { FormProps } from './types';
|
3
|
-
export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "
|
3
|
+
export declare const RJSFForm: import('react').ForwardRefExoticComponent<Pick<FormProps, "name" | "id" | "children" | "className" | "disabled" | "onFocus" | "onBlur" | "onChange" | "onSubmit" | "onError" | "target" | "action" | "autoComplete" | "tagName" | "method" | "noValidate" | "readonly" | "schema" | "uiSchema" | "formContext" | "formData" | "idPrefix" | "idSeparator" | "fields" | "templates" | "widgets" | "translateString" | "acceptcharset" | "acceptCharset" | "enctype" | "customValidate" | "extraErrors" | "extraErrorsBlockSubmit" | "noHtml5Validate" | "liveValidate" | "liveOmit" | "omitExtraData" | "showErrorList" | "transformErrors" | "focusOnFirstError" | "experimental_defaultFormStateBehavior" | "_internalFormWrapper"> & import('react').RefAttributes<RJSF<unknown, import('json-schema').JSONSchema7, import('@rjsf/utils').GenericObjectType>>>;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { AdditionalConfirmationModalOptionsProps, NodeDrainRequest } from './types';
|
2
|
+
declare const NodeDrainOptions: ({ optionsData, setOptionsData: setNodeDrainOptions, children, }: AdditionalConfirmationModalOptionsProps<NodeDrainRequest["nodeDrainOptions"]>) => JSX.Element;
|
3
|
+
export default NodeDrainOptions;
|
@@ -35,7 +35,7 @@ export interface K8sResourceListPayloadType {
|
|
35
35
|
k8sRequest: ResourceListPayloadK8sRequestType;
|
36
36
|
}
|
37
37
|
export type K8sResourceDetailDataType = {
|
38
|
-
[key: string]: string | number | object;
|
38
|
+
[key: string]: string | number | object | boolean;
|
39
39
|
};
|
40
40
|
export interface K8sResourceDetailType {
|
41
41
|
headers: string[];
|
@@ -45,10 +45,15 @@ export interface BulkSelectionActionWidgetProps {
|
|
45
45
|
count: number;
|
46
46
|
handleOpenBulkDeleteModal: () => void;
|
47
47
|
handleClearBulkSelection: () => void;
|
48
|
+
handleOpenCordonNodeModal: () => void;
|
49
|
+
handleOpenUncordonNodeModal: () => void;
|
50
|
+
handleOpenDrainNodeModal: () => void;
|
48
51
|
handleOpenRestartWorkloadModal: () => void;
|
49
52
|
parentRef: RefObject<HTMLDivElement>;
|
50
53
|
showBulkRestartOption: boolean;
|
54
|
+
showNodeListingOptions: boolean;
|
51
55
|
}
|
56
|
+
export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain';
|
52
57
|
export interface CreateResourceRequestBodyType {
|
53
58
|
appId: string;
|
54
59
|
clusterId: number;
|
@@ -1,2 +1,48 @@
|
|
1
1
|
import { SelectPickerOptionType } from '../../Shared/Components';
|
2
|
+
import { NodeDrainRequest } from './types';
|
2
3
|
export declare const ALL_NAMESPACE_OPTION: Readonly<Pick<SelectPickerOptionType<string>, 'value' | 'label'>>;
|
4
|
+
export declare const DRAIN_NODE_MODAL_MESSAGING: {
|
5
|
+
DrainIcon: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
6
|
+
GracePeriod: {
|
7
|
+
heading: string;
|
8
|
+
infoText: string;
|
9
|
+
};
|
10
|
+
DeleteEmptyDirectoryData: {
|
11
|
+
heading: string;
|
12
|
+
infoText: string;
|
13
|
+
};
|
14
|
+
DisableEviction: {
|
15
|
+
heading: string;
|
16
|
+
infoText: string;
|
17
|
+
};
|
18
|
+
ForceDrain: {
|
19
|
+
heading: string;
|
20
|
+
infoText: string;
|
21
|
+
};
|
22
|
+
IgnoreDaemonSets: {
|
23
|
+
heading: string;
|
24
|
+
infoText: string;
|
25
|
+
};
|
26
|
+
Actions: {
|
27
|
+
infoText: string;
|
28
|
+
drain: string;
|
29
|
+
draining: string;
|
30
|
+
cancel: string;
|
31
|
+
};
|
32
|
+
};
|
33
|
+
export declare const CORDON_NODE_MODAL_MESSAGING: {
|
34
|
+
UncordonIcon: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
35
|
+
CordonIcon: import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
|
36
|
+
cordonInfoText: string;
|
37
|
+
uncordonInfoText: string;
|
38
|
+
cordon: string;
|
39
|
+
uncordon: string;
|
40
|
+
cordoning: string;
|
41
|
+
uncordoning: string;
|
42
|
+
cancel: string;
|
43
|
+
};
|
44
|
+
export declare const NODE_DRAIN_OPTIONS_CHECKBOX_CONFIG: {
|
45
|
+
key: Exclude<keyof NodeDrainRequest['nodeDrainOptions'], 'gracePeriodSeconds'>;
|
46
|
+
infoText: string;
|
47
|
+
label: string;
|
48
|
+
}[];
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import { APIOptions, ResponseType } from '../../Common/Types';
|
2
2
|
import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType, NodeActionRequest, ResourceListPayloadType, ResourceType } from './ResourceBrowser.Types';
|
3
|
-
import { ClusterDetail } from './types';
|
3
|
+
import { ClusterDetail, NodeCordonRequest } from './types';
|
4
4
|
export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
|
5
5
|
export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
|
6
6
|
export declare const deleteResource: (resourceListPayload: ResourceListPayloadType, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType<ResourceType[]>>;
|
7
7
|
export declare const deleteNodeCapacity: (requestPayload: NodeActionRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
|
8
|
+
export declare const cordonNodeCapacity: (requestPayload: NodeCordonRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
|
9
|
+
export declare const drainNodeCapacity: (requestPayload: NodeActionRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
|
8
10
|
export declare const getClusterListRaw: () => Promise<ResponseType<ClusterDetail[]>>;
|
@@ -1,3 +1,5 @@
|
|
1
|
+
import { Dispatch, SetStateAction, ReactElement } from 'react';
|
2
|
+
import { NodeActionRequest } from './ResourceBrowser.Types';
|
1
3
|
export declare enum ClusterFiltersType {
|
2
4
|
ALL_CLUSTERS = "all",
|
3
5
|
HEALTHY = "healthy",
|
@@ -47,3 +49,25 @@ export interface ClusterDetail extends ClusterCapacityType {
|
|
47
49
|
nodeNames?: string[];
|
48
50
|
isVirtualCluster?: boolean;
|
49
51
|
}
|
52
|
+
interface NodeCordonOptions {
|
53
|
+
unschedulableDesired: boolean;
|
54
|
+
}
|
55
|
+
export interface NodeCordonRequest extends NodeActionRequest {
|
56
|
+
nodeCordonOptions: NodeCordonOptions;
|
57
|
+
}
|
58
|
+
interface NodeDrainOptions {
|
59
|
+
gracePeriodSeconds: number;
|
60
|
+
deleteEmptyDirData: boolean;
|
61
|
+
disableEviction: boolean;
|
62
|
+
force: boolean;
|
63
|
+
ignoreAllDaemonSets: boolean;
|
64
|
+
}
|
65
|
+
export interface NodeDrainRequest extends NodeActionRequest {
|
66
|
+
nodeDrainOptions: NodeDrainOptions;
|
67
|
+
}
|
68
|
+
export interface AdditionalConfirmationModalOptionsProps<T = unknown> {
|
69
|
+
optionsData: T;
|
70
|
+
setOptionsData: Dispatch<SetStateAction<T>>;
|
71
|
+
children?: ReactElement;
|
72
|
+
}
|
73
|
+
export {};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
export { default as ConfirmationModal } from './ConfirmationModal';
|
2
|
-
export { ConfirmationModalVariantType } from './types';
|
2
|
+
export { ConfirmationModalVariantType, type ConfirmationModalProps } from './types';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { PropsWithChildren, ReactElement, ReactNode, SyntheticEvent } from 'react';
|
2
2
|
import { ButtonProps } from '../Button';
|
3
3
|
export declare enum ConfirmationModalVariantType {
|
4
4
|
info = "info",
|
@@ -6,10 +6,10 @@ export declare enum ConfirmationModalVariantType {
|
|
6
6
|
warning = "warning",
|
7
7
|
custom = "custom"
|
8
8
|
}
|
9
|
-
type CommonButtonProps<isConfig extends boolean, isCustomVariant extends boolean> = Pick<ButtonProps, 'text'> & Partial<Pick<ButtonProps, 'startIcon' | 'endIcon'>> & (isConfig extends false ?
|
9
|
+
type CommonButtonProps<isConfig extends boolean, isCustomVariant extends boolean> = Pick<ButtonProps, 'text'> & Partial<Pick<ButtonProps, 'startIcon' | 'endIcon' | 'disabled'>> & (isConfig extends false ? {
|
10
10
|
onClick: (...args: Partial<Parameters<ButtonProps['onClick']>>) => void;
|
11
11
|
} : {}) & (isCustomVariant extends true ? Pick<ButtonProps, 'style'> : {});
|
12
|
-
interface
|
12
|
+
interface ConfirmationConfigType {
|
13
13
|
identifier: string;
|
14
14
|
confirmationKeyword: string;
|
15
15
|
}
|
@@ -23,33 +23,24 @@ type ButtonConfig<isConfig extends boolean, isCustomVariant extends boolean> = {
|
|
23
23
|
primaryButtonConfig?: never;
|
24
24
|
secondaryButtonConfig?: CommonButtonProps<isConfig, isCustomVariant>;
|
25
25
|
};
|
26
|
-
type CustomInputConfigOrChildrenType = {
|
27
|
-
customInputConfig: CustomInputConfig;
|
28
|
-
children?: never;
|
29
|
-
} | {
|
30
|
-
customInputConfig?: never;
|
31
|
-
children: ReactNode;
|
32
|
-
} | {
|
33
|
-
customInputConfig?: never;
|
34
|
-
children?: never;
|
35
|
-
};
|
36
26
|
type ButtonConfigAndVariantType<isConfig extends boolean> = {
|
37
27
|
variant: Exclude<ConfirmationModalVariantType, ConfirmationModalVariantType.custom>;
|
38
28
|
Icon?: never;
|
39
29
|
buttonConfig: ButtonConfig<isConfig, false>;
|
40
30
|
} | {
|
41
31
|
variant: ConfirmationModalVariantType.custom;
|
42
|
-
Icon:
|
32
|
+
Icon: ReactElement;
|
43
33
|
buttonConfig: ButtonConfig<isConfig, true>;
|
44
34
|
};
|
45
|
-
export type ConfirmationModalProps<isConfig extends boolean = false> = {
|
35
|
+
export type ConfirmationModalProps<isConfig extends boolean = false> = PropsWithChildren<{
|
46
36
|
title: string;
|
47
37
|
subtitle: ReactNode;
|
48
38
|
/**
|
49
39
|
* @default true
|
50
40
|
*/
|
51
41
|
shouldCloseOnEscape?: boolean;
|
52
|
-
|
42
|
+
confirmationConfig?: ConfirmationConfigType;
|
43
|
+
}> & ButtonConfigAndVariantType<isConfig> & (isConfig extends false ? {
|
53
44
|
handleClose: (e?: SyntheticEvent) => void;
|
54
45
|
showConfirmationModal: boolean;
|
55
46
|
} : {});
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
2
2
|
import { ConfirmationModalVariantType } from './types';
|
3
3
|
import { ButtonStyleType } from '../Button';
|
4
|
-
export declare const getIconFromVariant: (variant: ConfirmationModalVariantType) =>
|
4
|
+
export declare const getIconFromVariant: (variant: ConfirmationModalVariantType) => ReactElement;
|
5
5
|
export declare const getConfirmationLabel: (confirmationKeyword: string) => ReactNode;
|
6
6
|
export declare const getPrimaryButtonStyleFromVariant: (variant: ConfirmationModalVariantType) => ButtonStyleType;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<rect x="23.6924" y="8.50977" width="24.0788" height="6.12635" rx="1" transform="rotate(46.7118 23.6924 8.50977)" fill="#ABCFF3"/>
|
3
|
+
<path d="M34.5 18.5L42.155 12.372C42.9714 11.5178 43.4541 10.3843 43.4969 9.22094C43.5397 8.05759 43.139 6.95967 42.383 6.1687C41.627 5.37773 40.5777 4.9585 39.4658 5.00325C38.3539 5.04799 37.2705 5.55304 36.4541 6.40729L31 14" fill="#ABCFF3"/>
|
4
|
+
<path d="M34.5 18.5L42.155 12.372C42.9714 11.5178 43.4541 10.3843 43.4969 9.22094C43.5397 8.05759 43.139 6.95967 42.383 6.1687C41.627 5.37773 40.5777 4.9585 39.4658 5.00325C38.3539 5.04799 37.2705 5.55304 36.4541 6.40729L31 14M36.1121 30.6241L19.0094 12.7299M15.8739 26.1505L20.1496 21.677M25.0212 35.7212L11.8056 21.8939C11.5994 21.6782 11.4897 21.3791 11.5008 21.0625C11.5118 20.7459 11.6425 20.4377 11.8643 20.2057L22.734 8.83296C22.9557 8.60094 23.2503 8.46412 23.5529 8.4526C23.8555 8.44107 24.1413 8.55579 24.3475 8.77151L39.8954 25.0389C40.1016 25.2546 40.2112 25.5537 40.2002 25.8703C40.1892 26.1869 40.0584 26.4951 39.8366 26.7271L31.4753 35.4754C30.5883 36.4034 29.41 36.9507 28.1996 36.9968C26.9893 37.0429 25.846 36.5841 25.0212 35.7212Z" stroke="#0066CC" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
5
|
+
<path d="M9 30C7.34315 30 6 31.3431 6 33C6 34.6569 7.34315 36 9 36H14" stroke="#0066CC" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
6
|
+
<path d="M7.5 43C7.5 41.3431 8.84315 40 10.5 40H22" stroke="#0066CC" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
7
|
+
<circle cx="1" cy="1" r="0.5" transform="matrix(-1 0 0 1 18.5 35)" stroke="#0066CC"/>
|
8
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M19.4999 18V30M28.4999 18V30M42 24C42 33.9411 33.9411 42 24 42C14.0589 42 6 33.9411 6 24C6 14.0589 14.0589 6 24 6C33.9411 6 42 14.0589 42 24Z" fill="#F33E3E" fill-opacity="0.12" stroke="#F33E3E" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M11 38.4676V9.53238C11 7.97779 12.6959 7.01757 14.029 7.8174L38.1417 22.285C39.4364 23.0618 39.4364 24.9382 38.1417 25.715L14.029 40.1826C12.6959 40.9824 11 40.0222 11 38.4676Z" fill="#0066CC" fill-opacity="0.3" stroke="#0066CC" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" vector-effect="non-scaling-stroke" />
|
3
|
+
</svg>
|