mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
networks: Add 'disabled' IPv4 method, i18n
Disabled IPv4 method allows not configuring IPv4 entirely on network interfaces as required in some cases. Also, make sure to internationalize all the choices form values in network module. There were missed before.
This commit is contained in:
parent
04babacafa
commit
a9ca2d7cc3
@ -45,7 +45,8 @@ class ConnectionForm(forms.Form):
|
||||
label=_('Firewall Zone'),
|
||||
help_text=_('The firewall zone will control which services are \
|
||||
available over this interfaces. Select Internal only for trusted networks.'),
|
||||
choices=[('external', 'External'), ('internal', 'Internal')])
|
||||
choices=[('external', _('External')),
|
||||
('internal', _('Internal'))])
|
||||
ipv4_method = forms.ChoiceField(
|
||||
label=_('IPv4 Addressing Method'),
|
||||
help_text=format_lazy(
|
||||
@ -55,9 +56,10 @@ available over this interfaces. Select Internal only for trusted networks.'),
|
||||
'method will make {box_name} act as a router, configure '
|
||||
'clients on this network and share its Internet connection.'),
|
||||
box_name=ugettext_lazy(cfg.box_name)),
|
||||
choices=[('auto', 'Automatic (DHCP)'),
|
||||
('shared', 'Shared'),
|
||||
('manual', 'Manual')])
|
||||
choices=[('auto', _('Automatic (DHCP)')),
|
||||
('shared', _('Shared')),
|
||||
('manual', _('Manual')),
|
||||
('disabled', _('Disabled'))])
|
||||
ipv4_address = forms.CharField(
|
||||
label=_('Address'),
|
||||
validators=[validators.validate_ipv4_address],
|
||||
@ -195,14 +197,15 @@ class WifiForm(ConnectionForm):
|
||||
help_text=_('The visible name of the network.'))
|
||||
mode = forms.ChoiceField(
|
||||
label=_('Mode'),
|
||||
choices=[('infrastructure', 'Infrastructure'),
|
||||
('ap', 'Access Point'),
|
||||
('adhoc', 'Ad-hoc')])
|
||||
choices=[('infrastructure', _('Infrastructure')),
|
||||
('ap', _('Access Point')),
|
||||
('adhoc', _('Ad-hoc'))])
|
||||
auth_mode = forms.ChoiceField(
|
||||
label=_('Authentication Mode'),
|
||||
help_text=_('Select WPA if the wireless network is secured and \
|
||||
requires clients to have the password to connect.'),
|
||||
choices=[('wpa', 'WPA'), ('open', 'Open')])
|
||||
choices=[('wpa', _('WPA')),
|
||||
('open', _('Open'))])
|
||||
passphrase = forms.CharField(
|
||||
label=_('Passphrase'),
|
||||
validators=[validators.MinLengthValidator(8)],
|
||||
|
||||
@ -68,9 +68,12 @@
|
||||
ipv4_required(false, ['address']);
|
||||
ipv4_readonly(false, ['address', 'netmask']);
|
||||
ipv4_readonly(true, ['gateway', 'dns', 'second_dns']);
|
||||
} else {
|
||||
} else if ($("#id_ipv4_method").prop("value") == "auto") {
|
||||
ipv4_readonly(true, ['address', 'netmask', 'gateway']);
|
||||
ipv4_readonly(false, ['dns', 'second_dns']);
|
||||
} else {
|
||||
ipv4_readonly(true, ['address', 'netmask', 'gateway', 'dns',
|
||||
'second_dns']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user