mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-14 14:02:48 +00:00
Some UI changes
This commit is contained in:
parent
26d89730ef
commit
4beaa862e9
15 changed files with 244 additions and 141 deletions
|
@ -2,12 +2,14 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||||
|
|
||||||
|
|
||||||
Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey, bool isRow) {
|
||||||
switch (filterKey) {
|
switch (filterKey) {
|
||||||
case 'NotFilteredNotFound':
|
case 'NotFilteredNotFound':
|
||||||
return {
|
return {
|
||||||
'filtered': false,
|
'filtered': false,
|
||||||
'label': AppLocalizations.of(context)!.processed,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.processedRow
|
||||||
|
: AppLocalizations.of(context)!.processed,
|
||||||
'color': Colors.green,
|
'color': Colors.green,
|
||||||
'icon': Icons.verified_user_rounded,
|
'icon': Icons.verified_user_rounded,
|
||||||
};
|
};
|
||||||
|
@ -15,7 +17,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'NotFilteredWhiteList':
|
case 'NotFilteredWhiteList':
|
||||||
return {
|
return {
|
||||||
'filtered': false,
|
'filtered': false,
|
||||||
'label': AppLocalizations.of(context)!.processedWhitelist,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.processedWhitelistRow
|
||||||
|
: AppLocalizations.of(context)!.processedWhitelist,
|
||||||
'color': Colors.green,
|
'color': Colors.green,
|
||||||
'icon': Icons.verified_user_rounded,
|
'icon': Icons.verified_user_rounded,
|
||||||
};
|
};
|
||||||
|
@ -23,7 +27,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'NotFilteredError':
|
case 'NotFilteredError':
|
||||||
return {
|
return {
|
||||||
'filtered': false,
|
'filtered': false,
|
||||||
'label': AppLocalizations.of(context)!.processedError,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.processedErrorRow
|
||||||
|
: AppLocalizations.of(context)!.processedError,
|
||||||
'color': Colors.green,
|
'color': Colors.green,
|
||||||
'icon': Icons.verified_user_rounded,
|
'icon': Icons.verified_user_rounded,
|
||||||
};
|
};
|
||||||
|
@ -31,7 +37,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'FilteredBlackList':
|
case 'FilteredBlackList':
|
||||||
return {
|
return {
|
||||||
'filtered': true,
|
'filtered': true,
|
||||||
'label': AppLocalizations.of(context)!.blockedBlacklist,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.blockedBlacklistRow
|
||||||
|
: AppLocalizations.of(context)!.blockedBlacklist,
|
||||||
'color': Colors.red,
|
'color': Colors.red,
|
||||||
'icon': Icons.gpp_bad_rounded,
|
'icon': Icons.gpp_bad_rounded,
|
||||||
};
|
};
|
||||||
|
@ -39,7 +47,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'FilteredSafeBrowsing':
|
case 'FilteredSafeBrowsing':
|
||||||
return {
|
return {
|
||||||
'filtered': true,
|
'filtered': true,
|
||||||
'label': AppLocalizations.of(context)!.blockedSafeBrowsing,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.blockedSafeBrowsingRow
|
||||||
|
: AppLocalizations.of(context)!.blockedSafeBrowsing,
|
||||||
'color': Colors.red,
|
'color': Colors.red,
|
||||||
'icon': Icons.gpp_bad_rounded,
|
'icon': Icons.gpp_bad_rounded,
|
||||||
};
|
};
|
||||||
|
@ -47,7 +57,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'FilteredParental':
|
case 'FilteredParental':
|
||||||
return {
|
return {
|
||||||
'filtered': true,
|
'filtered': true,
|
||||||
'label': AppLocalizations.of(context)!.blockedParental,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.blockedParentalRow
|
||||||
|
: AppLocalizations.of(context)!.blockedParental,
|
||||||
'color': Colors.red,
|
'color': Colors.red,
|
||||||
'icon': Icons.gpp_bad_rounded,
|
'icon': Icons.gpp_bad_rounded,
|
||||||
};
|
};
|
||||||
|
@ -55,7 +67,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'FilteredInvalid':
|
case 'FilteredInvalid':
|
||||||
return {
|
return {
|
||||||
'filtered': true,
|
'filtered': true,
|
||||||
'label': AppLocalizations.of(context)!.blockedInvalid,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.blockedInvalidRow
|
||||||
|
: AppLocalizations.of(context)!.blockedInvalid,
|
||||||
'color': Colors.red,
|
'color': Colors.red,
|
||||||
'icon': Icons.gpp_bad_rounded,
|
'icon': Icons.gpp_bad_rounded,
|
||||||
};
|
};
|
||||||
|
@ -63,7 +77,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'FilteredSafeSearch':
|
case 'FilteredSafeSearch':
|
||||||
return {
|
return {
|
||||||
'filtered': true,
|
'filtered': true,
|
||||||
'label': AppLocalizations.of(context)!.blockedSafeSearch,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.blockedSafeSearchRow
|
||||||
|
: AppLocalizations.of(context)!.blockedSafeSearch,
|
||||||
'color': Colors.red,
|
'color': Colors.red,
|
||||||
'icon': Icons.gpp_bad_rounded,
|
'icon': Icons.gpp_bad_rounded,
|
||||||
};
|
};
|
||||||
|
@ -71,7 +87,9 @@ Map<String, dynamic> getFilteredStatus(BuildContext context, String filterKey) {
|
||||||
case 'FilteredBlockedService':
|
case 'FilteredBlockedService':
|
||||||
return {
|
return {
|
||||||
'filtered': true,
|
'filtered': true,
|
||||||
'label': AppLocalizations.of(context)!.blockedService,
|
'label': isRow == true
|
||||||
|
? AppLocalizations.of(context)!.blockedServiceRow
|
||||||
|
: AppLocalizations.of(context)!.blockedService,
|
||||||
'color': Colors.red,
|
'color': Colors.red,
|
||||||
'icon': Icons.gpp_bad_rounded,
|
'icon': Icons.gpp_bad_rounded,
|
||||||
};
|
};
|
||||||
|
|
|
@ -109,15 +109,24 @@
|
||||||
"restartAppTakeEffect": "Restart the application",
|
"restartAppTakeEffect": "Restart the application",
|
||||||
"loadingLogs": "Loading logs...",
|
"loadingLogs": "Loading logs...",
|
||||||
"logsNotLoaded": "Logs list could not be loaded",
|
"logsNotLoaded": "Logs list could not be loaded",
|
||||||
"processed": "Processed (no list)",
|
"processed": "Processed\nNo list",
|
||||||
"blockedBlacklist": "Blocked (blacklist)",
|
"processedRow": "Processed (no list)",
|
||||||
"blockedSafeBrowsing": "Blocked (safe browsing)",
|
"blockedBlacklist": "Blocked\nBlacklist",
|
||||||
"blockedParental": "Blocked (parental filtering)",
|
"blockedBlacklistRow": "Blocked (blacklist)",
|
||||||
"blockedInvalid": "Blocked (invalid)",
|
"blockedSafeBrowsing": "Blocked\nSafe browsing",
|
||||||
"blockedSafeSearch": "Blocked (safe search)",
|
"blockedSafeBrowsingRow": "Blocked (safe browsing)",
|
||||||
"blockedService": "Blocked (blocked service)",
|
"blockedParental": "Blocked\nParental filtering",
|
||||||
"processedWhitelist": "Processed (whitelist)",
|
"blockedParentalRow": "Blocked (parental filtering)",
|
||||||
"processedError": "Processed (error)",
|
"blockedInvalid": "Blocked\nInvalid",
|
||||||
|
"blockedInvalidRow": "Blocked (invalid)",
|
||||||
|
"blockedSafeSearch": "Blocked\nSafe search",
|
||||||
|
"blockedSafeSearchRow": "Blocked (safe search)",
|
||||||
|
"blockedService": "Blocked\nBlocked service",
|
||||||
|
"blockedServiceRow": "Blocked (blocked service)",
|
||||||
|
"processedWhitelist": "Processed\nWhitelist",
|
||||||
|
"processedWhitelistRow": "Processed (whitelist)",
|
||||||
|
"processedError": "Processed\nError",
|
||||||
|
"processedErrorRow": "Processed (error)",
|
||||||
"rewrite": "Rewrite",
|
"rewrite": "Rewrite",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"result": "Result",
|
"result": "Result",
|
||||||
|
|
|
@ -109,15 +109,24 @@
|
||||||
"restartAppTakeEffect": "Reinicia la aplicación para que se apliquen los cambios.",
|
"restartAppTakeEffect": "Reinicia la aplicación para que se apliquen los cambios.",
|
||||||
"loadingLogs": "Cargando registros...",
|
"loadingLogs": "Cargando registros...",
|
||||||
"logsNotLoaded": "No se pudieron cargar los registros",
|
"logsNotLoaded": "No se pudieron cargar los registros",
|
||||||
"processed": "Procesada (sin lista)",
|
"processed": "Procesada\nSin lista",
|
||||||
"blockedBlacklist": "Bloqueada (lista negra)",
|
"processedRow": "Procesada (sin lista)",
|
||||||
"blockedSafeBrowsing": "Bloqueada (navegación segura)",
|
"blockedBlacklist": "Bloqueada\nLista negra",
|
||||||
"blockedParental": "Bloqueada (control parental)",
|
"blockedBlacklistRow": "Bloqueada (lista negra)",
|
||||||
"blockedInvalid": "Bloqueada (inválida)",
|
"blockedSafeBrowsing": "Bloqueada\nNavegación segura",
|
||||||
"blockedSafeSearch": "Bloqueada (búsqueda segura)",
|
"blockedSafeBrowsingRow": "Bloqueada (navegación segura)",
|
||||||
"blockedService": "Bloqueada (servicio bloqueado)",
|
"blockedParental": "Bloqueada\nCcontrol parental",
|
||||||
"processedWhitelist": "Procesada (lista blanca)",
|
"blockedParentalRow": "Bloqueada (control parental)",
|
||||||
"processedError": "Procesada (error)",
|
"blockedInvalid": "Bloqueada\nInválida",
|
||||||
|
"blockedInvalidRow": "Bloqueada (inválida)",
|
||||||
|
"blockedSafeSearch": "Bloqueada\nBúsqueda segura",
|
||||||
|
"blockedSafeSearchRow": "Bloqueada (búsqueda segura)",
|
||||||
|
"blockedService": "Bloqueada\nServicio bloqueado",
|
||||||
|
"blockedServiceRow": "Bloqueada (servicio bloqueado)",
|
||||||
|
"processedWhitelist": "Procesada\nLista blanca",
|
||||||
|
"processedWhitelistRow": "Procesada (lista blanca)",
|
||||||
|
"processedError": "Procesada\nError",
|
||||||
|
"processedErrorRow": "Procesada (error)",
|
||||||
"rewrite": "Reescrita",
|
"rewrite": "Reescrita",
|
||||||
"status": "Estado",
|
"status": "Estado",
|
||||||
"result": "Resultado",
|
"result": "Resultado",
|
||||||
|
|
|
@ -214,7 +214,13 @@ class _AddedListState extends State<AddedList> {
|
||||||
onTap: () => openClientModal(widget.data[index]),
|
onTap: () => openClientModal(widget.data[index]),
|
||||||
title: Padding(
|
title: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 5),
|
padding: const EdgeInsets.only(bottom: 5),
|
||||||
child: Text(widget.data[index].name),
|
child: Text(
|
||||||
|
widget.data[index].name,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18,
|
||||||
|
fontWeight: FontWeight.normal
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
subtitle: Column(
|
subtitle: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
|
|
@ -51,7 +51,11 @@ class ClientsList extends StatelessWidget {
|
||||||
title: Text(
|
title: Text(
|
||||||
data[index].name != ''
|
data[index].name != ''
|
||||||
? data[index].name!
|
? data[index].name!
|
||||||
: data[index].ip
|
: data[index].ip,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.normal
|
||||||
|
),
|
||||||
),
|
),
|
||||||
subtitle: data[index].name != ''
|
subtitle: data[index].name != ''
|
||||||
? Text(
|
? Text(
|
||||||
|
|
|
@ -56,7 +56,7 @@ class _CheckHostModalState extends State<CheckHostModal> {
|
||||||
final result = await checkHostFiltered(server: serversProvider.selectedServer!, host: domainController.text);
|
final result = await checkHostFiltered(server: serversProvider.selectedServer!, host: domainController.text);
|
||||||
|
|
||||||
if (result['result'] == 'success') {
|
if (result['result'] == 'success') {
|
||||||
final status = getFilteredStatus(context, result['data']['reason']);
|
final status = getFilteredStatus(context, result['data']['reason'], true);
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() => resultWidget = Row(
|
setState(() => resultWidget = Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|
|
@ -105,6 +105,16 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool checkIfComment(String value) {
|
||||||
|
final regex = RegExp(r'^(!|#).*$');
|
||||||
|
if (regex.hasMatch(value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
switch (widget.loadStatus) {
|
switch (widget.loadStatus) {
|
||||||
case 0:
|
case 0:
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
|
@ -134,7 +144,17 @@ class _CustomRulesListState extends State<CustomRulesList> {
|
||||||
padding: const EdgeInsets.only(top: 0),
|
padding: const EdgeInsets.only(top: 0),
|
||||||
itemCount: widget.data.length,
|
itemCount: widget.data.length,
|
||||||
itemBuilder: (context, index) => ListTile(
|
itemBuilder: (context, index) => ListTile(
|
||||||
title: Text(widget.data[index]),
|
title: Text(
|
||||||
|
widget.data[index],
|
||||||
|
style: TextStyle(
|
||||||
|
color: checkIfComment(widget.data[index]) == true
|
||||||
|
? Theme.of(context).brightness == Brightness.light
|
||||||
|
? const Color.fromRGBO(100, 100, 100, 1)
|
||||||
|
: const Color.fromRGBO(200, 200, 200, 1)
|
||||||
|
: null,
|
||||||
|
fontWeight: FontWeight.normal,
|
||||||
|
),
|
||||||
|
),
|
||||||
trailing: IconButton(
|
trailing: IconButton(
|
||||||
onPressed: () => openRemoveCustomRuleModal(widget.data[index]),
|
onPressed: () => openRemoveCustomRuleModal(widget.data[index]),
|
||||||
icon: const Icon(Icons.delete)
|
icon: const Icon(Icons.delete)
|
||||||
|
|
|
@ -34,8 +34,7 @@ class FilterListTile extends StatelessWidget {
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.w500
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
|
|
|
@ -12,6 +12,7 @@ import 'package:adguard_home_manager/screens/filters/fab.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/list_details_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/list_details_modal.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/add_list_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/add_list_modal.dart';
|
||||||
import 'package:adguard_home_manager/screens/filters/delete_list_modal.dart';
|
import 'package:adguard_home_manager/screens/filters/delete_list_modal.dart';
|
||||||
|
import 'package:adguard_home_manager/widgets/custom_list_tile.dart';
|
||||||
|
|
||||||
import 'package:adguard_home_manager/services/http_requests.dart';
|
import 'package:adguard_home_manager/services/http_requests.dart';
|
||||||
import 'package:adguard_home_manager/functions/snackbar.dart';
|
import 'package:adguard_home_manager/functions/snackbar.dart';
|
||||||
|
@ -288,53 +289,18 @@ class _FiltersListState extends State<FiltersList> {
|
||||||
if (widget.data.isNotEmpty) ListView.builder(
|
if (widget.data.isNotEmpty) ListView.builder(
|
||||||
padding: const EdgeInsets.only(top: 0),
|
padding: const EdgeInsets.only(top: 0),
|
||||||
itemCount: widget.data.length,
|
itemCount: widget.data.length,
|
||||||
itemBuilder: (context, index) => Material(
|
itemBuilder: (context, index) => CustomListTile(
|
||||||
color: Colors.transparent,
|
title: widget.data[index].name,
|
||||||
child: InkWell(
|
subtitle: "${intFormat(widget.data[index].rulesCount, Platform.localeName)} ${AppLocalizations.of(context)!.enabledRules}",
|
||||||
onTap: () => openDetailsModal(widget.data[index]),
|
trailing: Icon(
|
||||||
child: Container(
|
widget.data[index].enabled == true
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
? Icons.check_circle_rounded
|
||||||
child: Row(
|
: Icons.cancel,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
color: widget.data[index].enabled == true
|
||||||
children: [
|
? Colors.green
|
||||||
Column(
|
: Colors.red,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
SizedBox(
|
|
||||||
width: MediaQuery.of(context).size.width-130,
|
|
||||||
child: Text(
|
|
||||||
widget.data[index].name,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
fontSize: 16
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 5),
|
|
||||||
Text(
|
|
||||||
"${intFormat(widget.data[index].rulesCount, Platform.localeName)} ${AppLocalizations.of(context)!.enabledRules}",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 14,
|
|
||||||
color: Theme.of(context).listTileTheme.iconColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
widget.data[index].enabled == true
|
|
||||||
? AppLocalizations.of(context)!.enabled
|
|
||||||
: AppLocalizations.of(context)!.disabled,
|
|
||||||
style: TextStyle(
|
|
||||||
color: widget.data[index].enabled == true
|
|
||||||
? Colors.green
|
|
||||||
: Colors.red,
|
|
||||||
fontWeight: FontWeight.w500
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
|
onTap: () => openDetailsModal(widget.data[index]),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (widget.data.isEmpty) if (widget.data.isEmpty) SizedBox(
|
if (widget.data.isEmpty) if (widget.data.isEmpty) SizedBox(
|
||||||
|
|
|
@ -130,13 +130,13 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
|
||||||
filterStatusListItem(
|
filterStatusListItem(
|
||||||
id: "processed",
|
id: "processed",
|
||||||
icon: Icons.verified_user_rounded,
|
icon: Icons.verified_user_rounded,
|
||||||
label: AppLocalizations.of(context)!.processed,
|
label: AppLocalizations.of(context)!.processedRow,
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
||||||
),
|
),
|
||||||
filterStatusListItem(
|
filterStatusListItem(
|
||||||
id: "whitelisted",
|
id: "whitelisted",
|
||||||
icon: Icons.verified_user_rounded,
|
icon: Icons.verified_user_rounded,
|
||||||
label: AppLocalizations.of(context)!.processedWhitelist,
|
label: AppLocalizations.of(context)!.processedWhitelistRow,
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
||||||
),
|
),
|
||||||
filterStatusListItem(
|
filterStatusListItem(
|
||||||
|
@ -148,19 +148,19 @@ class _FilterStatusModalState extends State<FilterStatusModal> {
|
||||||
filterStatusListItem(
|
filterStatusListItem(
|
||||||
id: "blocked_safebrowsing",
|
id: "blocked_safebrowsing",
|
||||||
icon: Icons.gpp_bad_rounded,
|
icon: Icons.gpp_bad_rounded,
|
||||||
label: AppLocalizations.of(context)!.blockedSafeBrowsing,
|
label: AppLocalizations.of(context)!.blockedSafeBrowsingRow,
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
||||||
),
|
),
|
||||||
filterStatusListItem(
|
filterStatusListItem(
|
||||||
id: "blocked_parental",
|
id: "blocked_parental",
|
||||||
icon: Icons.gpp_bad_rounded,
|
icon: Icons.gpp_bad_rounded,
|
||||||
label: AppLocalizations.of(context)!.blockedParental,
|
label: AppLocalizations.of(context)!.blockedParentalRow,
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
||||||
),
|
),
|
||||||
filterStatusListItem(
|
filterStatusListItem(
|
||||||
id: "safe_search",
|
id: "safe_search",
|
||||||
icon: Icons.gpp_bad_rounded,
|
icon: Icons.gpp_bad_rounded,
|
||||||
label: AppLocalizations.of(context)!.blockedSafeSearch,
|
label: AppLocalizations.of(context)!.blockedSafeSearchRow,
|
||||||
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
onChanged: (value) => setState(() => selectedResultStatus = value!)
|
||||||
),
|
),
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class LogDetailsModal extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Widget getResult() {
|
Widget getResult() {
|
||||||
final filter = getFilteredStatus(context, log.reason);
|
final filter = getFilteredStatus(context, log.reason, true);
|
||||||
return Text(
|
return Text(
|
||||||
filter['label'],
|
filter['label'],
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
@ -189,11 +189,11 @@ class LogDetailsModal extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
blockUnblock(log, getFilteredStatus(context, log.reason)['filtered'] == true ? 'unblock' : 'block');
|
blockUnblock(log, getFilteredStatus(context, log.reason, true)['filtered'] == true ? 'unblock' : 'block');
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
getFilteredStatus(context, log.reason)['filtered'] == true
|
getFilteredStatus(context, log.reason, true)['filtered'] == true
|
||||||
? AppLocalizations.of(context)!.unblockDomain
|
? AppLocalizations.of(context)!.unblockDomain
|
||||||
: AppLocalizations.of(context)!.blockDomain
|
: AppLocalizations.of(context)!.blockDomain
|
||||||
)
|
)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class LogListTile extends StatelessWidget {
|
||||||
final width = MediaQuery.of(context).size.width;
|
final width = MediaQuery.of(context).size.width;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
|
@ -38,8 +38,7 @@ class LogListTile extends StatelessWidget {
|
||||||
Text(
|
Text(
|
||||||
title,
|
title,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 16,
|
fontSize: 18,
|
||||||
fontWeight: FontWeight.w500
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 5),
|
const SizedBox(height: 5),
|
||||||
|
@ -47,7 +46,6 @@ class LogListTile extends StatelessWidget {
|
||||||
width: width-100,
|
width: width-100,
|
||||||
child: Text(
|
child: Text(
|
||||||
subtitle!,
|
subtitle!,
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
color: Theme.of(context).listTileTheme.iconColor,
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
|
|
@ -40,28 +40,30 @@ class LogTile extends StatelessWidget {
|
||||||
required Color color,
|
required Color color,
|
||||||
required String text
|
required String text
|
||||||
}) {
|
}) {
|
||||||
return Row(
|
return Flexible(
|
||||||
children: [
|
child: Column(
|
||||||
Icon(
|
children: [
|
||||||
icon,
|
Icon(
|
||||||
color: color,
|
icon,
|
||||||
size: 14,
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
Text(
|
|
||||||
text,
|
|
||||||
style: TextStyle(
|
|
||||||
color: color,
|
color: color,
|
||||||
fontWeight: FontWeight.bold,
|
size: 14,
|
||||||
fontSize: 12
|
),
|
||||||
),
|
const SizedBox(height: 5),
|
||||||
)
|
Text(
|
||||||
]
|
text,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: color,
|
||||||
|
fontSize: 12
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget generateLogStatus() {
|
Widget generateLogStatus() {
|
||||||
final filter = getFilteredStatus(context, log.reason);
|
final filter = getFilteredStatus(context, log.reason, false);
|
||||||
return logStatusWidget(
|
return logStatusWidget(
|
||||||
icon: filter['icon'],
|
icon: filter['icon'],
|
||||||
color: filter['color'],
|
color: filter['color'],
|
||||||
|
@ -148,7 +150,7 @@ class LogTile extends StatelessWidget {
|
||||||
onTap: openLogDetailsModal,
|
onTap: openLogDetailsModal,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.maxFinite,
|
width: double.maxFinite,
|
||||||
padding: const EdgeInsets.all(10),
|
padding: const EdgeInsets.symmetric(horizontal: 15, vertical: 15),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: index < length
|
border: index < length
|
||||||
? Border(
|
? Border(
|
||||||
|
@ -161,39 +163,110 @@ class LogTile extends StatelessWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
SizedBox(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
width: width-130,
|
||||||
children: [
|
child: Column(
|
||||||
generateLogStatus(),
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
const SizedBox(height: 10),
|
children: [
|
||||||
SizedBox(
|
Text(
|
||||||
width: width-100,
|
|
||||||
child: Text(
|
|
||||||
log.question.name,
|
log.question.name,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontWeight: FontWeight.w500,
|
fontSize: 18
|
||||||
fontSize: 16
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 10),
|
||||||
const SizedBox(height: 10),
|
if (log.client.length <= 15) Row(
|
||||||
SizedBox(
|
children: [
|
||||||
width: width-100,
|
...[
|
||||||
child: Text(
|
Icon(
|
||||||
log.client,
|
Icons.smartphone_rounded,
|
||||||
overflow: TextOverflow.ellipsis,
|
size: 16,
|
||||||
style: TextStyle(
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
color: Theme.of(context).listTileTheme.iconColor,
|
),
|
||||||
fontSize: 13
|
const SizedBox(width: 5),
|
||||||
),
|
SizedBox(
|
||||||
|
child: Text(
|
||||||
|
log.client,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
fontSize: 13
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
...[
|
||||||
|
Icon(
|
||||||
|
Icons.schedule_rounded,
|
||||||
|
size: 16,
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 5),
|
||||||
|
SizedBox(
|
||||||
|
child: Text(
|
||||||
|
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss'),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
fontSize: 13
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
],
|
||||||
),
|
),
|
||||||
)
|
if (log.client.length > 15) Column(
|
||||||
],
|
children: [
|
||||||
),
|
Row(
|
||||||
Text(
|
children: [
|
||||||
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss')
|
Icon(
|
||||||
|
Icons.smartphone_rounded,
|
||||||
|
size: 16,
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
SizedBox(
|
||||||
|
child: Text(
|
||||||
|
log.client,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
fontSize: 13
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.schedule_rounded,
|
||||||
|
size: 16,
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 15),
|
||||||
|
SizedBox(
|
||||||
|
child: Text(
|
||||||
|
formatTimestampUTCFromAPI(log.time, 'HH:mm:ss'),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Theme.of(context).listTileTheme.iconColor,
|
||||||
|
fontSize: 13
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 10),
|
||||||
|
generateLogStatus()
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -57,12 +57,12 @@ class _LogsFiltersModalWidgetState extends State<LogsFiltersModalWidget> {
|
||||||
final Map<String, String> translatedString = {
|
final Map<String, String> translatedString = {
|
||||||
"all": AppLocalizations.of(context)!.all,
|
"all": AppLocalizations.of(context)!.all,
|
||||||
"filtered": AppLocalizations.of(context)!.filtered,
|
"filtered": AppLocalizations.of(context)!.filtered,
|
||||||
"processed": AppLocalizations.of(context)!.processed,
|
"processed": AppLocalizations.of(context)!.processedRow,
|
||||||
"whitelisted": AppLocalizations.of(context)!.processedWhitelist,
|
"whitelisted": AppLocalizations.of(context)!.processedWhitelistRow,
|
||||||
"blocked": AppLocalizations.of(context)!.blocked,
|
"blocked": AppLocalizations.of(context)!.blocked,
|
||||||
"blocked_safebrowsing": AppLocalizations.of(context)!.blockedSafeBrowsing,
|
"blocked_safebrowsing": AppLocalizations.of(context)!.blockedSafeBrowsingRow,
|
||||||
"blocked_parental": AppLocalizations.of(context)!.blockedParental,
|
"blocked_parental": AppLocalizations.of(context)!.blockedParentalRow,
|
||||||
"safe_search": AppLocalizations.of(context)!.safeSearch,
|
"safe_search": AppLocalizations.of(context)!.blockedSafeSearchRow,
|
||||||
};
|
};
|
||||||
|
|
||||||
void selectTime() async {
|
void selectTime() async {
|
||||||
|
|
|
@ -27,6 +27,7 @@ class CustomListTile extends StatelessWidget {
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: padding ?? const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
padding: padding ?? const EdgeInsets.symmetric(horizontal: 20, vertical: 15),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Flexible(
|
Flexible(
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue