From 2859947a344cb2548779d91c155ce5b141197b4b Mon Sep 17 00:00:00 2001 From: shats Date: Sun, 7 Dec 2025 03:44:29 +0700 Subject: [PATCH] feat: Enhance FilterManager display logic by adding detailed community and gateway information, improving user experience with additional context for selected filters. --- frontend/src/FilterManager.jsx | 46 +++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/frontend/src/FilterManager.jsx b/frontend/src/FilterManager.jsx index c392eb3..75a33cc 100644 --- a/frontend/src/FilterManager.jsx +++ b/frontend/src/FilterManager.jsx @@ -1764,19 +1764,53 @@ function FilterManager() { /> -
- +
+ - {filter?.community || ''} +
+ {filter?.community || ''} + {(() => { + // Ищем community в справочнике + const communityData = communities.find(c => { + if (c.value === filter?.community) return true; + const normalized = c.value.includes(':') ? c.value : `${baseAS}:${c.value}`; + return normalized === filter?.community; + }); + if (communityData && (communityData.name || communityData.description)) { + return ( +
+ {communityData.name &&
{communityData.name}
} + {communityData.description &&
{communityData.description}
} +
+ ); + } + return null; + })()} +
-
- +
+ - {filter?.gateway || ''} +
+ {filter?.gateway || ''} + {(() => { + // Ищем gateway в списке шлюзов сервера + const gatewayData = selectedServerGateways.find(gw => gw.name === filter?.gateway); + if (gatewayData && (gatewayData.ip || gatewayData.comment)) { + return ( +
+ {gatewayData.ip &&
{gatewayData.ip}
} + {gatewayData.comment &&
{gatewayData.comment}
} +
+ ); + } + return null; + })()} +