mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
networks: Minor indentation fixes
This commit is contained in:
parent
d1b20ac113
commit
da99a7cb9d
@ -148,8 +148,8 @@ def edit(request, uuid):
|
|||||||
if connection.get_connection_type() == '802-3-ethernet':
|
if connection.get_connection_type() == '802-3-ethernet':
|
||||||
network.edit_ethernet_connection(
|
network.edit_ethernet_connection(
|
||||||
connection, name, interface, zone, ipv4_method,
|
connection, name, interface, zone, ipv4_method,
|
||||||
ipv4_address, ipv4_netmask, ipv4_gateway,
|
ipv4_address, ipv4_netmask, ipv4_gateway, ipv4_dns,
|
||||||
ipv4_dns, ipv4_second_dns)
|
ipv4_second_dns)
|
||||||
elif connection.get_connection_type() == '802-11-wireless':
|
elif connection.get_connection_type() == '802-11-wireless':
|
||||||
ssid = form.cleaned_data['ssid']
|
ssid = form.cleaned_data['ssid']
|
||||||
mode = form.cleaned_data['mode']
|
mode = form.cleaned_data['mode']
|
||||||
@ -386,8 +386,8 @@ def add_wifi(request, ssid=None, interface_name=None):
|
|||||||
|
|
||||||
network.add_wifi_connection(
|
network.add_wifi_connection(
|
||||||
name, interface, zone, ssid, mode, auth_mode, passphrase,
|
name, interface, zone, ssid, mode, auth_mode, passphrase,
|
||||||
ipv4_method, ipv4_address, ipv4_netmask,
|
ipv4_method, ipv4_address, ipv4_netmask, ipv4_gateway,
|
||||||
ipv4_gateway, ipv4_dns, ipv4_second_dns)
|
ipv4_dns, ipv4_second_dns)
|
||||||
return redirect(reverse_lazy('networks:index'))
|
return redirect(reverse_lazy('networks:index'))
|
||||||
else:
|
else:
|
||||||
if form_data:
|
if form_data:
|
||||||
|
|||||||
@ -43,40 +43,40 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function($) {
|
(function($) {
|
||||||
|
|
||||||
if ($("#id_ipv4_method").prop("value") != "manual") {
|
if ($("#id_ipv4_method").prop("value") != "manual") {
|
||||||
$("#id_ipv4_address").prop("readOnly", true);
|
$("#id_ipv4_address").prop("readOnly", true);
|
||||||
$("#id_ipv4_netmask").prop("readOnly", true);
|
$("#id_ipv4_netmask").prop("readOnly", true);
|
||||||
$("#id_ipv4_gateway").prop("readOnly", true);
|
$("#id_ipv4_gateway").prop("readOnly", true);
|
||||||
}
|
|
||||||
$("#id_name").focus();
|
|
||||||
|
|
||||||
$("#id_ipv4_method").change(function() {
|
|
||||||
if ($("#id_ipv4_method").prop("value") == "manual") {
|
|
||||||
$("#id_ipv4_address").prop("readOnly", false);
|
|
||||||
$("#id_ipv4_address").prop("required", true);
|
|
||||||
$("#id_ipv4_netmask").prop("readOnly", false);
|
|
||||||
$("#id_ipv4_gateway").prop("readOnly", false);
|
|
||||||
} else {
|
|
||||||
$("#id_ipv4_address").val("");
|
|
||||||
$("#id_ipv4_address").prop("readOnly", true);
|
|
||||||
$("#id_ipv4_address").prop("required", false);
|
|
||||||
$("#id_ipv4_netmask").val("");
|
|
||||||
$("#id_ipv4_netmask").prop("readOnly", true);
|
|
||||||
$("#id_ipv4_gateway").val("");
|
|
||||||
$("#id_ipv4_gateway").prop("readOnly", true);
|
|
||||||
}
|
}
|
||||||
});
|
$("#id_name").focus();
|
||||||
|
|
||||||
$('#id_show_password').change(function() {
|
$("#id_ipv4_method").change(function() {
|
||||||
// Changing type attribute from password to text is prevented by
|
if ($("#id_ipv4_method").prop("value") == "manual") {
|
||||||
// most browsers. Making a new form field works.
|
$("#id_ipv4_address").prop("readOnly", false);
|
||||||
new_type = 'password';
|
$("#id_ipv4_address").prop("required", true);
|
||||||
if ($('#id_show_password').prop('checked'))
|
$("#id_ipv4_netmask").prop("readOnly", false);
|
||||||
new_type = 'text';
|
$("#id_ipv4_gateway").prop("readOnly", false);
|
||||||
|
} else {
|
||||||
|
$("#id_ipv4_address").val("");
|
||||||
|
$("#id_ipv4_address").prop("readOnly", true);
|
||||||
|
$("#id_ipv4_address").prop("required", false);
|
||||||
|
$("#id_ipv4_netmask").val("");
|
||||||
|
$("#id_ipv4_netmask").prop("readOnly", true);
|
||||||
|
$("#id_ipv4_gateway").val("");
|
||||||
|
$("#id_ipv4_gateway").prop("readOnly", true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
$('#id_password').replaceWith(
|
$('#id_show_password').change(function() {
|
||||||
$('#id_password').clone().attr('type', new_type));
|
// Changing type attribute from password to text is prevented by
|
||||||
});
|
// most browsers. Making a new form field works.
|
||||||
|
new_type = 'password';
|
||||||
|
if ($('#id_show_password').prop('checked'))
|
||||||
|
new_type = 'text';
|
||||||
|
|
||||||
|
$('#id_password').replaceWith(
|
||||||
|
$('#id_password').clone().attr('type', new_type));
|
||||||
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -43,40 +43,40 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function($) {
|
(function($) {
|
||||||
|
|
||||||
if ($("#id_ipv4_method").prop("value") != "manual") {
|
if ($("#id_ipv4_method").prop("value") != "manual") {
|
||||||
$("#id_ipv4_address").prop("readOnly", true);
|
$("#id_ipv4_address").prop("readOnly", true);
|
||||||
$("#id_ipv4_netmask").prop("readOnly", true);
|
$("#id_ipv4_netmask").prop("readOnly", true);
|
||||||
$("#id_ipv4_gateway").prop("readOnly", true);
|
$("#id_ipv4_gateway").prop("readOnly", true);
|
||||||
}
|
}
|
||||||
$("#id_name").focus();
|
$("#id_name").focus();
|
||||||
|
|
||||||
$("#id_ipv4_method").change(function() {
|
$("#id_ipv4_method").change(function() {
|
||||||
if ($("#id_ipv4_method").prop("value") == "manual") {
|
if ($("#id_ipv4_method").prop("value") == "manual") {
|
||||||
$("#id_ipv4_address").prop("readOnly", false);
|
$("#id_ipv4_address").prop("readOnly", false);
|
||||||
$("#id_ipv4_address").prop("required", true);
|
$("#id_ipv4_address").prop("required", true);
|
||||||
$("#id_ipv4_netmask").prop("readOnly", false);
|
$("#id_ipv4_netmask").prop("readOnly", false);
|
||||||
$("#id_ipv4_gateway").prop("readOnly", false);
|
$("#id_ipv4_gateway").prop("readOnly", false);
|
||||||
} else {
|
} else {
|
||||||
$("#id_ipv4_address").val("");
|
$("#id_ipv4_address").val("");
|
||||||
$("#id_ipv4_address").prop("readOnly", true);
|
$("#id_ipv4_address").prop("readOnly", true);
|
||||||
$("#id_ipv4_address").prop("required", false);
|
$("#id_ipv4_address").prop("required", false);
|
||||||
$("#id_ipv4_netmask").val("");
|
$("#id_ipv4_netmask").val("");
|
||||||
$("#id_ipv4_netmask").prop("readOnly", true);
|
$("#id_ipv4_netmask").prop("readOnly", true);
|
||||||
$("#id_ipv4_gateway").val("");
|
$("#id_ipv4_gateway").val("");
|
||||||
$("#id_ipv4_gateway").prop("readOnly", true);
|
$("#id_ipv4_gateway").prop("readOnly", true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#id_show_password').change(function() {
|
$('#id_show_password').change(function() {
|
||||||
// Changing type attribute from password to text is prevented by
|
// Changing type attribute from password to text is prevented by
|
||||||
// most browsers. Making a new form field works.
|
// most browsers. Making a new form field works.
|
||||||
new_type = 'password';
|
new_type = 'password';
|
||||||
if ($('#id_show_password').prop('checked'))
|
if ($('#id_show_password').prop('checked'))
|
||||||
new_type = 'text';
|
new_type = 'text';
|
||||||
|
|
||||||
$('#id_password').replaceWith(
|
$('#id_password').replaceWith(
|
||||||
$('#id_password').clone().attr('type', new_type));
|
$('#id_password').clone().attr('type', new_type));
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -496,8 +496,8 @@ def add_wifi_connection(name, interface, zone, ssid, mode, auth_mode,
|
|||||||
connection_uuid = str(uuid.uuid4())
|
connection_uuid = str(uuid.uuid4())
|
||||||
connection = _update_wifi_settings(
|
connection = _update_wifi_settings(
|
||||||
None, connection_uuid, name, interface, zone, ssid, mode, auth_mode,
|
None, connection_uuid, name, interface, zone, ssid, mode, auth_mode,
|
||||||
passphrase, ipv4_method, ipv4_address, ipv4_netmask,
|
passphrase, ipv4_method, ipv4_address, ipv4_netmask, ipv4_gateway,
|
||||||
ipv4_gateway, ipv4_dns, ipv4_second_dns)
|
ipv4_dns, ipv4_second_dns)
|
||||||
client = nm.Client.new(None)
|
client = nm.Client.new(None)
|
||||||
client.add_connection_async(connection, True, None, _callback, None)
|
client.add_connection_async(connection, True, None, _callback, None)
|
||||||
return connection_uuid
|
return connection_uuid
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user