Fix: sort devices list

This commit is contained in:
Dreamacro 2020-11-03 22:39:09 +08:00
parent 0c487ab496
commit 492042cf58

View File

@ -126,7 +126,7 @@ export default function Connections() {
), [connections]) ), [connections])
const devices = useMemo(() => { const devices = useMemo(() => {
const gb = groupBy(connections, 'metadata.sourceIP') const gb = groupBy(connections, 'metadata.sourceIP')
return Object.keys(gb).map(key => ({ label: key, number: gb[key].length })) return Object.keys(gb).map(key => ({ label: key, number: gb[key].length })).sort((a, b) => a.label.localeCompare(b.label))
}, [connections]) }, [connections])
// table // table