@devtron-labs/devtron-fe-common-lib 1.15.2-beta-5 → 1.15.2-beta-6

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,7 @@
1
1
  import { j as n, as as y, au as k, at as W } from "./@vendor-STJ9h0oI.js";
2
2
  import V, { forwardRef as J, useMemo as P } from "react";
3
3
  import K, { getDefaultRegistry as q } from "@rjsf/core";
4
- import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-bdKbJVSm.js";
4
+ import { T as F, j as N, c as v, b as S, a as Y, i as z, d as w, e as E, S as G } from "./@code-editor-DJTpk7Kj.js";
5
5
  import Q, { components as D } from "react-select";
6
6
  import { ReactComponent as X } from "./assets/ic-chevron-down.fc70d7a7.svg";
7
7
  import { getUiOptions as B, getTemplate as $, getSubmitButtonOptions as Z, ADDITIONAL_PROPERTY_FLAG as L, errorId as ee, englishStringTranslator as te, TranslatableString as ne, titleId as re, canExpand as se, deepEquals as ae } from "@rjsf/utils";
@@ -1,4 +1,7 @@
1
- import { RefObject } from 'react';
1
+ import { Dispatch, RefObject, SetStateAction } from 'react';
2
+ import { GroupBase } from 'react-select';
3
+ import { ServerErrors } from '../../Common/ServerError';
4
+ import { SelectPickerOptionType } from '../../Shared/Components';
2
5
  import { Nodes, NodeType } from '../../Shared/types';
3
6
  export interface GVKType {
4
7
  Group: string;
@@ -34,14 +37,37 @@ export interface K8sResourceListPayloadType {
34
37
  filter?: string;
35
38
  k8sRequest: ResourceListPayloadK8sRequestType;
36
39
  }
40
+ export declare enum ResourceRecommenderHeaderType {
41
+ NAME = "name",
42
+ NAMESPACE = "namespace",
43
+ KIND = "kind",
44
+ API_VERSION = "apiVersion",
45
+ CONTAINER_NAME = "containerName",
46
+ CPU_REQUEST = "cpuRequest",
47
+ CPU_LIMIT = "cpuLimit",
48
+ MEMORY_REQUEST = "memoryRequest",
49
+ MEMORY_LIMIT = "memoryLimit"
50
+ }
51
+ export type ResourceRecommenderHeaderWithStringValue = Extract<ResourceRecommenderHeaderType, ResourceRecommenderHeaderType.NAME | ResourceRecommenderHeaderType.NAMESPACE | ResourceRecommenderHeaderType.KIND | ResourceRecommenderHeaderType.API_VERSION | ResourceRecommenderHeaderType.CONTAINER_NAME>;
52
+ export type ResourceRecommenderHeaderWithRecommendation = Extract<ResourceRecommenderHeaderType, ResourceRecommenderHeaderType.CPU_REQUEST | ResourceRecommenderHeaderType.CPU_LIMIT | ResourceRecommenderHeaderType.MEMORY_REQUEST | ResourceRecommenderHeaderType.MEMORY_LIMIT>;
37
53
  export type K8sResourceDetailDataType = {
38
54
  [key: string]: string | number | object | boolean;
55
+ additionalMetadata?: Partial<Record<ResourceRecommenderHeaderWithRecommendation, {
56
+ current: {
57
+ value: string | 'none';
58
+ } | null;
59
+ recommended: {
60
+ value: string | 'none';
61
+ } | null;
62
+ delta: number | null;
63
+ }>>;
39
64
  };
40
65
  export interface K8sResourceDetailType {
41
66
  headers: string[];
42
67
  data: K8sResourceDetailDataType[];
43
68
  }
44
69
  export interface BulkSelectionActionWidgetProps {
70
+ isResourceRecommendationView: boolean;
45
71
  count: number;
46
72
  handleOpenBulkDeleteModal: () => void;
47
73
  handleClearBulkSelection: () => void;
@@ -49,11 +75,12 @@ export interface BulkSelectionActionWidgetProps {
49
75
  handleOpenUncordonNodeModal: () => void;
50
76
  handleOpenDrainNodeModal: () => void;
51
77
  handleOpenRestartWorkloadModal: () => void;
78
+ handleOpenApplyResourceRecommendationModal: () => void;
52
79
  parentRef: RefObject<HTMLDivElement>;
53
80
  showBulkRestartOption: boolean;
54
81
  showNodeListingOptions: boolean;
55
82
  }
56
- export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain';
83
+ export type RBBulkOperationType = 'restart' | 'delete' | 'cordon' | 'uncordon' | 'drain' | 'applyResourceRecommendation';
57
84
  export interface CreateResourceRequestBodyType {
58
85
  appId: string;
59
86
  clusterId: number;
@@ -65,6 +92,7 @@ export interface CreateResourceRequestBodyType {
65
92
  export interface ResourceManifestDTO {
66
93
  manifestResponse: {
67
94
  manifest: Record<string, unknown>;
95
+ recommendedManifest?: Record<string, unknown>;
68
96
  };
69
97
  secretViewAccess: boolean;
70
98
  }
@@ -108,4 +136,20 @@ export interface NodeActionRequest {
108
136
  version: string;
109
137
  kind: string;
110
138
  }
139
+ export interface GVKOptionValueType {
140
+ kind: string;
141
+ apiVersion: string;
142
+ }
143
+ export interface GetResourceRecommenderResourceListPropsType {
144
+ resourceList: K8sResourceDetailType;
145
+ reloadResourceListData: () => void;
146
+ setShowAbsoluteValuesInResourceRecommender: Dispatch<SetStateAction<boolean>>;
147
+ showAbsoluteValuesInResourceRecommender: boolean;
148
+ gvkOptions: GroupBase<SelectPickerOptionType<GVKOptionValueType>>[];
149
+ areGVKOptionsLoading: boolean;
150
+ reloadGVKOptions: () => void;
151
+ gvkOptionsError: ServerErrors;
152
+ isResourceListLoading: boolean;
153
+ resourceListError: ServerErrors;
154
+ }
111
155
  export {};
@@ -50,3 +50,5 @@ export declare const NODE_DRAIN_OPTIONS_CHECKBOX_CONFIG: {
50
50
  infoText: string;
51
51
  label: string;
52
52
  }[];
53
+ export declare const GVK_FILTER_KIND_QUERY_PARAM_KEY = "gvkFilterKind";
54
+ export declare const GVK_FILTER_API_VERSION_QUERY_PARAM_KEY = "gvkFilterApiVersion";
@@ -2,7 +2,7 @@ import { APIOptions, ResponseType } from '../../Common/Types';
2
2
  import { CreateResourceDTO, CreateResourcePayload, K8sResourceDetailType, K8sResourceListPayloadType, NodeActionRequest, ResourceListPayloadType, ResourceType } from './ResourceBrowser.Types';
3
3
  import { ClusterDetail, NodeCordonRequest } from './types';
4
4
  export declare const getK8sResourceList: (resourceListPayload: K8sResourceListPayloadType, signal?: AbortSignal) => Promise<ResponseType<K8sResourceDetailType>>;
5
- export declare const createNewResource: (resourceListPayload: CreateResourcePayload) => Promise<ResponseType<CreateResourceDTO[]>>;
5
+ export declare const createNewResource: (resourceListPayload: CreateResourcePayload, abortControllerRef?: APIOptions["abortControllerRef"]) => 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
8
  export declare const cordonNodeCapacity: (requestPayload: NodeCordonRequest, abortControllerRef?: APIOptions["abortControllerRef"]) => Promise<ResponseType>;
@@ -41,6 +41,7 @@ export declare const iconMap: {
41
41
  'ic-cloud-vms': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
42
42
  'ic-cluster': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
43
43
  'ic-code': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
44
+ 'ic-container-registry': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
44
45
  'ic-container': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
45
46
  'ic-cookr': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
46
47
  'ic-copy': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -77,6 +78,7 @@ export declare const iconMap: {
77
78
  'ic-filter': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
78
79
  'ic-flask': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
79
80
  'ic-folder-user': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
81
+ 'ic-gavel': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
80
82
  'ic-gear': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
81
83
  'ic-gift-gradient': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
82
84
  'ic-gift': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -122,6 +124,7 @@ export declare const iconMap: {
122
124
  'ic-memory': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
123
125
  'ic-microsoft': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
124
126
  'ic-minikube': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
127
+ 'ic-minus': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
125
128
  'ic-missing': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
126
129
  'ic-mobile': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
127
130
  'ic-monitoring': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -148,6 +151,7 @@ export declare const iconMap: {
148
151
  'ic-sort-descending': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
149
152
  'ic-sortable': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
150
153
  'ic-sparkle-color': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
154
+ 'ic-speedometer': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
151
155
  'ic-spinny': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
152
156
  'ic-spray-can': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
153
157
  'ic-stack': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -173,6 +177,7 @@ export declare const iconMap: {
173
177
  'ic-timer': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
174
178
  'ic-traffic-signal': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
175
179
  'ic-travclan': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
180
+ 'ic-two-cubes': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
176
181
  'ic-ubuntu': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
177
182
  'ic-unknown': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
178
183
  'ic-user-circle': import('react').FunctionComponent<import('react').SVGProps<SVGSVGElement>>;
@@ -5,7 +5,7 @@ import { Pair } from 'yaml';
5
5
  import { MaterialHistoryType } from '@Shared/Services/app.types';
6
6
  import { ApprovalConfigDataType, MaterialInfo, SortingOrder, UserApprovalConfigType, UserApprovalInfo } from '../Common';
7
7
  import { AggregatedNodes, PodMetadatum } from './Components';
8
- import { BorderConfigType, GetTimeDifferenceParamsType, GitTriggers, IntersectionChangeHandler, IntersectionOptions, PreventOutsideFocusProps, TargetPlatformItemDTO, TargetPlatformsDTO, WebhookEventNameType } from './types';
8
+ import { BorderConfigType, GetTimeDifferenceParamsType, GitTriggers, IntersectionChangeHandler, IntersectionOptions, Node, PreventOutsideFocusProps, TargetPlatformItemDTO, TargetPlatformsDTO, WebhookEventNameType } from './types';
9
9
  interface HighlightSearchTextProps {
10
10
  /**
11
11
  * The text to be highlighted
@@ -102,4 +102,5 @@ export declare const getClassNameForStickyHeaderWithShadow: (isStuck: boolean, t
102
102
  export declare const clearCookieOnLogout: () => void;
103
103
  export declare const getAppDetailsURL: (appId: number | string, envId?: number | string) => string;
104
104
  export declare const smoothScrollToTop: (scrollContainer: HTMLElement, targetPosition: number) => import('framer-motion').AnimationPlaybackControls;
105
+ export declare const getGroupVersionFromApiVersion: (apiVersion: string) => Pick<Node, "group" | "version">;
105
106
  export {};
@@ -97,7 +97,8 @@ export declare enum Nodes {
97
97
  Node = "Node",
98
98
  Overview = "Overview",
99
99
  MonitoringDashboard = "MonitoringDashboard",
100
- UpgradeCluster = "UpgradeCluster"
100
+ UpgradeCluster = "UpgradeCluster",
101
+ ResourceRecommender = "ResourceRecommender"
101
102
  }
102
103
  export type NodeType = keyof typeof Nodes;
103
104
  export interface Node {
@@ -1 +1 @@
1
- .rjsf-form-template__container>div:first-child{padding:20px;margin-right:28px}.rjsf-form-template__field,.rjsf-form-template__field--error{grid-template-columns:250px 1fr}.rjsf-form-template__field input.form__input,.rjsf-form-template__field--error input.form__input{padding:6px 8px}.rjsf-form-template__additional-fields{grid-template-columns:1fr 1fr}.rjsf-form-template__array-field-item{grid-template-columns:1fr auto}.rjsf-form-template__array-field-item>:first-child{margin:0}.rjsf-form-template__array-field-item legend{display:none}.rjsf-form-template__array-field-item:has(+div){margin-bottom:8px}.rjsf-form-template__additional-fields,.rjsf-form-template__array-field-item{z-index:0;background:transparent}.rjsf-form-template__additional-fields:has(>.remove-btn__container:hover):after,.rjsf-form-template__array-field-item:has(>.remove-btn__container:hover):after{background:var(--R50)}.rjsf-form-template__additional-fields:has(>.remove-btn__container):after,.rjsf-form-template__array-field-item:has(>.remove-btn__container):after{border-radius:4px;transform:translate(-50%,-50%);top:50%;left:50%;background:transparent;z-index:-1;position:absolute;height:calc(100% + 8px);width:calc(100% + 8px);content:"";transition:all .1s ease-out}.rjsf-form-template__additional-fields>.remove-btn__container:hover,.rjsf-form-template__array-field-item>.remove-btn__container:hover{fill:var(--R500)}.rjsf-form-template__additional-fields>.remove-btn__container:hover path,.rjsf-form-template__array-field-item>.remove-btn__container:hover path{fill:var(--R500)}.rjsf-form-template__additional-fields>.remove-btn__container,.rjsf-form-template__array-field-item>.remove-btn__container{transition:all .1s ease-out}
1
+ .rjsf-form-template__container>div:first-child{padding:20px;margin-right:28px}.rjsf-form-template__field,.rjsf-form-template__field--error{grid-template-columns:250px 1fr}.rjsf-form-template__field input.form__input,.rjsf-form-template__field--error input.form__input{padding:6px 8px}.rjsf-form-template__field input.form__input[readonly],.rjsf-form-template__field--error input.form__input[readonly]{opacity:.5}.rjsf-form-template__additional-fields{grid-template-columns:1fr 1fr}.rjsf-form-template__array-field-item{grid-template-columns:1fr auto}.rjsf-form-template__array-field-item>:first-child{margin:0}.rjsf-form-template__array-field-item legend{display:none}.rjsf-form-template__array-field-item:has(+div){margin-bottom:8px}.rjsf-form-template__additional-fields,.rjsf-form-template__array-field-item{z-index:0;background:transparent}.rjsf-form-template__additional-fields:has(>.remove-btn__container:hover):after,.rjsf-form-template__array-field-item:has(>.remove-btn__container:hover):after{background:var(--R50)}.rjsf-form-template__additional-fields:has(>.remove-btn__container):after,.rjsf-form-template__array-field-item:has(>.remove-btn__container):after{border-radius:4px;transform:translate(-50%,-50%);top:50%;left:50%;background:transparent;z-index:-1;position:absolute;height:calc(100% + 8px);width:calc(100% + 8px);content:"";transition:all .1s ease-out}.rjsf-form-template__additional-fields>.remove-btn__container:hover,.rjsf-form-template__array-field-item>.remove-btn__container:hover{fill:var(--R500)}.rjsf-form-template__additional-fields>.remove-btn__container:hover path,.rjsf-form-template__array-field-item>.remove-btn__container:hover path{fill:var(--R500)}.rjsf-form-template__additional-fields>.remove-btn__container,.rjsf-form-template__array-field-item>.remove-btn__container{transition:all .1s ease-out}
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 4.5v15m0-15 9.956 2.842a.75.75 0 0 1 .544.72v7.876a.75.75 0 0 1-.544.718L12 19.5m0-15L2.144 5.906a.75.75 0 0 0-.644.745v10.698a.75.75 0 0 0 .644.745L12 19.5M9 12H4.5m2.25-6.75v13.5" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m13.656 4.655 5.688 5.689M8.406 9.905l5.688 5.689m-1.719-1.72-6.656 6.657a1.594 1.594 0 0 1-2.25 0 1.594 1.594 0 0 1 0-2.25l6.656-6.656M5.471 7.718l6-6a.75.75 0 0 1 1.06 0l1.5 1.5a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06 0l-1.5-1.5a.75.75 0 0 1 0-1.06Zm8.25 8.25 6-6a.75.75 0 0 1 1.06 0l1.5 1.5a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06 0l-1.5-1.5a.75.75 0 0 1 0-1.06Z" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 12h16" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m12 7.01.01-.011M16 9.01l.01-.011M8 9.01l.01-.011M18 13.01l.01-.011M6 13.01l.01-.011M17 17.01l.01-.011M7 17.01l.01-.011M13 11l-.669 6.018M8.5 20.001H4A9.956 9.956 0 0 1 2 14C2 8.477 6.477 4 12 4s10 4.477 10 10c0 2.252-.744 4.33-2 6.001L15.5 20m-3.169-2.982a3 3 0 1 1-.663 5.964 3 3 0 0 1 .663-5.964Z" vector-effect="non-scaling-stroke"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24">
2
+ <path stroke="#3B444C" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="m9.06 10.276 5.872-3.335a.5.5 0 0 0-.187-.183l-5.5-3.094a.5.5 0 0 0-.49 0l-5.5 3.094A.5.5 0 0 0 3 7.193v6.165a.5.5 0 0 0 .255.436l5.5 3.094a.5.5 0 0 0 .245.064l.06-6.676Zm0 0L3.07 6.939m17.862 3.402a.5.5 0 0 1 .068.252v6.166a.5.5 0 0 1-.255.435l-5.5 3.094a.5.5 0 0 1-.245.064m5.932-10.011a.5.5 0 0 0-.187-.183l-5.5-3.094a.5.5 0 0 0-.49 0l-5.5 3.094a.5.5 0 0 0-.255.435v6.166a.5.5 0 0 0 .255.435l5.5 3.094a.5.5 0 0 0 .245.064m5.932-10.011-5.873 3.335M15 20.352l.06-6.676m0 0-5.99-3.337" vector-effect="non-scaling-stroke"/>
3
+ </svg>