Commit bb9f818b by Őry Máté

network: add magic buttons to HostForm

parent c3c23feb
......@@ -21,7 +21,7 @@ from django.utils.translation import ugettext_lazy as _
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Fieldset, Div, Submit, BaseInput
from crispy_forms.bootstrap import FormActions
from crispy_forms.bootstrap import FormActions, AppendedText
from firewall.models import (Host, Vlan, Domain, Group, Record, BlacklistItem,
Rule, VlanGroup, SwitchPort)
......@@ -122,8 +122,10 @@ class HostForm(ModelForm):
'<i class="fa fa-magic" id="ipv4-magic"></i>'),
'<i class="fa fa-magic" id="ipv6-magic"></i>'),
......@@ -30,4 +30,23 @@ function getURLParameter(name) {
$(function() {
$("#ipv6-magic").click(function() {
$.ajax({url: window.location,
data: {ipv4: $("[name=ipv4]").val(),
vlan: $("[name=vlan]").val()},
success: function(data) {
$("#ipv4-magic").click(function() {
$.ajax({url: window.location,
data: {vlan: $("[name=vlan]").val()},
success: function(data) {
if (!$("[name=ipv6]").val()) {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment