mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-21 06:19:10 +00:00
Fix filter logs by added client
This commit is contained in:
parent
fd4daba2aa
commit
f27b17aad0
1 changed files with 7 additions and 5 deletions
|
@ -114,10 +114,12 @@ class _ClientsModalState extends State<ClientsModal> {
|
||||||
}
|
}
|
||||||
|
|
||||||
void searchAddedClient(_ClientLog client) {
|
void searchAddedClient(_ClientLog client) {
|
||||||
final notIps = client.ids?.where((e) => isIpAddress(e) == false).toList();
|
final ips = client.ids?.where((e) => isIpAddress(e) == true).toList();
|
||||||
if (notIps == null || notIps.isEmpty) return;
|
if (ips == null || ips.isEmpty) return;
|
||||||
logsProvider.setSearchText('"${notIps[0]}"');
|
logsProvider.setSearchText(ips[0]);
|
||||||
|
logsProvider.filterLogs();
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (widget.dialog == true) {
|
if (widget.dialog == true) {
|
||||||
|
@ -302,7 +304,7 @@ class _ClientsModalState extends State<ClientsModal> {
|
||||||
subtitle: _selectedList == 0 ? _filteredClients[index].name : _filteredClients[index].ids?.join(", "),
|
subtitle: _selectedList == 0 ? _filteredClients[index].name : _filteredClients[index].ids?.join(", "),
|
||||||
checkboxActive: logsProvider.selectedClients.contains(_filteredClients[index].ip),
|
checkboxActive: logsProvider.selectedClients.contains(_filteredClients[index].ip),
|
||||||
isAddedClient: _selectedList == 1,
|
isAddedClient: _selectedList == 1,
|
||||||
onSearchAddedClient: () => searchAddedClient(_filteredClients[index]),
|
onSearchAddedClient: _filteredClients[index].ids != null && _filteredClients[index].ids!.where((e) => isIpAddress(e) == true).isNotEmpty ? () => searchAddedClient(_filteredClients[index]) : null,
|
||||||
onChanged: (isSelected) {
|
onChanged: (isSelected) {
|
||||||
if (isSelected == true) {
|
if (isSelected == true) {
|
||||||
logsProvider.setSelectedClients([
|
logsProvider.setSelectedClients([
|
||||||
|
@ -376,7 +378,7 @@ class _ListItem extends StatelessWidget {
|
||||||
final bool checkboxActive;
|
final bool checkboxActive;
|
||||||
final void Function(bool) onChanged;
|
final void Function(bool) onChanged;
|
||||||
final bool isAddedClient;
|
final bool isAddedClient;
|
||||||
final void Function() onSearchAddedClient;
|
final void Function()? onSearchAddedClient;
|
||||||
|
|
||||||
const _ListItem({
|
const _ListItem({
|
||||||
required this.title,
|
required this.title,
|
||||||
|
|
Loading…
Add table
Reference in a new issue