-
Notifications
You must be signed in to change notification settings - Fork 57
feat: autoscaler profiles #3103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,7 @@ | |
| const ManageCategoryButton = importComponentFromFELibrary('ManageCategoryButton', null, 'function') | ||
| const PodSpreadModal = importComponentFromFELibrary('PodSpreadModal', null, 'function') | ||
| const HibernationRulesModal = importComponentFromFELibrary('HibernationRulesModal', null, 'function') | ||
| const getClusterAutoscalerProfileMap = importComponentFromFELibrary('getClusterAutoscalerProfileMap', null, 'function') | ||
|
|
||
| const ClusterList = () => { | ||
| const { isSuperAdmin } = useMainContext() | ||
|
|
@@ -118,6 +119,12 @@ | |
| isSuperAdmin && !isK8sClient, | ||
| ) | ||
|
|
||
| const [, clusterNameVsAutoscalerProfile, , refetchProfileMap] = useAsync( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. useQuery?, and in enabled field, also check for getClusterAutoscalerProfileMap |
||
| getClusterAutoscalerProfileMap, | ||
| [], | ||
| !!window._env_.FEATURE_NODE_AUTOSCALER_ENABLE, | ||
|
Check failure on line 125 in src/Pages/GlobalConfigurations/ClustersAndEnvironments/ClusterList.tsx
|
||
| ) | ||
|
|
||
| const [showUnmappedEnvs, setShowUnmappedEnvs] = useState(false) | ||
|
|
||
| const clusterCount = clusterListResult?.length ?? 0 | ||
|
|
@@ -169,7 +176,7 @@ | |
| { | ||
| field: ClusterListFields.CLUSTER_NAME, | ||
| label: 'CLUSTER', | ||
| size: { fixed: 200 }, | ||
| size: { fixed: 180 }, | ||
| isSortable: true, | ||
| comparator: stringComparatorBySortOrder, | ||
| CellComponent: ClusterListCellComponent, | ||
|
|
@@ -180,7 +187,7 @@ | |
| { | ||
| field: ClusterListFields.ENV_COUNT, | ||
| label: 'ENVIRONMENTS', | ||
| size: { fixed: 150 }, | ||
| size: { fixed: 120 }, | ||
| isSortable: true, | ||
| comparator: numberComparatorBySortOrder, | ||
| CellComponent: ClusterListCellComponent, | ||
|
|
@@ -199,13 +206,23 @@ | |
| { | ||
| field: ClusterListFields.CLUSTER_CATEGORY, | ||
| label: 'CATEGORY', | ||
| size: { fixed: 150 }, | ||
| size: { fixed: 100 }, | ||
| isSortable: true, | ||
| comparator: stringComparatorBySortOrder, | ||
| CellComponent: ClusterListCellComponent, | ||
| } as TableColumnType<ClusterRowData, FiltersTypeEnum.STATE, {}>, | ||
| ] | ||
| : []), | ||
| ...(window._env_.FEATURE_NODE_AUTOSCALER_ENABLE && getClusterAutoscalerProfileMap | ||
|
Check failure on line 216 in src/Pages/GlobalConfigurations/ClustersAndEnvironments/ClusterList.tsx
|
||
| ? [ | ||
| { | ||
| field: ClusterListFields.AUTOSCALER_PROFILE, | ||
| label: 'AUTOSCALER PROFILE', | ||
| size: { fixed: 140 }, | ||
| CellComponent: ClusterListCellComponent, | ||
| }, | ||
| ] | ||
| : []), | ||
| { | ||
| field: ClusterListFields.SERVER_URL, | ||
| label: 'SERVER URL', | ||
|
|
@@ -233,6 +250,7 @@ | |
| clusterCategory: (category?.label as string) ?? '', | ||
| isVirtualCluster, | ||
| status, | ||
| autoscalerProfile: clusterNameVsAutoscalerProfile?.[clusterName] ?? null, | ||
| }, | ||
| } | ||
| }, | ||
|
|
@@ -293,6 +311,11 @@ | |
| }) | ||
| } | ||
|
|
||
| const handleCloseEditClusterModal = () => { | ||
| refetchProfileMap() | ||
| handleRedirectToClusterList() | ||
| } | ||
|
|
||
| const renderList = () => { | ||
| if (isClusterEnvListLoading) { | ||
| return <ClusterEnvLoader /> | ||
|
|
@@ -479,7 +502,7 @@ | |
| <EditCluster | ||
| clusterList={clusterListResult ?? []} | ||
| reloadClusterList={reloadClusterList} | ||
| handleClose={handleRedirectToClusterList} | ||
| handleClose={handleCloseEditClusterModal} | ||
| /> | ||
| } | ||
| /> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
catch? And maybe useQuery