mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-25 08:16:06 +00:00
Added condition ipv4
This commit is contained in:
parent
a753774cae
commit
b48c2a8d3b
1 changed files with 94 additions and 92 deletions
|
@ -219,7 +219,7 @@ class _DhcpWidgetState extends State<DhcpWidget> {
|
||||||
final result = await saveDhcpConfig(server: serversProvider.selectedServer!, data: {
|
final result = await saveDhcpConfig(server: serversProvider.selectedServer!, data: {
|
||||||
"enabled": enabled,
|
"enabled": enabled,
|
||||||
"interface_name": selectedInterface!.name,
|
"interface_name": selectedInterface!.name,
|
||||||
"v4": {
|
if (selectedInterface!.ipv4Addresses.isNotEmpty) "v4": {
|
||||||
"gateway_ip": ipv4GatewayController.text,
|
"gateway_ip": ipv4GatewayController.text,
|
||||||
"subnet_mask": ipv4SubnetMaskController.text,
|
"subnet_mask": ipv4SubnetMaskController.text,
|
||||||
"range_start": ipv4StartRangeController.text,
|
"range_start": ipv4StartRangeController.text,
|
||||||
|
@ -391,6 +391,7 @@ class _DhcpWidgetState extends State<DhcpWidget> {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (selectedInterface!.ipv4Addresses.isNotEmpty) ...[
|
||||||
SectionLabel(
|
SectionLabel(
|
||||||
label: AppLocalizations.of(context)!.ipv4settings,
|
label: AppLocalizations.of(context)!.ipv4settings,
|
||||||
),
|
),
|
||||||
|
@ -400,7 +401,7 @@ class _DhcpWidgetState extends State<DhcpWidget> {
|
||||||
controller: ipv4StartRangeController,
|
controller: ipv4StartRangeController,
|
||||||
onChanged: (value) => validateIpV4(value, 'ipv4StartRangeError', AppLocalizations.of(context)!.ipNotValid),
|
onChanged: (value) => validateIpV4(value, 'ipv4StartRangeError', AppLocalizations.of(context)!.ipNotValid),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixIcon: const Icon(Icons.skip_next_rounded),
|
prefixIcon: const Icon(Icons.skip_previous_rounded),
|
||||||
border: const OutlineInputBorder(
|
border: const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(10)
|
Radius.circular(10)
|
||||||
|
@ -419,7 +420,7 @@ class _DhcpWidgetState extends State<DhcpWidget> {
|
||||||
controller: ipv4EndRangeController,
|
controller: ipv4EndRangeController,
|
||||||
onChanged: (value) => validateIpV4(value, 'ipv4EndRangeError', AppLocalizations.of(context)!.ipNotValid),
|
onChanged: (value) => validateIpV4(value, 'ipv4EndRangeError', AppLocalizations.of(context)!.ipNotValid),
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
prefixIcon: const Icon(Icons.skip_previous_rounded),
|
prefixIcon: const Icon(Icons.skip_next_rounded),
|
||||||
border: const OutlineInputBorder(
|
border: const OutlineInputBorder(
|
||||||
borderRadius: BorderRadius.all(
|
borderRadius: BorderRadius.all(
|
||||||
Radius.circular(10)
|
Radius.circular(10)
|
||||||
|
@ -495,6 +496,7 @@ class _DhcpWidgetState extends State<DhcpWidget> {
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
],
|
||||||
if (selectedInterface!.ipv6Addresses.isNotEmpty) ...[
|
if (selectedInterface!.ipv6Addresses.isNotEmpty) ...[
|
||||||
SectionLabel(
|
SectionLabel(
|
||||||
label: AppLocalizations.of(context)!.ipv6settings,
|
label: AppLocalizations.of(context)!.ipv6settings,
|
||||||
|
|
Loading…
Add table
Reference in a new issue