mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-04 03:56:17 +00:00
method changed to useCallback (#1032)
height for horizontal scroll like in Ent Co-authored-by: Leon <> Co-authored-by: lirazyehezkel <61656597+lirazyehezkel@users.noreply.github.com>
This commit is contained in:
@@ -130,7 +130,7 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
|
|||||||
return [...resolved, ...unResolved]
|
return [...resolved, ...unResolved]
|
||||||
}, [serviceMapApiData])
|
}, [serviceMapApiData])
|
||||||
|
|
||||||
const filterServiceMap = (newProtocolsFilters?: any[], newServiceFilters?: string[]) => {
|
const filterServiceMap = useCallback((newProtocolsFilters?: any[], newServiceFilters?: string[]) => {
|
||||||
const filterProt = newProtocolsFilters || checkedProtocols
|
const filterProt = newProtocolsFilters || checkedProtocols
|
||||||
const filterService = newServiceFilters || checkedServices
|
const filterService = newServiceFilters || checkedServices
|
||||||
setCheckedProtocols(filterProt)
|
setCheckedProtocols(filterProt)
|
||||||
@@ -140,12 +140,14 @@ export const ServiceMapModal: React.FC<ServiceMapModalProps> = ({ isOpen, onClos
|
|||||||
edges: serviceMapApiData.edges?.filter(edge => filterProt.includes(edge.protocol.abbr)).map(mapEdgesDatatoGraph)
|
edges: serviceMapApiData.edges?.filter(edge => filterProt.includes(edge.protocol.abbr)).map(mapEdgesDatatoGraph)
|
||||||
}
|
}
|
||||||
setGraphData(newGraphData);
|
setGraphData(newGraphData);
|
||||||
}
|
}, [checkedProtocols, checkedServices, serviceMapApiData])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (checkedServices.length > 0) return // only after refresh
|
if (checkedServices.length > 0) return // only after refresh
|
||||||
filterServiceMap(checkedProtocols, getServicesForFilter.map(x => x.key).filter(serviceName => !Utils.isIpAddress(serviceName)))
|
filterServiceMap(checkedProtocols, getServicesForFilter.map(x => x.key).filter(serviceName => !Utils.isIpAddress(serviceName)))
|
||||||
}, [getServicesForFilter])
|
}, [getServicesForFilter, checkedServices])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getServiceMapData()
|
getServiceMapData()
|
||||||
|
@@ -139,6 +139,7 @@ button
|
|||||||
|
|
||||||
::-webkit-scrollbar
|
::-webkit-scrollbar
|
||||||
width: 6px
|
width: 6px
|
||||||
|
height: 6px
|
||||||
|
|
||||||
::-webkit-scrollbar-thumb
|
::-webkit-scrollbar-thumb
|
||||||
background-color: $light-blue-color
|
background-color: $light-blue-color
|
||||||
|
Reference in New Issue
Block a user