{% endif %}
{% endblock %}
{% block script %}
@@ -230,4 +254,14 @@
});
});
+
+
{% endblock %}
\ No newline at end of file
diff --git a/networks/views.py b/networks/views.py
index ee61043..29fb802 100644
--- a/networks/views.py
+++ b/networks/views.py
@@ -88,6 +88,7 @@ def network(request, compute_id, pool):
ipv4_dhcp_range_end = conn.get_ipv4_dhcp_range_end()
ipv4_network = conn.get_ipv4_network()
fixed_address = conn.get_mac_ipaddr()
+ xml = conn._XMLDesc(0)
except libvirtError as lib_err:
error_messages.append(lib_err)
@@ -139,7 +140,6 @@ def network(request, compute_id, pool):
conn.delete_fixed_address(mac)
messages.success(request, "Fixed Address is Deleted.")
return HttpResponseRedirect(request.get_full_path())
-
if 'modify_dhcp_range' in request.POST:
range_start = request.POST.get('range_start', '')
range_end = request.POST.get('range_end', '')
@@ -149,6 +149,22 @@ def network(request, compute_id, pool):
return HttpResponseRedirect(request.get_full_path())
except libvirtError as lib_err:
error_messages.append(lib_err.message)
+ if 'edit_network' in request.POST:
+ edit_xml = request.POST.get('edit_xml', '')
+ if edit_xml:
+ try:
+ new_conn = wvmNetworks(compute.hostname,
+ compute.login,
+ compute.password,
+ compute.type)
+ conn.define_network(edit_xml)
+ if conn.is_active():
+ messages.success(request, _("Network XML is changed. Stop and start network to activate new config."))
+ else:
+ messages.success(request, _("Network XML is changed."))
+ return HttpResponseRedirect(request.get_full_path())
+ except libvirtError as lib_err:
+ error_messages.append(lib_err.message)
conn.close()
diff --git a/nwfilters/templates/add_nwf_rule.html b/nwfilters/templates/add_nwf_rule.html
new file mode 100644
index 0000000..bd124e4
--- /dev/null
+++ b/nwfilters/templates/add_nwf_rule.html
@@ -0,0 +1,33 @@
+{% load i18n %}
+{% if request.user.is_superuser %}
+
+
+
+
+
+
+
+
+
+
+
{% trans "Add New NWFilter Rule" %}
+
+
+
{% csrf_token %}
+
+
+
+
+
+
{% trans 'If there is a rule which has same attributes it replaces that rule' %}...
+
+
+
+
+
+
+
+{% endif %}
\ No newline at end of file
diff --git a/nwfilters/templates/nwfilter.html b/nwfilters/templates/nwfilter.html
index 377190d..18e04c6 100644
--- a/nwfilters/templates/nwfilter.html
+++ b/nwfilters/templates/nwfilter.html
@@ -6,7 +6,6 @@
- {% include 'create_nwfilter_block.html' %}
{% trans "NWFilter:" %} {{ name }}
@@ -38,152 +37,126 @@
{% include 'errors_block.html' %}
{% include 'messages_block.html' %}
-