fix(ui): привязать фильтр интерфейса к серверу потоков
This commit is contained in:
1 parent
1d98a2a66e
commit
c563583ccb
3 files changed
+40
-10
No files matched your search
@@ -805,7 +805,10 @@ export default function TrafficPage() {
|
||||
const flowClients = useMemo(() => currentFlows?.clients ?? [], [currentFlows])
|
||||
const [analyticsRetry, setAnalyticsRetry] = useState(0)
|
||||
const [analyticsResult, setAnalyticsResult] = useState<{ key: string; data?: FlowAnalyticsDto; monthly?: FlowMonthlyDto; error?: string } | null>(null)
|
||||
const [flowIface, setFlowIface] = useState("__all__")
|
||||
const flowIfaceOwner = JSON.stringify([isLive, backendUrl, groupMode, flowScope, selectedId])
|
||||
const [flowIfaceSelection, setFlowIfaceSelection] = useState<{ owner: string; iface: string } | null>(null)
|
||||
const flowIface = flowIfaceSelection?.owner === flowIfaceOwner ? flowIfaceSelection.iface : "__all__"
|
||||
const setFlowIface = (iface: string) => setFlowIfaceSelection({ owner: flowIfaceOwner, iface })
|
||||
const [flowDedup, setFlowDedup] = useState(true)
|
||||
const [flowExcludeMesh, setFlowExcludeMesh] = useState(true)
|
||||
const [flowExcludeOverlay, setFlowExcludeOverlay] = useState(true)
|
||||
@@ -911,10 +914,6 @@ export default function TrafficPage() {
|
||||
return () => { cancelled = true }
|
||||
}, [isLive, effectiveMode, selectedId, range, flowScope, flowIface, flowDedup, flowExcludeMesh, flowExcludeOverlay, backendUrl, analyticsKey])
|
||||
|
||||
useEffect(() => {
|
||||
setFlowIface("__all__")
|
||||
}, [selectedId, flowScope])
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLive) return
|
||||
void listServers(backendUrl).then(setCatalogServers).catch(() => setCatalogServers([]))
|
||||
@@ -1264,7 +1263,7 @@ export default function TrafficPage() {
|
||||
key={card.id}
|
||||
card={card}
|
||||
selected={card.id === (selFlowCard?.id ?? selectedId)}
|
||||
onClick={() => setSelectedId(card.id)}
|
||||
onClick={() => { setFlowIface("__all__"); setSelectedId(card.id) }}
|
||||
/>
|
||||
))}
|
||||
{!liveBusy && !liveError && sortedFlowCards.length === 0 ? (
|
||||
|
||||
Reference in new issue
Block a user