diff --git a/instances/views.py b/instances/views.py index 1a1c5c0..474bfd2 100644 --- a/instances/views.py +++ b/instances/views.py @@ -73,6 +73,7 @@ def allinstances(request): def instances(request, compute_id): """ :param request: + :param compute_id :return: """ all_host_vms = {} @@ -224,9 +225,9 @@ def instance(request, compute_id, vname): def get_network_tuple(network_source_str): network_source_pack = network_source_str.split(":", 1) if len(network_source_pack) > 1: - return (network_source_pack[1], network_source_pack[0]) + return network_source_pack[1], network_source_pack[0] else: - return (network_source_pack[0], 'net') + return network_source_pack[0], 'net' def migrate_instance(new_compute, instance, live=False, unsafe=False, xml_del=False, offline=False): status = connection_manager.host_is_up(new_compute.type, new_compute.hostname) @@ -1104,10 +1105,13 @@ def instances_actions(request): return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path()) + @login_required def inst_graph(request, compute_id, vname): """ :param request: + :param compute_id: + :param vname: :return: """ json_blk = [] @@ -1298,7 +1302,7 @@ def delete_instance(instance, delete_disk=False): conn.delete() instance.delete() - print("Instance {} on compute {} sucessfully deleted".format(instance_name, compute.hostname)) + print("Instance {} on compute {} successfully deleted".format(instance_name, compute.hostname)) except libvirtError as lib_err: print("Error removing instance {} on compute {}".format(instance_name, compute.hostname)) diff --git a/interfaces/templates/interface.html b/interfaces/templates/interface.html index 1693d81..2ac89d9 100644 --- a/interfaces/templates/interface.html +++ b/interfaces/templates/interface.html @@ -38,12 +38,12 @@

{% trans "Interface" %}:

-

{% trans "IPv4" %}: ({% ifequal ipv4 None %}{% trans 'None' %}{% else %}{{ ipv4_type }}{% endifequal %})

-

{% trans "IPv6" %}: ({% ifequal ipv6 None %}{% trans 'None' %}{% else %}{{ ipv6_type }}{% endifequal %})

+

{% trans "IPv4" %} ({% ifequal ipv4 None %}{% trans 'None' %}{% else %}{{ ipv4_type }}{% endifequal %}):

+

{% trans "IPv6" %} ({% ifequal ipv6 None %}{% trans 'None' %}{% else %}{{ ipv6_type }}{% endifequal %}):

{% trans "MAC Adress" %}:

{% trans "Interface Type" %}:

{% ifequal itype 'bridge' %} -

{% trans "Bridge device" %}

+

{% trans "Bridge Device" %}:

{% endifequal %}

{% trans "Boot Mode" %}:

{% trans "State" %}:

@@ -69,5 +69,33 @@

+
+ {% ifequal itype 'bridge' %} + + + + + + + + + + + + + {% for iface in slave_ifaces %} + + + + + + + + {% endfor %} + +
{% trans 'Slaves' %}
{% trans 'MAC' %}{% trans 'Name' %}{% trans 'Type' %}{% trans 'Speed' %}{% trans 'State' %}
{{ iface.mac }}{{ iface.name }}{{ iface.type }}{{ iface.speed }}{{ iface.state }}
+ {% endifequal %} +
+ {% endblock %} \ No newline at end of file diff --git a/interfaces/views.py b/interfaces/views.py index f71289c..a747120 100644 --- a/interfaces/views.py +++ b/interfaces/views.py @@ -61,6 +61,7 @@ def interfaces(request, compute_id): def interface(request, compute_id, iface): """ :param request: + :param compute_id: :param iface: :return: """ @@ -87,6 +88,7 @@ def interface(request, compute_id, iface): ipv6 = conn.get_ipv6() ipv6_type = conn.get_ipv6_type() bridge = conn.get_bridge() + slave_ifaces = conn.get_bridge_slave_ifaces() if request.method == 'POST': if 'stop' in request.POST: diff --git a/networks/templates/modify_fixed_address.html b/networks/templates/modify_ipv4_fixed_address.html similarity index 85% rename from networks/templates/modify_fixed_address.html rename to networks/templates/modify_ipv4_fixed_address.html index fd1c938..7c1addb 100644 --- a/networks/templates/modify_fixed_address.html +++ b/networks/templates/modify_ipv4_fixed_address.html @@ -1,16 +1,16 @@ {% load i18n %} {% if request.user.is_superuser %} - + - diff --git a/networks/templates/modify_ipv6_fixed_address.html b/networks/templates/modify_ipv6_fixed_address.html new file mode 100644 index 0000000..fcc7eff --- /dev/null +++ b/networks/templates/modify_ipv6_fixed_address.html @@ -0,0 +1,53 @@ +{% load i18n %} +{% if request.user.is_superuser %} + + + + + + +{% endif %} \ No newline at end of file diff --git a/networks/templates/network.html b/networks/templates/network.html index 46c79ab..c5d8cd5 100644 --- a/networks/templates/network.html +++ b/networks/templates/network.html @@ -68,6 +68,7 @@

+
@@ -93,31 +94,32 @@ -
+ +
-

{% trans "IPv4 Forwarding:" %}

-

{% trans "Network:" %}

-

{% trans "DHCP:" %}

+

{% trans "IPv4 Forwarding" %}:

+

{% trans "Network" %}:

{% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %} -

{% trans "Start:" %}

-

{% trans "End:" %}

+

{% trans "DHCP" %}:

+

{% trans "Start" %}:

+

{% trans "End" %}:

{% endif %}

- {% ifequal ipv4_forward.0 'nat' %} + {% ifequal net_forward.0 'nat' %} {% trans "NAT" %} {% endifequal %} - {% ifequal ipv4_forward.0 'route' %} + {% ifequal net_forward.0 'route' %} {% trans "ROUTE" %} {% endifequal %} - {% ifequal ipv4_forward.0 'bridge' %} + {% ifequal net_forward.0 'bridge' %} {% trans "BRIDGE" %} {% endifequal %} - {% if not ipv4_forward.0 %} + {% if not net_forward.0 %} {% trans "ISOLATE" %} {% endif %}

@@ -137,6 +139,7 @@ {% else %}

+
- {% ifequal ipv4_forward.0 'nat' %} + {% if ipv4_dhcp_range_start and ipv4_dhcp_range_end %} {% if state %} - {% include 'modify_fixed_address.html' %} + {% include 'modify_ipv4_fixed_address.html' %} {% endif %}
- +
- {% endifequal %} - {% if fixed_address %} + {% endif %} + {% if ipv4_fixed_address %}
@@ -175,7 +178,7 @@
- +
@@ -185,14 +188,132 @@ - {% for fix in fixed_address %} + {% for fix4 in ipv4_fixed_address %} {% csrf_token %} - - - + + + + + + {% endfor %} + +
{% trans "MAC" %}
- + + + +
+
+
+
+
+
+ + {% endif %} + +
+ +
+
+
+

{% trans "IPv6 Forwarding" %}:

+

{% trans "Network" %}:

+ {% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %} +

{% trans "DHCP" %}:

+

{% trans "Start" %}:

+

{% trans "End" %}:

+ {% endif %} +
+
+

+ {% if not net_forward.0 %} + {% trans "ISOLATE" %} + {% else %} + {% trans "ROUTE" %} + {% endif %} +

+

{{ ipv6_network }}

+

+ {% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %} + {% trans "ON" %} + {% else %} + {% trans "OFF" %} + {% endif %} +

+ {% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %} +
{% csrf_token %} + {% if state %} +

{{ ipv6_dhcp_range_start }}

+

{{ ipv6_dhcp_range_end }}

+ {% else %} +

+

+ +
+ +
+ {% endif %} +
+ {% endif %} +
+
+ {% if ipv6_dhcp_range_start and ipv6_dhcp_range_end %} + {% if state %} + {% include 'modify_ipv6_fixed_address.html' %} + {% endif %} +
+ +
+ {% endif %} + {% if ipv6_fixed_address %} +
+
+
+
+ +
+
+ +
+
+ +
+ + +
+ + + + + + + + + + + {% for fix6 in ipv6_fixed_address %} + + {% csrf_token %} + + + +
{% trans "ID" %}{% trans "Address" %}{% trans "Name" %}{% trans "Action" %}
+