mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
Live resize VM Memory activate. Redirection fix for resizing operations. Some typo & indent fix
This commit is contained in:
parent
228a0949d1
commit
60684cc7b1
2 changed files with 8 additions and 13 deletions
|
@ -432,11 +432,7 @@
|
||||||
<small><input type="checkbox" class="js-custom__checkbox" /> {% trans "Custom value" %}</small>
|
<small><input type="checkbox" class="js-custom__checkbox" /> {% trans "Custom value" %}</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% ifequal status 5 %}
|
<button type="submit" class="btn btn-lg btn-success pull-right" name="resizevm_mem">{% trans "Resize" %}</button>
|
||||||
<button type="submit" class="btn btn-lg btn-success pull-right" name="resizevm_mem">{% trans "Resize" %}</button>
|
|
||||||
{% else %}
|
|
||||||
<button class="btn btn-lg btn-success pull-right disabled">{% trans "Resize" %}</button>
|
|
||||||
{% endifequal %}
|
|
||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% trans "You don't have permission for resizing instance" %}
|
{% trans "You don't have permission for resizing instance" %}
|
||||||
|
@ -951,8 +947,8 @@
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for q, attrs in qos.items %}
|
{% for q, attrs in qos.items %}
|
||||||
{% for att in attrs %}
|
{% for att in attrs %}
|
||||||
<form method="post" role="form">{% csrf_token %}
|
<form method="post" role="form">{% csrf_token %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><label class="control-label">{{ q }} {{ att.direction | capfirst }}</label></td>
|
<td><label class="control-label">{{ q }} {{ att.direction | capfirst }}</label></td>
|
||||||
<td><input id="qos_average" class="form-control" name="qos_average"
|
<td><input id="qos_average" class="form-control" name="qos_average"
|
||||||
|
@ -976,9 +972,8 @@
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -481,7 +481,7 @@ def instance(request, compute_id, vname):
|
||||||
conn.resize_cpu(cur_vcpu, vcpu)
|
conn.resize_cpu(cur_vcpu, vcpu)
|
||||||
msg = _("Resize CPU")
|
msg = _("Resize CPU")
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#resize')
|
return HttpResponseRedirect(request.get_full_path() + '#resize')
|
||||||
|
|
||||||
if 'resizevm_mem' in request.POST and (request.user.is_superuser or
|
if 'resizevm_mem' in request.POST and (request.user.is_superuser or
|
||||||
request.user.is_staff or
|
request.user.is_staff or
|
||||||
|
@ -504,7 +504,7 @@ def instance(request, compute_id, vname):
|
||||||
conn.resize_mem(cur_memory, memory)
|
conn.resize_mem(cur_memory, memory)
|
||||||
msg = _("Resize Memory")
|
msg = _("Resize Memory")
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#resize')
|
return HttpResponseRedirect(request.get_full_path() + '#resize')
|
||||||
|
|
||||||
if 'resizevm_disk' in request.POST and (
|
if 'resizevm_disk' in request.POST and (
|
||||||
request.user.is_superuser or request.user.is_staff or userinstance.is_change):
|
request.user.is_superuser or request.user.is_staff or userinstance.is_change):
|
||||||
|
@ -524,7 +524,7 @@ def instance(request, compute_id, vname):
|
||||||
conn.resize_disk(disks_new)
|
conn.resize_disk(disks_new)
|
||||||
msg = _("Resize")
|
msg = _("Resize")
|
||||||
addlogmsg(request.user.username, instance.name, msg)
|
addlogmsg(request.user.username, instance.name, msg)
|
||||||
return HttpResponseRedirect(request.get_full_path() + '#resize')
|
return HttpResponseRedirect(request.get_full_path() + '#resize')
|
||||||
|
|
||||||
if 'add_new_vol' in request.POST and allow_admin_or_not_template:
|
if 'add_new_vol' in request.POST and allow_admin_or_not_template:
|
||||||
conn_create = wvmCreate(compute.hostname,
|
conn_create = wvmCreate(compute.hostname,
|
||||||
|
@ -1052,7 +1052,7 @@ def get_host_instances(request, comp):
|
||||||
|
|
||||||
conn.close()
|
conn.close()
|
||||||
else:
|
else:
|
||||||
raise libvirtError("Problem occured with {} - {}".format(comp.name, status))
|
raise libvirtError("Problem occurred with {} - {}".format(comp.name, status))
|
||||||
return all_host_vms
|
return all_host_vms
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue