diff --git a/instances/templates/instance.html b/instances/templates/instance.html index bd6bb78..de572df 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -136,12 +136,11 @@ {% trans "Resume" %} - {% else %} - +
  • + + {% trans "Force Off" %} + +
  • {% endif %} {% endifequal %} {% ifequal status 5 %} @@ -186,19 +185,31 @@ {% endif %} {% endifequal %} - {% ifequal status 3 %} -
    -
    {% csrf_token %} - {% if request.user.is_superuser %} + {% ifequal status 3 %} + {% if request.user.is_superuser %} +

    {% trans "This action restore the instance after suspend." %}

    - - {% else %} + {% csrf_token %} + +
    + +
    +
    +

    {% trans "This action forcibly powers off the instance and may cause data corruption." %}

    +
    {% csrf_token %} + +
    +
    +
    + {% else %} +

    {% trans "Administrator blocked your instance." %}

    - - {% endif %} -
    - -
    +
    {% csrf_token %} + +
    +
    +
    + {% endif %} {% endifequal %} {% ifequal status 5 %}
    @@ -605,7 +616,9 @@ {% endifequal %} {% else %} -

    {% trans "**** Please shutdown instance to modify boot menu ****" %} + {% ifequal bootmenu 0 %} +

    {% trans "**** Please shutdown instance to modify boot menu ****" %} + {% endifequal %} {% endifequal %}

    @@ -713,8 +726,12 @@ {% endif %} + {% empty %} +
    +
    {% trans 'There is not any CD-ROM device.' %}
    +
    {% endfor %} - +

    {% trans "Instance Volume" %} {% include 'add_instance_volume.html' %} @@ -796,6 +813,7 @@

    +
    @@ -810,10 +828,10 @@
    @@ -828,18 +846,13 @@ {% endfor %}
    -
    - - {% endfor %}
    -

    {% trans "For migration both host servers must have equal settings and OS type" %}

    @@ -1201,7 +1214,7 @@
    -

    {% trans "CPU usage" %}

    +

    {% trans "CPU Usage" %}

    @@ -1214,7 +1227,7 @@ {% for net in networks %}
    -

    {% trans "Bandwidth device:" %} eth{{ forloop.counter0 }}

    +

    {% trans "Bandwidth Device" %}: eth{{ forloop.counter0 }}

    @@ -1228,7 +1241,7 @@ {% for disk in disks %}
    -

    {% trans "Disk I/O device:" %} {{ disk.dev }}

    +

    {% trans "Disk I/O device" %}: {{ disk.dev }}

    diff --git a/instances/views.py b/instances/views.py index e3c7628..36b7327 100644 --- a/instances/views.py +++ b/instances/views.py @@ -622,6 +622,11 @@ def instance(request, compute_id, vname): order_list[idx] = {"type": type, "dev": dev} conn.set_bootorder(order_list) msg = _("Set boot order") + + if not conn.get_status() == 5: + messages.success(request, _("Boot menu changes applied. But it will be activated after shutdown")) + else: + messages.success(request, _("Boot order changed successfully.")) addlogmsg(request.user.username, instance.name, msg) return HttpResponseRedirect(request.get_full_path() + '#boot_opt') diff --git a/networks/templates/network.html b/networks/templates/network.html index 450c393..5f2949a 100644 --- a/networks/templates/network.html +++ b/networks/templates/network.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% load i18n %} +{% load staticfiles %} {% block title %}{% trans "Network" %} - {{ pool }}{% endblock %} {% block content %} @@ -38,10 +39,10 @@
    -

    {% trans "Network name:" %}

    -

    {% trans "Device:" %}

    -

    {% trans "State" %}

    -

    {% trans "Autostart" %}

    +

    {% trans "Network name" %}:

    +

    {% trans "Device" %}:

    +

    {% trans "State" %}:

    +

    {% trans "Autostart" %}:

    {{ pool }}

    @@ -67,11 +68,35 @@

    - {#{% if state %}#} -
    - +
    + +
    +
    +
    + +
    +
    +
    {% csrf_token %} +
    + + +
    + +
    +
    +
    -
    +
    +
    + +
    +

    {% trans "IPv4 Forwarding:" %}

    {% trans "Network:" %}

    @@ -122,75 +147,74 @@ {% endif %}
    - {% ifequal ipv4_forward.0 'nat' %} - {% if state %} - {% include 'modify_fixed_address.html' %} - {% endif %} -
    - -
    - {% endifequal %} - {% if fixed_address %} -
    -
    -
    -
    - -
    -
    + {% ifequal ipv4_forward.0 'nat' %} + {% if state %} + {% include 'modify_fixed_address.html' %} + {% endif %} +
    + +
    + {% endifequal %} + {% if fixed_address %} +
    +
    +
    +
    + +
    +
    -
    -
    - -
    - - +
    +
    +
    - - + + + +
    + + + + + + + + + + {% for fix in fixed_address %} - - - - - - - - {% for fix in fixed_address %} - {% csrf_token %} - - - - {% endfor %} - -
    {% trans "MAC" %}{% trans "Address" %}{% trans "Name" %}{% trans "Action" %}
    {% trans "MAC" %}{% trans "Address" %}{% trans "Name" %}{% trans "Action" %}
    - - - -
    -
    + + + + + + + + {% endfor %} + +
    - {#{% endif %}#} +
    {% 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 %} + + + + + + +{% 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 }}