adding a settings flag for the vnc button

This commit is contained in:
Jake Dahn
2011-05-18 14:32:25 -07:00
parent 3215429e10
commit e0625fb253
3 changed files with 7 additions and 2 deletions

View File

@@ -53,7 +53,9 @@
<div id="last" class="column">
{% if instance.state == "running" %}
<a href="{% url nova_instances_console project.projectname instance.id %}" id="console_{{instance.id}}" class="console" target="_blank">Show Console</a>
<a href="{% url nova_instances_console project.projectname instance.id %}" id="console_{{instance.id}}" class="console" target="_blank">Show Console</a>
{% if enable_vnc %}
<a href="{% url nova_instances_vnc project.projectname instance.id %}" id="vnc_{{instance.id}}" class="console" target="_blank">VNC</a>{% endif %}
{% endif %}
<a id="edit_instance_link" href="{% url nova_instance_update project.projectname instance.id %}">Edit Instance</a>

View File

@@ -22,6 +22,7 @@ Views for managing Nova instances.
from django import http
from django import template
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render_to_response
@@ -52,7 +53,7 @@ def detail(request, project_id, instance_id):
project = shortcuts.get_project_or_404(request, project_id)
instance = project.get_instance(instance_id)
instances = sorted(project.get_instances(), key=lambda k: k.public_dns_name)
if not instance:
raise http.Http404()
@@ -62,6 +63,7 @@ def detail(request, project_id, instance_id):
'selected_instance': instance,
'instances': instances,
'update_form': nova_forms.UpdateInstanceForm(instance),
'enable_vnc': settings.ENABLE_VNC,
'detail' : True,
}, context_instance = template.RequestContext(request))

View File

@@ -13,6 +13,7 @@ TEMPLATE_DEBUG = DEBUG
SITE_ID = 1
SITE_BRANDING = 'OpenStack'
SITE_NAME = 'openstack'
ENABLE_VNC = True
LOGIN_URL = '/accounts/login'
LOGIN_REDIRECT_URL = '/'