mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-18 07:53:10 +00:00
Added option to show client name and processing time on logs
This commit is contained in:
parent
fb74be3e69
commit
fff50604a6
6 changed files with 146 additions and 9 deletions
|
@ -35,6 +35,26 @@ class GeneralSettings extends StatelessWidget {
|
|||
}
|
||||
}
|
||||
|
||||
Future updateShowNameTimeLogs(bool newStatus) async {
|
||||
final result = await appConfigProvider.setShowNameTimeLogs(newStatus);
|
||||
if (result == true) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.settingsUpdatedSuccessfully),
|
||||
backgroundColor: Colors.green,
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppLocalizations.of(context)!.cannotUpdateSettings),
|
||||
backgroundColor: Colors.red,
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(AppLocalizations.of(context)!.generalSettings) ,
|
||||
|
@ -58,6 +78,23 @@ class GeneralSettings extends StatelessWidget {
|
|||
right: 10
|
||||
)
|
||||
),
|
||||
CustomListTile(
|
||||
icon: Icons.more,
|
||||
title: AppLocalizations.of(context)!.nameTimeLogs,
|
||||
subtitle: AppLocalizations.of(context)!.nameTimeLogsDescription,
|
||||
trailing: Switch(
|
||||
value: appConfigProvider.showNameTimeLogs,
|
||||
onChanged: updateShowNameTimeLogs,
|
||||
activeColor: Theme.of(context).primaryColor,
|
||||
),
|
||||
onTap: () => updateShowNameTimeLogs(!appConfigProvider.showNameTimeLogs),
|
||||
padding: const EdgeInsets.only(
|
||||
top: 10,
|
||||
bottom: 10,
|
||||
left: 20,
|
||||
right: 10
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue