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() { ...@@ -22,8 +22,18 @@ $(function() {
$("#vm-info-pane").fadeIn(); $("#vm-info-pane").fadeIn();
$("#vm-detail-pane").removeClass("col-md-12").addClass("col-md-8"); $("#vm-detail-pane").removeClass("col-md-12").addClass("col-md-8");
}); });
$('#sendCtrlAltDelButton').click(function() { $('#sendCtrlAltButton').click(function() {
rfb.sendCtrlAltDel(); return false;}); 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() { $('#sendPasswordButton').click(function() {
var pw = $("#vm-details-pw-input").val(); var pw = $("#vm-details-pw-input").val();
for (var i=0; i < pw.length; i++) { for (var i=0; i < pw.length; i++) {
......
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
{% for d in disks %} {% for d in disks %}
<li> <li>
<i class="fa fa-file"></i> <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 }}" <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" data-disk-pk="{{ d.pk }}" class="btn btn-xs btn-danger pull-right disk-remove"
{% if not long_remove %}title="{% trans "Remove" %}"{% endif %}> {% if not long_remove %}title="{% trans "Remove" %}"{% endif %}>
......
...@@ -10,13 +10,28 @@ ...@@ -10,13 +10,28 @@
<div class="col-xs-7"> <div class="col-xs-7">
<div class="btn-toolbar"> <div class="btn-toolbar">
{% if perms.vm.access_console %} {% if perms.vm.access_console %}
<button id="sendCtrlAltDelButton" class="btn btn-danger btn-sm"> <button id="sendCtrlAltButton" class="btn btn-danger btn-sm">
{% trans "Send Ctrl+Alt+Del" %} {% trans "Send" %}
</button> </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"> <button id="sendPasswordButton" class="btn btn-default btn-sm">
{% trans "Type password" %} {% trans "Type password" %}
</button> </button>
{% endif %} {% endif %}
</div> </div>
</div> </div>
<div class="col-xs-5 text-right"> <div class="col-xs-5 text-right">
......
...@@ -212,7 +212,7 @@ class Cpu(object): ...@@ -212,7 +212,7 @@ class Cpu(object):
if isinstance(self.obj, Node): if isinstance(self.obj, Node):
return (0, 105) return (0, 105)
else: else:
return (0, self.obj.num_cores * 100 + 5) return (0, self.obj.num_cores * 105)
register_graph(Cpu, 'cpu', VmGraphView) register_graph(Cpu, 'cpu', VmGraphView)
......
...@@ -937,6 +937,7 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView): ...@@ -937,6 +937,7 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
'tags': "tags__name__in", # for search string 'tags': "tags__name__in", # for search string
'owner': "owner__username", 'owner': "owner__username",
'template': "template__pk", 'template': "template__pk",
'template_name': "template__name__istartswith",
} }
def get_context_data(self, *args, **kwargs): def get_context_data(self, *args, **kwargs):
...@@ -1018,10 +1019,14 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView): ...@@ -1018,10 +1019,14 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
in [i.name for i in Instance._meta.fields] + ["pk"]): in [i.name for i in Instance._meta.fields] + ["pk"]):
queryset = queryset.order_by(sort) queryset = queryset.order_by(sort)
filters, excludes = self.get_queryset_filters() try:
return queryset.filter(**filters).exclude(**excludes).prefetch_related( filters, excludes = self.get_queryset_filters()
"owner", "node", "owner__profile", "interface_set", "lease", queryset = queryset.filter(**filters).exclude(**excludes).distinct()
"interface_set__host").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): 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