diff --git a/instances/templates/instance.html b/instances/templates/instance.html index c3baecc..381159f 100644 --- a/instances/templates/instance.html +++ b/instances/templates/instance.html @@ -573,6 +573,25 @@ +

{% trans "To change VNC listen status, shutdown the instance." %}

+
{% csrf_token %} +
+
+
+ +
+
+
+ {% ifequal status 5 %} + + {% else %} + + {% endifequal %} +
+
+

{% trans "To create console password, shutdown the instance." %}

{% csrf_token %}
diff --git a/instances/views.py b/instances/views.py index 8d9afd9..116bc0c 100644 --- a/instances/views.py +++ b/instances/views.py @@ -223,6 +223,7 @@ def instance(request, compute_id, vname): has_managed_save_image = conn.get_managed_save_image() clone_disks = show_clone_disk(disks) console_passwd = conn.get_console_passwd() + console_listen_locally = conn.get_console_listen_addr() in ["127.0.0.1", "::1"] try: instance = Instance.objects.get(compute_id=compute_id, name=vname) @@ -417,6 +418,16 @@ def instance(request, compute_id, vname): addlogmsg(request.user.username, instance.name, msg) return HttpResponseRedirect(request.get_full_path() + '#xmledit') + if 'set_console_listen_addr' in request.POST: + console_listen_locally = request.POST.get("listen_locally", False) == "true" + if not conn.set_console_listen_addr('127.0.0.1' if console_listen_locally else '0.0.0.0'): + msg = _("Error setting console listen status. You should check that your instance have an graphic device.") + error_messages.append(msg) + else: + msg = _("Set VNC listen status") + addlogmsg(request.user.username, instance.name, msg) + return HttpResponseRedirect(request.get_full_path() + '#vncsettings') + if 'set_console_passwd' in request.POST: if request.POST.get('auto_pass', ''): passwd = ''.join([choice(letters + digits) for i in xrange(12)]) diff --git a/vrtManager/create.py b/vrtManager/create.py index cc1f7f2..5488240 100644 --- a/vrtManager/create.py +++ b/vrtManager/create.py @@ -227,8 +227,8 @@ class wvmCreate(wvmConnect): xml += """ - - + +