Merged trunk

This commit is contained in:
Devin Carlen
2011-05-20 22:49:24 -07:00
8 changed files with 14 additions and 24 deletions

View File

@@ -15,6 +15,7 @@ setup(
author_email = 'xtoddx@gmail.com', author_email = 'xtoddx@gmail.com',
packages = find_packages('src'), packages = find_packages('src'),
package_dir = {'': 'src'}, package_dir = {'': 'src'},
package_data = {'django_nova_syspanel': ['templates/django_nova_syspanel/*.html','templates/django_nova_syspanel/*/*.html',]},
install_requires = ['setuptools', 'boto==1.9b', 'mox>=0.5.0'], install_requires = ['setuptools', 'boto==1.9b', 'mox>=0.5.0'],
classifiers = [ classifiers = [
'Development Status :: 4 - Beta', 'Development Status :: 4 - Beta',

View File

@@ -15,6 +15,8 @@ setup(
author_email = 'devin.carlen@gmail.com', author_email = 'devin.carlen@gmail.com',
packages = find_packages('src'), packages = find_packages('src'),
package_dir = {'': 'src'}, package_dir = {'': 'src'},
package_data = {'': ['templates/django_nova/*.html','templates/django_nova/*/*.html',
'templates/admin/*.html','templates/admin/*/*.html',]},
install_requires = ['setuptools', 'boto==1.9b', 'mox>=0.5.0', install_requires = ['setuptools', 'boto==1.9b', 'mox>=0.5.0',
'nova-adminclient'], 'nova-adminclient'],
classifiers = [ classifiers = [

View File

@@ -22,6 +22,7 @@ Views for managing Nova instances.
from django import http from django import http
from django import template from django import template
from django.conf import settings
from django.contrib import messages from django.contrib import messages
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect, render_to_response from django.shortcuts import redirect, render_to_response
@@ -63,6 +64,7 @@ def detail(request, project_id, instance_id):
'selected_instance': instance, 'selected_instance': instance,
'instances': instances, 'instances': instances,
'update_form': nova_forms.UpdateInstanceForm(instance), 'update_form': nova_forms.UpdateInstanceForm(instance),
'enable_vnc': settings.ENABLE_VNC,
'detail' : True, 'detail' : True,
}, context_instance = template.RequestContext(request)) }, context_instance = template.RequestContext(request))

View File

@@ -54,10 +54,10 @@
<div id="last" class="column"> <div id="last" class="column">
{% if instance.state == "running" %} {% 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>
<a href="{% url nova_instances_vnc project.projectname instance.id %}" id="vnc_{{instance.id}}" class="console" target="_blank">VNC</a>{% endif %} {% if enable_vnc %}
<a id="edit_instance_link" href="{% url nova_instance_update project.projectname instance.id %}">Edit Instance</a> <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>
</div> </div>
<span class="delete"> <span class="delete">

View File

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

View File

@@ -30,7 +30,7 @@
</div> </div>
{% else %} {% else %}
<div id="user_info"> <div id="user_info">
<a id="lnk_login" href="/accounts/login">Sign In</a> <a id="lnk_login" href="{% url auth_login %}">Sign In</a>
</div> </div>
{% endif %} {% endif %}
</div> </div>

View File

@@ -25,7 +25,7 @@
{% if form.errors %} {% if form.errors %}
<p class="error">Your username and password didn't match. Please try again.</p> <p class="error">Your username and password didn't match. Please try again.</p>
{% endif %} {% endif %}
<input type="hidden" name="next" value="{{ next }}" /> <input type="hidden" name="next" value="{% if next %}{{ next }}{% else %}{% url index %}{% endif %}" />
{{ form.username.label_tag }}{{ form.username }} {{ form.username.label_tag }}{{ form.username }}
{{ form.password.label_tag }}{{ form.password }} {{ form.password.label_tag }}{{ form.password }}
<div class="button"> <div class="button">

View File

@@ -9,21 +9,5 @@ sys.stdout = sys.stderr
DEBUG = False DEBUG = False
class WSGIRequest(django.core.handlers.wsgi.WSGIRequest): application = django.core.handlers.wsgi.WSGIHandler()
def is_secure(self):
value = self.META.get('wsgi.url_scheme', '').lower()
if value == 'https':
return True
return False
class WSGIHandler(django.core.handlers.wsgi.WSGIHandler):
request_class = WSGIRequest
_application = WSGIHandler()
def application(environ, start_response):
environ['PATH_INFO'] = environ['SCRIPT_NAME'] + environ['PATH_INFO']
environ['wsgi.url_scheme'] = environ.get('HTTP_X_URL_SCHEME', 'http')
return _application(environ, start_response)