File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed
airflow-core/src/airflow/ui/src Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change 1616 * specific language governing permissions and limitations
1717 * under the License.
1818 */
19- import { Flex , Link } from "@chakra-ui/react" ;
19+ import { Flex , Link , Box } from "@chakra-ui/react" ;
2020import { useTranslation } from "react-i18next" ;
2121import { Link as RouterLink } from "react-router-dom" ;
2222
@@ -54,13 +54,12 @@ export const PoolBar = ({
5454 alignItems = "center"
5555 bg = { `${ color } .solid` }
5656 color = "white"
57- flex = { flexValue }
5857 gap = { 1 }
5958 h = "100%"
6059 justifyContent = "center"
6160 px = { 1 }
62- py = { 0.5 }
6361 textAlign = "center"
62+ w = "100%"
6463 >
6564 { icon }
6665 { slotValue }
@@ -69,11 +68,13 @@ export const PoolBar = ({
6968 ) ;
7069
7170 return color !== "success" && "name" in pool ? (
72- < Link asChild key = { key } >
71+ < Link asChild display = "flex" flex = { flexValue } key = { key } >
7372 < RouterLink to = { `/task_instances?state=${ color } &pool=${ pool . name } ` } > { poolContent } </ RouterLink >
7473 </ Link >
7574 ) : (
76- poolContent
75+ < Box display = "flex" flex = { flexValue } key = { key } >
76+ { poolContent }
77+ </ Box >
7778 ) ;
7879 } ) }
7980 </ >
Original file line number Diff line number Diff line change @@ -37,7 +37,17 @@ export const PoolSummary = () => {
3737 const hasPoolsAccess = authLinks ?. authorized_menu_items . includes ( "Pools" ) ;
3838
3939 const pools = data ?. pools ;
40- const totalSlots = pools ?. reduce ( ( sum , pool ) => sum + pool . slots , 0 ) ?? 0 ;
40+ const totalSlots =
41+ pools ?. reduce (
42+ ( sum , pool ) =>
43+ sum +
44+ pool . running_slots +
45+ pool . queued_slots +
46+ pool . deferred_slots +
47+ pool . scheduled_slots +
48+ pool . open_slots ,
49+ 0 ,
50+ ) ?? 0 ;
4151 const aggregatePool : Slots = {
4252 deferred_slots : 0 ,
4353 open_slots : 0 ,
Original file line number Diff line number Diff line change @@ -64,7 +64,16 @@ const PoolBarCard = ({ pool }: PoolBarCardProps) => {
6464
6565 < Box margin = { 4 } >
6666 < Flex bg = "gray.muted" borderRadius = "md" h = "20px" overflow = "hidden" w = "100%" >
67- < PoolBar pool = { pool } totalSlots = { pool . slots } />
67+ < PoolBar
68+ pool = { pool }
69+ totalSlots = {
70+ pool . running_slots +
71+ pool . queued_slots +
72+ pool . deferred_slots +
73+ pool . scheduled_slots +
74+ pool . open_slots
75+ }
76+ />
6877 </ Flex >
6978 </ Box >
7079 </ Box >
You can’t perform that action at this time.
0 commit comments