Merge lp:~jakedahn/horizon/lp784866 into lp:~hudson-openstack/horizon/trunk

Proposed by Jake Dahn
Status: Merged
Approved by: Devin Carlen
Approved revision: 49
Merged at revision: 48
Proposed branch: lp:~jakedahn/horizon/lp784866
Merge into: lp:~hudson-openstack/horizon/trunk
Diff against target: 55 lines (+7/-2)
3 files modified
django-nova/src/django_nova/templates/django_nova/instances/_instances_list.html (+3/-1)
django-nova/src/django_nova/views/instances.py (+3/-1)
openstack-dashboard/dashboard/settings.py (+1/-0)
To merge this branch: bzr merge lp:~jakedahn/horizon/lp784866
Reviewer Review Type Date Requested Status
Devin Carlen Approve
Review via email: mp+61483@code.launchpad.net

Description of the change

Added a flag in settings.py to enable/disable the vnc button from the instances detail page.

To disable vnc button, set ENABLE_VNC to False in local_settings.py.

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'django-nova/src/django_nova/templates/django_nova/instances/_instances_list.html'
2--- django-nova/src/django_nova/templates/django_nova/instances/_instances_list.html 2011-04-19 12:21:54 +0000
3+++ django-nova/src/django_nova/templates/django_nova/instances/_instances_list.html 2011-05-18 21:44:28 +0000
4@@ -54,7 +54,9 @@
5 <div id="last" class="column">
6 {% if instance.state == "running" %}
7 <a href="{% url nova_instances_console project.projectname instance.id %}" id="console_{{instance.id}}" class="console" target="_blank">Show Console</a>
8-<a href="{% url nova_instances_vnc project.projectname instance.id %}" id="vnc_{{instance.id}}" class="console" target="_blank">VNC</a>{% endif %}
9+ {% if enable_vnc %}
10+ <a href="{% url nova_instances_vnc project.projectname instance.id %}" id="vnc_{{instance.id}}" class="console" target="_blank">VNC</a>{% endif %}
11+ {% endif %}
12 <a id="edit_instance_link" href="{% url nova_instance_update project.projectname instance.id %}">Edit Instance</a>
13
14
15
16=== modified file 'django-nova/src/django_nova/views/instances.py'
17--- django-nova/src/django_nova/views/instances.py 2011-04-26 00:20:41 +0000
18+++ django-nova/src/django_nova/views/instances.py 2011-05-18 21:44:28 +0000
19@@ -22,6 +22,7 @@
20
21 from django import http
22 from django import template
23+from django.conf import settings
24 from django.contrib import messages
25 from django.contrib.auth.decorators import login_required
26 from django.shortcuts import redirect, render_to_response
27@@ -52,7 +53,7 @@
28 project = shortcuts.get_project_or_404(request, project_id)
29 instance = project.get_instance(instance_id)
30 instances = sorted(project.get_instances(), key=lambda k: k.public_dns_name)
31-
32+
33 if not instance:
34 raise http.Http404()
35
36@@ -62,6 +63,7 @@
37 'selected_instance': instance,
38 'instances': instances,
39 'update_form': nova_forms.UpdateInstanceForm(instance),
40+ 'enable_vnc': settings.ENABLE_VNC,
41 'detail' : True,
42 }, context_instance = template.RequestContext(request))
43
44
45=== modified file 'openstack-dashboard/dashboard/settings.py'
46--- openstack-dashboard/dashboard/settings.py 2011-04-13 18:29:39 +0000
47+++ openstack-dashboard/dashboard/settings.py 2011-05-18 21:44:28 +0000
48@@ -13,6 +13,7 @@
49 SITE_ID = 1
50 SITE_BRANDING = 'OpenStack'
51 SITE_NAME = 'openstack'
52+ENABLE_VNC = True
53
54 LOGIN_URL = '/accounts/login'
55 LOGIN_REDIRECT_URL = '/'

Subscribers

People subscribed via source and target branches