networks: Add more options for IPv6 configuration method

- If an existing network manager connection with the missing values is ever
edited, it leads an awkward interface.

- So, complete the setting by allowing values supported by Network Manager.

Tests:

- Create new connections with the new values 'link-local' and 'disabled'.
Connection creation succeeds.

- Editing connection to these values works too.

- When 'link-local' or 'disabled' values are selected, primary and secondary DNS
fields are disabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2024-09-03 14:52:38 -07:00 committed by Veiko Aasa
parent 2abf2dc88c
commit a12a7fac22
No known key found for this signature in database
GPG Key ID: 478539CAE680674E
2 changed files with 6 additions and 0 deletions

View File

@ -107,10 +107,14 @@ class ConnectionForm(forms.Form):
('dhcp',
_('Automatic (DHCP only): Configure automatically, use Internet '
'connection from this network')),
('link-local',
_('Link-local: Configure automatically to use an address that is '
'only relevant to this network.')),
('manual',
_('Manual: Use manually specified parameters, use Internet '
'connection from this network')),
('ignore', _('Ignore: Ignore this addressing method')),
('disabled', _('Disabled: Disable IPv6 for this connection')),
])
ipv6_address = forms.CharField(
label=_('Address'), validators=[validators.validate_ipv6_address],

View File

@ -30,6 +30,8 @@ CONNECTION_METHOD_STRINGS = {
'manual': gettext_lazy('manual'),
'shared': gettext_lazy('shared'),
'link-local': gettext_lazy('link-local'),
'dhcp': gettext_lazy('dhcp'),
'ignore': gettext_lazy('ignore'),
}
# i18n for device.state