From 94aa1e515ce82f1453295f0064072f66eac1c466 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Wed, 27 Jul 2011 14:36:14 -0700 Subject: [PATCH 01/16] starting to make things modular --- openstack-dashboard/dashboard/settings.py | 1 + openstack-dashboard/dashboard/templates/_syspanel_sidebar.html | 1 + 2 files changed, 2 insertions(+) diff --git a/openstack-dashboard/dashboard/settings.py b/openstack-dashboard/dashboard/settings.py index a12d76996..b65b271ed 100644 --- a/openstack-dashboard/dashboard/settings.py +++ b/openstack-dashboard/dashboard/settings.py @@ -84,6 +84,7 @@ INSTALLED_APPS = ( 'django_openstack', 'django_openstack.templatetags', 'mailer', + 'dashboard.openstack_dashboard_iframer' ) TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' diff --git a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html index 45883f786..4f61e0201 100644 --- a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html @@ -10,4 +10,5 @@
  • Users
  • Quotas
  • + {% block syspanel_sidebar %}{% endblock %} From 9ae9e5743a32b91325740b40b58c18b61c30a5ad Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Wed, 27 Jul 2011 23:26:30 -0700 Subject: [PATCH 02/16] adding necessary code to allow for modules in syspanel --- django-openstack/django_openstack/signals.py | 17 +++++++++++++++++ .../templatetags/sidebar_signals.py | 16 ++++++++++++++++ .../dashboard/templates/_sidebar_module.html | 7 +++++++ .../dashboard/templates/_syspanel_sidebar.html | 6 +++++- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 django-openstack/django_openstack/signals.py create mode 100644 django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py create mode 100644 openstack-dashboard/dashboard/templates/_sidebar_module.html diff --git a/django-openstack/django_openstack/signals.py b/django-openstack/django_openstack/signals.py new file mode 100644 index 000000000..516ce4f2a --- /dev/null +++ b/django-openstack/django_openstack/signals.py @@ -0,0 +1,17 @@ +from django.dispatch import receiver +import django.dispatch + +module_handler = django.dispatch.Signal(providing_args=['foo']) + +@receiver(module_handler) +def my_callback(sender, **kwargs): + print "########################################################!" + print kwargs['foo'] + print "########################################################!" + + + +class DashModule(object): + + def send_signal(self, foo): + module_handler.send(sender=self, foo=foo) diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py new file mode 100644 index 000000000..7eae7e3c4 --- /dev/null +++ b/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py @@ -0,0 +1,16 @@ +from django import template +from django.dispatch import receiver +import django.dispatch + +register = template.Library() + +sidebar_init = django.dispatch.Signal() + + +@register.inclusion_tag('_sidebar_module.html') +def initiate_module_sidebar(): + response = sidebar_init.send(sender=sidebar_init)[0][1] + print "###" + print response + print "###" + return response diff --git a/openstack-dashboard/dashboard/templates/_sidebar_module.html b/openstack-dashboard/dashboard/templates/_sidebar_module.html new file mode 100644 index 000000000..54004a74a --- /dev/null +++ b/openstack-dashboard/dashboard/templates/_sidebar_module.html @@ -0,0 +1,7 @@ +

    {{title}}

    + + \ No newline at end of file diff --git a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html index 4f61e0201..8485f43cd 100644 --- a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html @@ -1,3 +1,5 @@ +{% load sidebar_signals %} + From d58f1854adbb4b8f5a121792a30794a209000d34 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Thu, 28 Jul 2011 14:24:12 -0700 Subject: [PATCH 03/16] a few small fixes to the way modules work --- django-openstack/django_openstack/signals.py | 17 ----------------- .../templatetags/sidebar_signals.py | 4 +--- .../dashboard/templates/_sidebar_module.html | 7 +++++-- openstack-dashboard/dashboard/urls.py | 4 ++-- 4 files changed, 8 insertions(+), 24 deletions(-) delete mode 100644 django-openstack/django_openstack/signals.py diff --git a/django-openstack/django_openstack/signals.py b/django-openstack/django_openstack/signals.py deleted file mode 100644 index 516ce4f2a..000000000 --- a/django-openstack/django_openstack/signals.py +++ /dev/null @@ -1,17 +0,0 @@ -from django.dispatch import receiver -import django.dispatch - -module_handler = django.dispatch.Signal(providing_args=['foo']) - -@receiver(module_handler) -def my_callback(sender, **kwargs): - print "########################################################!" - print kwargs['foo'] - print "########################################################!" - - - -class DashModule(object): - - def send_signal(self, foo): - module_handler.send(sender=self, foo=foo) diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py index 7eae7e3c4..2dff7c729 100644 --- a/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py +++ b/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py @@ -10,7 +10,5 @@ sidebar_init = django.dispatch.Signal() @register.inclusion_tag('_sidebar_module.html') def initiate_module_sidebar(): response = sidebar_init.send(sender=sidebar_init)[0][1] - print "###" - print response - print "###" + return response diff --git a/openstack-dashboard/dashboard/templates/_sidebar_module.html b/openstack-dashboard/dashboard/templates/_sidebar_module.html index 54004a74a..3b4a637da 100644 --- a/openstack-dashboard/dashboard/templates/_sidebar_module.html +++ b/openstack-dashboard/dashboard/templates/_sidebar_module.html @@ -1,7 +1,10 @@

    {{title}}

    +{{request.view}} + \ No newline at end of file + + diff --git a/openstack-dashboard/dashboard/urls.py b/openstack-dashboard/dashboard/urls.py index 1eee8fa53..58687f11c 100644 --- a/openstack-dashboard/dashboard/urls.py +++ b/openstack-dashboard/dashboard/urls.py @@ -28,7 +28,7 @@ from django.views import generic as generic_views import django.views.i18n from django_openstack import urls as django_openstack_urls - +from openstack_dashboard_iframer import urls as openstack_dashboard_iframer_urls urlpatterns = patterns('', url(r'^$', 'dashboard.views.splash', name='splash'), @@ -39,7 +39,7 @@ urlpatterns = patterns('', # NOTE(termie): just append them since we want the routes at the root urlpatterns += django_openstack_urls.urlpatterns - +urlpatterns += openstack_dashboard_iframer_urls.urlpatterns urlpatterns += patterns('', (r'^%s(?P.*)$' % settings.MEDIA_URL[1:], From 523c364b70d0a135db14bd75b8b525e00c889c42 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Mon, 1 Aug 2011 11:14:34 -0700 Subject: [PATCH 04/16] adding urls --- openstack-dashboard/dashboard/settings.py | 2 +- openstack-dashboard/dashboard/urls.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openstack-dashboard/dashboard/settings.py b/openstack-dashboard/dashboard/settings.py index b65b271ed..ca98369ad 100644 --- a/openstack-dashboard/dashboard/settings.py +++ b/openstack-dashboard/dashboard/settings.py @@ -84,7 +84,7 @@ INSTALLED_APPS = ( 'django_openstack', 'django_openstack.templatetags', 'mailer', - 'dashboard.openstack_dashboard_iframer' + 'dashboard.osdash_module_iframer' ) TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' diff --git a/openstack-dashboard/dashboard/urls.py b/openstack-dashboard/dashboard/urls.py index 58687f11c..f979264be 100644 --- a/openstack-dashboard/dashboard/urls.py +++ b/openstack-dashboard/dashboard/urls.py @@ -28,7 +28,7 @@ from django.views import generic as generic_views import django.views.i18n from django_openstack import urls as django_openstack_urls -from openstack_dashboard_iframer import urls as openstack_dashboard_iframer_urls +from osdash_module_iframer import urls as osdash_module_iframer_urls urlpatterns = patterns('', url(r'^$', 'dashboard.views.splash', name='splash'), @@ -39,7 +39,7 @@ urlpatterns = patterns('', # NOTE(termie): just append them since we want the routes at the root urlpatterns += django_openstack_urls.urlpatterns -urlpatterns += openstack_dashboard_iframer_urls.urlpatterns +urlpatterns += osdash_module_iframer_urls.urlpatterns urlpatterns += patterns('', (r'^%s(?P.*)$' % settings.MEDIA_URL[1:], From a051c85d7dce5a10bcab68d1f14146cefc489e5c Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Mon, 1 Aug 2011 17:05:52 -0700 Subject: [PATCH 05/16] hashing out more general modules --- django-openstack/django_openstack/signals.py | 24 +++++++++++++++++++ .../templatetags/sidebar_modules.py | 10 ++++++++ .../templatetags/sidebar_signals.py | 14 ----------- django-openstack/django_openstack/urls.py | 5 ++++ openstack-dashboard/dashboard/settings.py | 1 - .../dashboard/templates/_dash_sidebar.html | 5 ++++ .../dashboard/templates/_sidebar_module.html | 18 +++++++------- .../templates/_syspanel_sidebar.html | 2 +- openstack-dashboard/dashboard/urls.py | 2 -- 9 files changed, 54 insertions(+), 27 deletions(-) create mode 100644 django-openstack/django_openstack/signals.py create mode 100644 django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py delete mode 100644 django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py diff --git a/django-openstack/django_openstack/signals.py b/django-openstack/django_openstack/signals.py new file mode 100644 index 000000000..6a440c72a --- /dev/null +++ b/django-openstack/django_openstack/signals.py @@ -0,0 +1,24 @@ +import django.dispatch +from django.dispatch import receiver + +dash_apps_ping = django.dispatch.Signal() +dash_apps_urls = django.dispatch.Signal() + + +def dash_apps_detection(): + """ + Sends a pinging signal to the app, all listening modules will reply with + items for the sidebar. + """ + return dash_apps_ping.send(sender=dash_apps_ping) + + +def dash_app_setup_urls(): + """ + Adds urls from modules + """ + response = dash_apps_urls.send(senter=dash_apps_urls) + + return response + + diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py new file mode 100644 index 000000000..a20d829cf --- /dev/null +++ b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py @@ -0,0 +1,10 @@ +from django import template +from django_openstack import signals + +register = template.Library() + + + +@register.inclusion_tag('_sidebar_module.html') +def initiate_module_sidebar(): + return {'modules': [module[1] for module in signals.dash_apps_detection()] } diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py deleted file mode 100644 index 2dff7c729..000000000 --- a/django-openstack/django_openstack/templatetags/templatetags/sidebar_signals.py +++ /dev/null @@ -1,14 +0,0 @@ -from django import template -from django.dispatch import receiver -import django.dispatch - -register = template.Library() - -sidebar_init = django.dispatch.Signal() - - -@register.inclusion_tag('_sidebar_module.html') -def initiate_module_sidebar(): - response = sidebar_init.send(sender=sidebar_init)[0][1] - - return response diff --git a/django-openstack/django_openstack/urls.py b/django-openstack/django_openstack/urls.py index bd4491cff..8031eb8bd 100644 --- a/django-openstack/django_openstack/urls.py +++ b/django-openstack/django_openstack/urls.py @@ -20,9 +20,14 @@ from django.conf.urls.defaults import * from django.conf import settings +from django_openstack.signals import * urlpatterns = patterns('', url(r'^auth/', include('django_openstack.auth.urls')), url(r'^dash/', include('django_openstack.dash.urls')), url(r'^syspanel/', include('django_openstack.syspanel.urls')), ) + +# import urls from modules +for module_urls in dash_apps_urls.send(sender=dash_apps_urls): + urlpatterns += module_urls[1].urlpatterns diff --git a/openstack-dashboard/dashboard/settings.py b/openstack-dashboard/dashboard/settings.py index ca98369ad..a12d76996 100644 --- a/openstack-dashboard/dashboard/settings.py +++ b/openstack-dashboard/dashboard/settings.py @@ -84,7 +84,6 @@ INSTALLED_APPS = ( 'django_openstack', 'django_openstack.templatetags', 'mailer', - 'dashboard.osdash_module_iframer' ) TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' diff --git a/openstack-dashboard/dashboard/templates/_dash_sidebar.html b/openstack-dashboard/dashboard/templates/_dash_sidebar.html index 027fcf5bb..ecaa3659b 100644 --- a/openstack-dashboard/dashboard/templates/_dash_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_dash_sidebar.html @@ -1,3 +1,5 @@ +{% load sidebar_modules %} + diff --git a/openstack-dashboard/dashboard/templates/_sidebar_module.html b/openstack-dashboard/dashboard/templates/_sidebar_module.html index 3b4a637da..12b9eb6ee 100644 --- a/openstack-dashboard/dashboard/templates/_sidebar_module.html +++ b/openstack-dashboard/dashboard/templates/_sidebar_module.html @@ -1,10 +1,10 @@ -

    {{title}}

    - -{{request.view}} - - +{% for module in modules %} +

    {{module.title}}

    + + +{% endfor %} diff --git a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html index 8485f43cd..fc4152b00 100644 --- a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html @@ -1,4 +1,4 @@ -{% load sidebar_signals %} +{% load sidebar_modules %} diff --git a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html index fc4152b00..8ba5aa7de 100644 --- a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html @@ -13,6 +13,6 @@
  • Quotas
  • - {% initiate_module_sidebar %} + {% syspanel_sidebar_modules %} From 62bd21d114b0663ac31f9d68616d200bbcabc5e5 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Mon, 1 Aug 2011 17:59:06 -0700 Subject: [PATCH 07/16] making active links work properly in sidebar for modules --- .../templatetags/templatetags/sidebar_modules.py | 8 ++++---- .../dashboard/templates/_dash_sidebar.html | 2 +- .../dashboard/templates/_sidebar_module.html | 2 +- .../dashboard/templates/_syspanel_sidebar.html | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py index 02dd3134e..c7c606682 100644 --- a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py +++ b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py @@ -6,12 +6,12 @@ register = template.Library() @register.inclusion_tag('_sidebar_module.html') -def dash_sidebar_modules(): +def dash_sidebar_modules(request): if signals.dash_apps_detection()[0][1]['type'] == "dash": - return {'modules': [module[1] for module in signals.dash_apps_detection()] } + return {'modules': [module[1] for module in signals.dash_apps_detection()], 'request': request } @register.inclusion_tag('_sidebar_module.html') -def syspanel_sidebar_modules(): +def syspanel_sidebar_modules(request): if signals.dash_apps_detection()[0][1]['type'] == "syspanel": - return {'modules': [module[1] for module in signals.dash_apps_detection()] } + return {'modules': [module[1] for module in signals.dash_apps_detection()], 'request': request } diff --git a/openstack-dashboard/dashboard/templates/_dash_sidebar.html b/openstack-dashboard/dashboard/templates/_dash_sidebar.html index df88cb47d..cb5dacbdf 100644 --- a/openstack-dashboard/dashboard/templates/_dash_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_dash_sidebar.html @@ -15,6 +15,6 @@ {% endif %} - {% dash_sidebar_modules %} + {% dash_sidebar_modules request %} diff --git a/openstack-dashboard/dashboard/templates/_sidebar_module.html b/openstack-dashboard/dashboard/templates/_sidebar_module.html index 12b9eb6ee..a472725e5 100644 --- a/openstack-dashboard/dashboard/templates/_sidebar_module.html +++ b/openstack-dashboard/dashboard/templates/_sidebar_module.html @@ -3,7 +3,7 @@ {% endfor %} diff --git a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html index 8ba5aa7de..e152e4df8 100644 --- a/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html +++ b/openstack-dashboard/dashboard/templates/_syspanel_sidebar.html @@ -13,6 +13,6 @@
  • Quotas
  • - {% syspanel_sidebar_modules %} + {% syspanel_sidebar_modules request %} From d33864754ec83ad673b3388fdb43079aabf3108a Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Tue, 9 Aug 2011 15:43:21 -0700 Subject: [PATCH 08/16] fixing typo, consolidating down code --- django-openstack/django_openstack/signals.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/django-openstack/django_openstack/signals.py b/django-openstack/django_openstack/signals.py index 6a440c72a..2d3175328 100644 --- a/django-openstack/django_openstack/signals.py +++ b/django-openstack/django_openstack/signals.py @@ -17,8 +17,6 @@ def dash_app_setup_urls(): """ Adds urls from modules """ - response = dash_apps_urls.send(senter=dash_apps_urls) - - return response + return dash_apps_urls.send(sender=dash_apps_urls) From c17687afb8ce345241e893203ef492ec8596152b Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Tue, 9 Aug 2011 15:45:05 -0700 Subject: [PATCH 09/16] rephrasing method name as a verb instead of statement --- django-openstack/django_openstack/signals.py | 2 +- .../templatetags/templatetags/sidebar_modules.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/django-openstack/django_openstack/signals.py b/django-openstack/django_openstack/signals.py index 2d3175328..e5993af98 100644 --- a/django-openstack/django_openstack/signals.py +++ b/django-openstack/django_openstack/signals.py @@ -5,7 +5,7 @@ dash_apps_ping = django.dispatch.Signal() dash_apps_urls = django.dispatch.Signal() -def dash_apps_detection(): +def dash_apps_detect(): """ Sends a pinging signal to the app, all listening modules will reply with items for the sidebar. diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py index c7c606682..5371dca7d 100644 --- a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py +++ b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py @@ -7,11 +7,11 @@ register = template.Library() @register.inclusion_tag('_sidebar_module.html') def dash_sidebar_modules(request): - if signals.dash_apps_detection()[0][1]['type'] == "dash": - return {'modules': [module[1] for module in signals.dash_apps_detection()], 'request': request } + if signals.dash_apps_detect()[0][1]['type'] == "dash": + return {'modules': [module[1] for module in signals.dash_apps_detect()], 'request': request } @register.inclusion_tag('_sidebar_module.html') def syspanel_sidebar_modules(request): - if signals.dash_apps_detection()[0][1]['type'] == "syspanel": - return {'modules': [module[1] for module in signals.dash_apps_detection()], 'request': request } + if signals.dash_apps_detect()[0][1]['type'] == "syspanel": + return {'modules': [module[1] for module in signals.dash_apps_detect()], 'request': request } From 2a349e6a10758deca0287eec6ae2b527d53dd05f Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Tue, 9 Aug 2011 15:45:59 -0700 Subject: [PATCH 10/16] making things a little more pep8 friendly --- .../templatetags/templatetags/sidebar_modules.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py index 5371dca7d..244a4f1f4 100644 --- a/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py +++ b/django-openstack/django_openstack/templatetags/templatetags/sidebar_modules.py @@ -4,14 +4,15 @@ from django_openstack import signals register = template.Library() - @register.inclusion_tag('_sidebar_module.html') def dash_sidebar_modules(request): if signals.dash_apps_detect()[0][1]['type'] == "dash": - return {'modules': [module[1] for module in signals.dash_apps_detect()], 'request': request } + return {'modules': [module[1] for module in signals.dash_apps_detect()], + 'request': request } @register.inclusion_tag('_sidebar_module.html') def syspanel_sidebar_modules(request): if signals.dash_apps_detect()[0][1]['type'] == "syspanel": - return {'modules': [module[1] for module in signals.dash_apps_detect()], 'request': request } - + return {'modules': [module[1] for module in signals.dash_apps_detect()], + 'request': request } + From 7dfa3191c3f5e82394df02657d499b42c4f5a276 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Tue, 9 Aug 2011 16:04:11 -0700 Subject: [PATCH 11/16] adding a bit of documentation --- django-openstack/django_openstack/signals.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/django-openstack/django_openstack/signals.py b/django-openstack/django_openstack/signals.py index e5993af98..b2c7e0681 100644 --- a/django-openstack/django_openstack/signals.py +++ b/django-openstack/django_openstack/signals.py @@ -9,6 +9,16 @@ def dash_apps_detect(): """ Sends a pinging signal to the app, all listening modules will reply with items for the sidebar. + + The response is a tuple of the Signal object instance, and a dictionary. + The values within the dictionary containing links and a title which should + be added to the sidebar navigation. + + Example: (, + {'title': 'Nixon', + 'links': [{'url':'/syspanel/nixon/google', + 'text':'Google', 'active_text': 'google'}], + 'type': syspanel}) """ return dash_apps_ping.send(sender=dash_apps_ping) From ba77683dbaa2e2d544291b69f2b32c32aefb8bf6 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Thu, 18 Aug 2011 14:42:08 -0700 Subject: [PATCH 12/16] adding httpresponse to update image view, without it dashboard will crash on update of image --- django-openstack/django_openstack/syspanel/views/images.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-openstack/django_openstack/syspanel/views/images.py b/django-openstack/django_openstack/syspanel/views/images.py index d3478f952..d0f082c68 100644 --- a/django-openstack/django_openstack/syspanel/views/images.py +++ b/django-openstack/django_openstack/syspanel/views/images.py @@ -160,7 +160,7 @@ def update(request, image_id): exc_info=True) messages.error(request, "Image could not be updated, please try again.") - + return redirect('syspanel_images_update', image_id) else: LOG.error('Image "%s" failed to update' % image['name'], exc_info=True) From 8b8b8d408b20c99166cdb5a86f5b7e42498025b5 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Thu, 18 Aug 2011 14:51:07 -0700 Subject: [PATCH 13/16] syspanel instances will now show globally launched instances after ajax refresh --- django-openstack/django_openstack/syspanel/views/instances.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-openstack/django_openstack/syspanel/views/instances.py b/django-openstack/django_openstack/syspanel/views/instances.py index 4f6f8cd3b..e797fb846 100644 --- a/django-openstack/django_openstack/syspanel/views/instances.py +++ b/django-openstack/django_openstack/syspanel/views/instances.py @@ -206,7 +206,7 @@ def refresh(request): instances = [] try: - instances = api.server_list(request) + instances = api.admin_server_list(request) except Exception as e: messages.error(request, 'Unable to get instance list: %s' % e.message) From 783654a9b67d865132e9a0209de72a08b0bf6516 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Thu, 18 Aug 2011 15:31:37 -0700 Subject: [PATCH 14/16] adding a simple checkbox to toggle ajax refreshing --- .../templates/syspanel_instances.html | 27 ++++++++++++++++--- .../media/dashboard/css/style.css | 13 +++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/openstack-dashboard/dashboard/templates/syspanel_instances.html b/openstack-dashboard/dashboard/templates/syspanel_instances.html index 684b5189c..31dfc4565 100644 --- a/openstack-dashboard/dashboard/templates/syspanel_instances.html +++ b/openstack-dashboard/dashboard/templates/syspanel_instances.html @@ -27,19 +27,38 @@ {% endblock footer_js %} diff --git a/openstack-dashboard/media/dashboard/css/style.css b/openstack-dashboard/media/dashboard/css/style.css index 1fc3d95bd..cfbc8193d 100644 --- a/openstack-dashboard/media/dashboard/css/style.css +++ b/openstack-dashboard/media/dashboard/css/style.css @@ -317,6 +317,19 @@ a.refresh.refreshing { background: url(../images/spinner.gif) top left no-repeat; } +input.refreshOption { + margin: 10px 0 0 0; + float: right; + clear: both; +} + +label.refreshOption { + font-size: 11px; + margin: -17px 20px 0 0; + float: right; + clear: both; +} + #monitoring { background: #f8f8f8; font-size: 14px; From d85bea953855f46e6b3a2d6e7a64bda18300fe26 Mon Sep 17 00:00:00 2001 From: Jake Dahn Date: Thu, 18 Aug 2011 15:45:10 -0700 Subject: [PATCH 15/16] adding ajax toggler to dash instance list --- .../dashboard/templates/dash_instances.html | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/openstack-dashboard/dashboard/templates/dash_instances.html b/openstack-dashboard/dashboard/templates/dash_instances.html index f6b1d9195..7d7d20190 100644 --- a/openstack-dashboard/dashboard/templates/dash_instances.html +++ b/openstack-dashboard/dashboard/templates/dash_instances.html @@ -25,21 +25,40 @@ {% block footer_js %} {% endblock footer_js %} From 5427d00ad24cdb1b39fef1bf659e3bb468455afd Mon Sep 17 00:00:00 2001 From: Doug Doan Date: Sat, 20 Aug 2011 21:14:40 -0700 Subject: [PATCH 16/16] Add missing kombu dependency --- openstack-dashboard/tools/pip-requires | 1 + 1 file changed, 1 insertion(+) diff --git a/openstack-dashboard/tools/pip-requires b/openstack-dashboard/tools/pip-requires index 9250da03b..03c3dfddb 100644 --- a/openstack-dashboard/tools/pip-requires +++ b/openstack-dashboard/tools/pip-requires @@ -14,6 +14,7 @@ PasteDeploy sqlalchemy-migrate eventlet xattr +kombu bzr+https://launchpad.net/glance#egg=glance -e git://github.com/jacobian/openstack.compute.git#egg=openstack