From 206ffc9e9266d8fd1a50219d89266b3fac5521f4 Mon Sep 17 00:00:00 2001 From: xusongfu Date: Wed, 19 Jul 2023 15:22:49 +0800 Subject: [PATCH] fix: fix the hints of allocation pool When automatically assigning ip, modify the tips based on all subnet allocation pools Change-Id: I42fa46b1bf6c3af77d69152701dfd7ff5209a5a9 --- src/components/FormItem/NetworkSelect/index.jsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/FormItem/NetworkSelect/index.jsx b/src/components/FormItem/NetworkSelect/index.jsx index d2444b80..155762e5 100644 --- a/src/components/FormItem/NetworkSelect/index.jsx +++ b/src/components/FormItem/NetworkSelect/index.jsx @@ -299,8 +299,15 @@ export default class NetworkSelect extends React.Component { if (!item) { return null; } + const totalAllocationPools = []; + subnets.forEach((sub) => { + const { allocation_pools: pools = [] } = sub; + pools.forEach((pool) => { + totalAllocationPools.push(pool); + }); + }); const { allocation_pools: pools } = item; - const details = pools.map((pool, index) => ( + const details = totalAllocationPools.map((pool, index) => ( {pool.start}--{pool.end} @@ -332,7 +339,7 @@ export default class NetworkSelect extends React.Component { ); return ( - +