mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-23 15:29:13 +00:00
Show client name on logs
This commit is contained in:
parent
9b1e36df5b
commit
2585826a29
2 changed files with 20 additions and 36 deletions
|
@ -7,6 +7,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|||
import 'package:adguard_home_manager/widgets/custom_checkbox_list_tile.dart';
|
||||
import 'package:adguard_home_manager/widgets/list_bottom_sheet.dart';
|
||||
|
||||
import 'package:adguard_home_manager/providers/status_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/clients_provider.dart';
|
||||
import 'package:adguard_home_manager/providers/logs_provider.dart';
|
||||
|
||||
|
@ -228,39 +229,25 @@ class _ListItem extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => onChanged(!checkboxActive),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 4,
|
||||
right: 12,
|
||||
bottom: 4
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).colorScheme.onSurface
|
||||
),
|
||||
),
|
||||
),
|
||||
Checkbox(
|
||||
value: checkboxActive,
|
||||
onChanged: (v) => onChanged(!checkboxActive),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(5)
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
final statusProvider = Provider.of<StatusProvider>(context);
|
||||
|
||||
String? name;
|
||||
try {
|
||||
name = statusProvider.serverStatus!.clients.firstWhere((c) => c.ids.contains(label)).name;
|
||||
} catch (e) {
|
||||
// ---- //
|
||||
}
|
||||
|
||||
return CustomCheckboxListTile(
|
||||
value: checkboxActive,
|
||||
onChanged: (v) => onChanged(v),
|
||||
title: label,
|
||||
subtitle: name,
|
||||
padding: const EdgeInsets.only(
|
||||
left: 24,
|
||||
top: 8,
|
||||
right: 12,
|
||||
bottom: 8
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -25,9 +25,6 @@ Future<Map<String, dynamic>> loadDb() async {
|
|||
)
|
||||
"""
|
||||
);
|
||||
},
|
||||
onUpgrade: (Database db, int oldVersion, int newVersion) async {
|
||||
|
||||
},
|
||||
onOpen: (Database db) async {
|
||||
await db.transaction((txn) async{
|
||||
|
|
Loading…
Add table
Reference in a new issue