mirror of
https://github.com/dec0dOS/zero-ui.git
synced 2025-08-19 13:01:30 -07:00
parent
cb6c64799c
commit
a5bcff7d8c
1 changed files with 14 additions and 2 deletions
|
@ -4,8 +4,11 @@ import {
|
||||||
AccordionSummary,
|
AccordionSummary,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
Divider,
|
Divider,
|
||||||
|
FormControlLabel,
|
||||||
Grid,
|
Grid,
|
||||||
IconButton,
|
IconButton,
|
||||||
|
Radio,
|
||||||
|
RadioGroup,
|
||||||
TextField,
|
TextField,
|
||||||
Typography,
|
Typography,
|
||||||
} from "@material-ui/core";
|
} from "@material-ui/core";
|
||||||
|
@ -29,6 +32,7 @@ function NetworkMembers({ network }) {
|
||||||
const [filter, setFilter] = useState("");
|
const [filter, setFilter] = useState("");
|
||||||
const [filterActive, setFilterActive] = useState(false);
|
const [filterActive, setFilterActive] = useState(false);
|
||||||
const [filterInactive, setFilterInactive] = useState(false);
|
const [filterInactive, setFilterInactive] = useState(false);
|
||||||
|
const [sortBy, setSortBy] = useState("id");
|
||||||
|
|
||||||
const fetchData = useCallback(async () => {
|
const fetchData = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -175,14 +179,14 @@ function NetworkMembers({ network }) {
|
||||||
<RefreshIcon />
|
<RefreshIcon />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<Grid item sm={6}>
|
<Grid item sm={3}>
|
||||||
<Typography>Search (Addr/Name)</Typography>
|
<Typography>Search (Addr/Name)</Typography>
|
||||||
<TextField
|
<TextField
|
||||||
value={filter}
|
value={filter}
|
||||||
onChange={(e) => setFilter(e.target.value)}
|
onChange={(e) => setFilter(e.target.value)}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item sm="auto">
|
<Grid item sm={3}>
|
||||||
<Typography>Display Filter</Typography>
|
<Typography>Display Filter</Typography>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={filterActive}
|
checked={filterActive}
|
||||||
|
@ -197,6 +201,13 @@ function NetworkMembers({ network }) {
|
||||||
/>
|
/>
|
||||||
<span>Inactive</span>
|
<span>Inactive</span>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid item sm={3}>
|
||||||
|
<Typography>Sort by</Typography>
|
||||||
|
<RadioGroup value={sortBy} onChange={(e) => setSortBy(e.target.value)}>
|
||||||
|
<FormControlLabel value="name" control={<Radio />} label="Name" />
|
||||||
|
<FormControlLabel value="id" control={<Radio />} label="Address" />
|
||||||
|
</RadioGroup>
|
||||||
|
</Grid>
|
||||||
<Divider />
|
<Divider />
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
|
@ -212,6 +223,7 @@ function NetworkMembers({ network }) {
|
||||||
(filterInactive ? x.online === 0 : true)
|
(filterInactive ? x.online === 0 : true)
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
.sort((a, b) => a[sortBy].localeCompare(b[sortBy]))
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue