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 @@{% trans 'MAC' %} | +{% trans 'Name' %} | +{% trans 'Type' %} | +{% trans 'Speed' %} | +{% trans 'State' %} | +
{{ iface.mac }} | +{{ iface.name }} | +{{ iface.type }} | +{{ iface.speed }} | +{{ iface.state }} | +
{% 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 %} +{% trans "MAC" %} | @@ -185,14 +188,132 @@
---|
{% 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 %} + + {% endif %} +{% trans "ID" %} | +{% trans "Address" %} | +{% trans "Name" %} | +{% trans "Action" %} | +
---|---|---|---|