feat: add "other" records category

This commit is contained in:
dettlaff 2024-10-10 05:30:38 +04:00 committed by Inex Code
parent e3f510c44b
commit 142249adec
3 changed files with 46 additions and 2 deletions

View file

@ -215,6 +215,8 @@
"services_subtitle": "Type “A” records required for each service.",
"email_title": "Email",
"email_subtitle": "Records necessary for secure email exchange.",
"other_title": "Other",
"other_subtitle": "Other records needed for the work of the SelfPrivacy",
"update_list": "Update list"
},
"backup": {
@ -725,4 +727,4 @@
"server_provider_unknown": "Unknown server provider",
"server_provider_unknown_description": "Your server provider is not supported by this app version."
}
}
}

View file

@ -140,7 +140,9 @@ class DnsRecordsCubit extends ServerConnectionDependentCubit<DnsRecordsState> {
isSatisfied: foundMatch,
category: pendingDnsRecord.type == 'A'
? DnsRecordsCategory.services
: DnsRecordsCategory.email,
: (pendingDnsRecord.type == 'CAA'
? DnsRecordsCategory.other
: DnsRecordsCategory.email),
),
);
}

View file

@ -198,6 +198,46 @@ class _DnsDetailsPageState extends State<DnsDetailsPage> {
],
),
),
const SizedBox(height: 16.0),
ListTile(
title: Text(
'domain.other_title'.tr(),
style: Theme.of(context).textTheme.headlineSmall!.copyWith(
color: Theme.of(context).colorScheme.secondary,
),
),
subtitle: Text(
'domain.other_subtitle'.tr(),
style: Theme.of(context).textTheme.labelMedium,
),
),
...dnsCubit.dnsRecords
.where(
(final dnsRecord) =>
dnsRecord.category == DnsRecordsCategory.other,
)
.map(
(final dnsRecord) => Column(
children: [
ListTile(
leading: Icon(
dnsRecord.isSatisfied
? Icons.check_circle_outline
: dnsCubit.dnsState == DnsRecordsStatus.refreshing
? Icons.refresh
: Icons.error_outline,
color: dnsRecord.isSatisfied
? goodColor
: dnsCubit.dnsState == DnsRecordsStatus.refreshing
? neutralColor
: errorColor,
),
title: Text(dnsRecord.displayName ?? dnsRecord.name),
subtitle: Text(dnsRecord.content),
),
],
),
),
],
);
}