mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-05-15 22:42:50 +00:00
Bug fixes
This commit is contained in:
parent
109ebdf768
commit
b90d838ebc
7 changed files with 23 additions and 16 deletions
|
@ -55,8 +55,8 @@ String dhcpStatusToJson(DhcpStatus data) => json.encode(data.toJson());
|
|||
|
||||
class DhcpStatus {
|
||||
String? interfaceName;
|
||||
IpVersion v4;
|
||||
IpVersion v6;
|
||||
IpVersion? v4;
|
||||
IpVersion? v6;
|
||||
List<Lease> leases;
|
||||
List<Lease> staticLeases;
|
||||
bool enabled;
|
||||
|
@ -81,8 +81,8 @@ class DhcpStatus {
|
|||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"interface_name": interfaceName,
|
||||
"v4": v4.toJson(),
|
||||
"v6": v6.toJson(),
|
||||
"v4": v4 != null ? v4!.toJson() : null,
|
||||
"v6": v6 != null ? v6!.toJson() : null,
|
||||
"leases": List<Lease>.from(leases.map((x) => x)),
|
||||
"static_leases": List<Lease>.from(staticLeases.map((x) => x)),
|
||||
"enabled": enabled,
|
||||
|
|
|
@ -10,8 +10,8 @@ class DnsInfo {
|
|||
bool disableIpv6;
|
||||
String? upstreamMode;
|
||||
int? cacheSize;
|
||||
int cacheTtlMin;
|
||||
int cacheTtlMax;
|
||||
int? cacheTtlMin;
|
||||
int? cacheTtlMax;
|
||||
bool cacheOptimistic;
|
||||
bool resolveClients;
|
||||
bool usePrivatePtrResolvers;
|
||||
|
|
|
@ -32,7 +32,7 @@ class EncryptionData {
|
|||
final int? portDnsOverTls;
|
||||
final int? portDnsOverQuic;
|
||||
final int? portDnscrypt;
|
||||
final String dnscryptConfigFile;
|
||||
final String? dnscryptConfigFile;
|
||||
final bool allowUnencryptedDoh;
|
||||
final String certificateChain;
|
||||
final String privateKey;
|
||||
|
|
|
@ -61,11 +61,13 @@ class _DhcpScreenState extends State<DhcpScreen> {
|
|||
if (dhcpProvider.dhcp!.dhcpStatus.interfaceName != null && dhcpProvider.dhcp!.dhcpStatus.interfaceName != '') {
|
||||
try {selectedInterface = dhcpProvider.dhcp!.networkInterfaces.firstWhere((iface) => iface.name == dhcpProvider.dhcp!.dhcpStatus.interfaceName);} catch (_) {}
|
||||
enabled = dhcpProvider.dhcp!.dhcpStatus.enabled;
|
||||
ipv4StartRangeController.text = dhcpProvider.dhcp!.dhcpStatus.v4.rangeStart;
|
||||
ipv4EndRangeController.text = dhcpProvider.dhcp!.dhcpStatus.v4.rangeEnd ?? '';
|
||||
ipv4SubnetMaskController.text = dhcpProvider.dhcp!.dhcpStatus.v4.subnetMask ?? '';
|
||||
ipv4GatewayController.text = dhcpProvider.dhcp!.dhcpStatus.v4.gatewayIp ?? '';
|
||||
ipv4LeaseTimeController.text = dhcpProvider.dhcp!.dhcpStatus.v4.leaseDuration.toString();
|
||||
if (dhcpProvider.dhcp!.dhcpStatus.v4 != null) {
|
||||
ipv4StartRangeController.text = dhcpProvider.dhcp!.dhcpStatus.v4!.rangeStart;
|
||||
ipv4EndRangeController.text = dhcpProvider.dhcp!.dhcpStatus.v4!.rangeEnd ?? '';
|
||||
ipv4SubnetMaskController.text = dhcpProvider.dhcp!.dhcpStatus.v4!.subnetMask ?? '';
|
||||
ipv4GatewayController.text = dhcpProvider.dhcp!.dhcpStatus.v4!.gatewayIp ?? '';
|
||||
ipv4LeaseTimeController.text = dhcpProvider.dhcp!.dhcpStatus.v4!.leaseDuration.toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -63,6 +63,7 @@ class _GeneralSettingsState extends State<GeneralSettings> {
|
|||
isBeta: appConfigProvider.getAppInfo!.version.contains('beta'),
|
||||
);
|
||||
|
||||
if (!mounted) return;
|
||||
if (res != null) {
|
||||
setState(() => appUpdatesStatus = AppUpdatesStatus.available);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,8 @@ class CustomCombinedLineChart extends StatelessWidget {
|
|||
String chartDate(DateTime date) {
|
||||
String twoDigits(int number) => number.toString().padLeft(2, '0');
|
||||
|
||||
String shortMonth(String month) => month.length > 3 ? month.substring(0, 3) : month;
|
||||
|
||||
String getMonth(int month) {
|
||||
final List<String> months = [
|
||||
AppLocalizations.of(context)!.january,
|
||||
|
@ -45,10 +47,10 @@ class CustomCombinedLineChart extends StatelessWidget {
|
|||
}
|
||||
|
||||
if (daysInterval == true) {
|
||||
return "${date.day} ${getMonth(date.month).substring(0, 3)}";
|
||||
return "${date.day} ${shortMonth(getMonth(date.month))}";
|
||||
}
|
||||
else {
|
||||
return "${date.day} ${getMonth(date.month).substring(0, 3)} ${twoDigits(date.hour)}:00";
|
||||
return "${date.day} ${shortMonth(getMonth(date.month))} ${twoDigits(date.hour)}:00";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@ class CustomLineChart extends StatelessWidget {
|
|||
String chartDate(DateTime date) {
|
||||
String twoDigits(int number) => number.toString().padLeft(2, '0');
|
||||
|
||||
String shortMonth(String month) => month.length > 3 ? month.substring(0, 3) : month;
|
||||
|
||||
String getMonth(int month) {
|
||||
final List<String> months = [
|
||||
AppLocalizations.of(context)!.january,
|
||||
|
@ -44,10 +46,10 @@ class CustomLineChart extends StatelessWidget {
|
|||
}
|
||||
|
||||
if (daysInterval == true) {
|
||||
return "${date.day} ${getMonth(date.month).substring(0, 3)}";
|
||||
return "${date.day} ${shortMonth(getMonth(date.month))}";
|
||||
}
|
||||
else {
|
||||
return "${date.day} ${getMonth(date.month).substring(0, 3)} ${twoDigits(date.hour)}:00";
|
||||
return "${date.day} ${shortMonth(getMonth(date.month))} ${twoDigits(date.hour)}:00";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue