Commit fa743214 by Szeberényi Imre

Adding Send alt-ctrl... from console

Adding template_name filer to vm-list
parent ba6e96a6
Pipeline #1345 failed with stage
in 0 seconds
......@@ -22,8 +22,18 @@ $(function() {
$("#vm-info-pane").fadeIn();
$("#vm-detail-pane").removeClass("col-md-12").addClass("col-md-8");
});
$('#sendCtrlAltDelButton').click(function() {
rfb.sendCtrlAltDel(); return false;});
$('#sendCtrlAltButton').click(function() {
var fn = Number($('#chooseCtrlAlt').val());
if (fn == 0) {
rfb.sendCtrlAltDel(); i
} else {
rfb.sendCtrlAltCombine(fn-1);
}
return false;});
// rfb.sendCtrlAltDel(); return false;});
// $('#sendCtrlAltCombine').change(function() {
// var fn = Number($('#sendCtrlAltCombine').val())-1;
// rfb.sendCtrlAltCombine(fn); return false;});
$('#sendPasswordButton').click(function() {
var pw = $("#vm-details-pw-input").val();
for (var i=0; i < pw.length; i++) {
......
......@@ -155,7 +155,7 @@
{% for d in disks %}
<li>
<i class="fa fa-file"></i>
{{ d.name }} (#{{ d.id }})
{{ d.filename }} (#{{ d.id }})
<a href="{% url "dashboard.views.disk-remove" pk=d.pk %}?next={{ request.path }}"
data-disk-pk="{{ d.pk }}" class="btn btn-xs btn-danger pull-right disk-remove"
{% if not long_remove %}title="{% trans "Remove" %}"{% endif %}>
......
......@@ -10,9 +10,24 @@
<div class="col-xs-7">
<div class="btn-toolbar">
{% if perms.vm.access_console %}
<button id="sendCtrlAltDelButton" class="btn btn-danger btn-sm">
{% trans "Send Ctrl+Alt+Del" %}
<button id="sendCtrlAltButton" class="btn btn-danger btn-sm">
{% trans "Send" %}
</button>
<select id="chooseCtrlAlt" class="btn btn-danger btn-sm" >
<option value="0">Ctrl+Alt+Delete</option>
<option value="1">Ctrl+Alt+F1</option>
<option value="2">Ctrl+Alt+F2</option>
<option value="3">Ctrl+Alt+F3</option>
<option value="4">Ctrl+Alt+F4</option>
<option value="5">Ctrl+Alt+F5</option>
<option value="6">Ctrl+Alt+F6</option>
<option value="7">Ctrl+Alt+F7</option>
<option value="8">Ctrl+Alt+F8</option>
<option value="9">Ctrl+Alt+F9</option>
<option value="10">Ctrl+Alt+F10</option>
<option value="11">Ctrl+Alt+F11</option>
<option value="12">Ctrl+Alt+F12</option>
</select>
<button id="sendPasswordButton" class="btn btn-default btn-sm">
{% trans "Type password" %}
</button>
......
......@@ -212,7 +212,7 @@ class Cpu(object):
if isinstance(self.obj, Node):
return (0, 105)
else:
return (0, self.obj.num_cores * 100 + 5)
return (0, self.obj.num_cores * 105)
register_graph(Cpu, 'cpu', VmGraphView)
......
......@@ -937,6 +937,7 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
'tags': "tags__name__in", # for search string
'owner': "owner__username",
'template': "template__pk",
'template_name': "template__name__istartswith",
}
def get_context_data(self, *args, **kwargs):
......@@ -1018,10 +1019,14 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
in [i.name for i in Instance._meta.fields] + ["pk"]):
queryset = queryset.order_by(sort)
try:
filters, excludes = self.get_queryset_filters()
return queryset.filter(**filters).exclude(**excludes).prefetch_related(
"owner", "node", "owner__profile", "interface_set", "lease",
"interface_set__host").distinct()
queryset = queryset.filter(**filters).exclude(**excludes).distinct()
except ValueError:
messages.error(self.request, _("Error during filtering."))
return queryset.prefetch_related("owner", "node", "owner__profile", "lease",
"interface_set", "interface_set__host", "template").distinct()
class VmCreate(LoginRequiredMixin, TemplateView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment