This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 1543214abc9 Simplify poolbar total slots (#53869)
1543214abc9 is described below

commit 1543214abc96db214d747074220429a229a10d03
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Tue Jul 29 12:26:59 2025 +0200

    Simplify poolbar total slots (#53869)
---
 .../ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx       | 12 +-----------
 airflow-core/src/airflow/ui/src/pages/Pools/PoolBarCard.tsx  | 11 +----------
 2 files changed, 2 insertions(+), 21 deletions(-)

diff --git 
a/airflow-core/src/airflow/ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx 
b/airflow-core/src/airflow/ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx
index f6e31fa263b..8446542e402 100644
--- 
a/airflow-core/src/airflow/ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx
+++ 
b/airflow-core/src/airflow/ui/src/pages/Dashboard/PoolSummary/PoolSummary.tsx
@@ -37,17 +37,7 @@ export const PoolSummary = () => {
   const hasPoolsAccess = authLinks?.authorized_menu_items.includes("Pools");
 
   const pools = data?.pools;
-  const totalSlots =
-    pools?.reduce(
-      (sum, pool) =>
-        sum +
-        pool.running_slots +
-        pool.queued_slots +
-        pool.deferred_slots +
-        pool.scheduled_slots +
-        pool.open_slots,
-      0,
-    ) ?? 0;
+  const totalSlots = pools?.reduce((sum, pool) => sum + pool.slots, 0) ?? 0;
   const aggregatePool: Slots = {
     deferred_slots: 0,
     open_slots: 0,
diff --git a/airflow-core/src/airflow/ui/src/pages/Pools/PoolBarCard.tsx 
b/airflow-core/src/airflow/ui/src/pages/Pools/PoolBarCard.tsx
index 59a48a88722..2e0403592c3 100644
--- a/airflow-core/src/airflow/ui/src/pages/Pools/PoolBarCard.tsx
+++ b/airflow-core/src/airflow/ui/src/pages/Pools/PoolBarCard.tsx
@@ -64,16 +64,7 @@ const PoolBarCard = ({ pool }: PoolBarCardProps) => {
 
       <Box margin={4}>
         <Flex bg="gray.muted" borderRadius="md" h="20px" overflow="hidden" 
w="100%">
-          <PoolBar
-            pool={pool}
-            totalSlots={
-              pool.running_slots +
-              pool.queued_slots +
-              pool.deferred_slots +
-              pool.scheduled_slots +
-              pool.open_slots
-            }
-          />
+          <PoolBar pool={pool} totalSlots={pool.slots} />
         </Flex>
       </Box>
     </Box>

Reply via email to