From be1dd95ef614c4ae1793c17dcc7edb96c2a69e1a Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Sat, 19 Oct 2013 13:49:44 +0200 Subject: [PATCH] Demo OpenLab Debug off in manifold/static/js/manifold.js --- manifold/static/js/manifold.js | 3 +- myslice/config.py | 3 ++ myslice/myslice.ini | 2 +- plugins/messages/__init__.py | 1 + portal/platformsview.py | 4 +- portal/registrationview.py | 6 ++- portal/slicerequestview.py | 5 +- portal/sliceview.py | 88 +++++++++++++++++----------------- 8 files changed, 60 insertions(+), 52 deletions(-) diff --git a/manifold/static/js/manifold.js b/manifold/static/js/manifold.js index 7da47004..c4d0ef73 100644 --- a/manifold/static/js/manifold.js +++ b/manifold/static/js/manifold.js @@ -730,6 +730,7 @@ var manifold = { if (publish_uuid) $.publish("/results/" + publish_uuid + "/failed", [data.code, data.description] ); +/* DEMO - Debug Messages desactivated $("#notifications").notify("create", "sticky", { title: 'Warning', text: data.description @@ -737,7 +738,7 @@ var manifold = { expires: false, speed: 1000 }); - +*/ } if (manifold.asynchroneous_debug) messages.debug ("========== asynchroneous_success " + query.object + " -- before process_query_records"); diff --git a/myslice/config.py b/myslice/config.py index 51bf4b79..31dc7e31 100644 --- a/myslice/config.py +++ b/myslice/config.py @@ -2,10 +2,13 @@ import os.path from ConfigParser import RawConfigParser from myslice.settings import ROOT +# myslice/myslice.ini # as this code suggests, you have the option to write myslice/myslice.ini # that looks like this #[manifold] #url = http://manifold.pl.sophia.inria.fr:7080/ +#admin_user = admin +#admin_password = admin class Config: diff --git a/myslice/myslice.ini b/myslice/myslice.ini index c22836e9..325191d0 100644 --- a/myslice/myslice.ini +++ b/myslice/myslice.ini @@ -1,4 +1,4 @@ [manifold] url = http://localhost:7080 admin_user = admin -admin_password = admin +admin_password = demo diff --git a/plugins/messages/__init__.py b/plugins/messages/__init__.py index 65baea15..7ee0c3ce 100644 --- a/plugins/messages/__init__.py +++ b/plugins/messages/__init__.py @@ -2,6 +2,7 @@ from unfold.plugin import Plugin # lists levels and sets them to enabled or not at startup default_levels = {'fatal': True, 'error': True, 'warning' : True, 'info' : True, 'debug' : False} +#default_levels = {'fatal': False, 'error': False, 'warning' : False, 'info' : False, 'debug' : False} # there are two implementations available here # one shows up in the main page like a regular part of the page, diff --git a/portal/platformsview.py b/portal/platformsview.py index ddc96892..d3c3ca00 100644 --- a/portal/platformsview.py +++ b/portal/platformsview.py @@ -14,8 +14,8 @@ class PlatformsView(TemplateView): def get_context_data(self, **kwargs): page = Page(self.request) - #platform_query = Query().get('local:platform').filter_by('disabled', '==', '0').select('platform','platform_longname','gateway_type') - platform_query = Query().get('local:platform').select('platform','platform_longname','gateway_type') + platform_query = Query().get('local:platform').filter_by('disabled', '==', '0').select('platform','platform_longname','gateway_type') + #platform_query = Query().get('local:platform').select('platform','platform_longname','gateway_type') page.enqueue_query(platform_query) page.expose_js_metadata() diff --git a/portal/registrationview.py b/portal/registrationview.py index 4c7c8f2c..ba737009 100644 --- a/portal/registrationview.py +++ b/portal/registrationview.py @@ -1,4 +1,5 @@ import os.path, re +import json from django.core.mail import send_mail @@ -33,10 +34,11 @@ class RegistrationView (View): select('name', 'authority_hrn') onelab_enabled_query = Query.get('local:platform').filter_by('platform', '==', 'ple-onelab').filter_by('disabled', '==', 'False') - onelab_enabled = not not execute_admin_query(request, onelab_enabled_query) + #onelab_enabled = not not execute_admin_query(request, onelab_enabled_query) + onelab_enabled = True if onelab_enabled: print "ONELAB ENABLED" - authorities_query = authorities_query.filter_by('authority_hrn', 'included', ['ple.inria', 'ple.upmc']) + authorities_query = authorities_query.filter_by('authority_hrn', 'included', ['ple.inria', 'ple.upmc', 'ple.ibbtple']) else: print "FIREXP ENABLED" diff --git a/portal/slicerequestview.py b/portal/slicerequestview.py index d3c73d37..e8c80d8e 100644 --- a/portal/slicerequestview.py +++ b/portal/slicerequestview.py @@ -18,9 +18,10 @@ class SliceRequestView (LoginRequiredAutoLogoutView): select('name', 'authority_hrn') onelab_enabled_query = Query.get('local:platform').filter_by('platform', '==', 'ple-onelab').filter_by('disabled', '==', 'False') - onelab_enabled = not not execute_admin_query(request, onelab_enabled_query) + #onelab_enabled = not not execute_admin_query(request, onelab_enabled_query) + onelab_enabled = True if onelab_enabled: - authorities_query = authorities_query.filter_by('authority_hrn', 'included', ['ple.inria', 'ple.upmc']) + authorities_query = authorities_query.filter_by('authority_hrn', 'included', ['ple.inria', 'ple.upmc', 'ple.ibbtple']) authorities = execute_admin_query(request, authorities_query) #authorities = sorted(authorities) diff --git a/portal/sliceview.py b/portal/sliceview.py index 2f22789d..9d335f49 100644 --- a/portal/sliceview.py +++ b/portal/sliceview.py @@ -216,52 +216,52 @@ class SliceView (LoginRequiredAutoLogoutView): 'bAutoWidth' : True, }, )) - +# DEMO # -------------------------------------------------------------------------- # MEASUREMENTS - tab_measurements = Tabs ( - page = page, - active_domid = 'measurements-list', - outline_complete = True, - togglable = True, - title = 'Measurements', - domid = 'measurements', - ) - main_stack.insert(tab_measurements) - - tab_measurements.insert(Hazelnut( - page = page, - title = 'Measurements', - domid = 'measurements-list', - # tab's sons preferably turn this off - togglable = False, - # this is the query at the core of the slice list - query = sq_measurement, - # do NOT set checkboxes to False - # this table being otherwise empty, it just does not fly with dataTables - checkboxes = True, - datatables_options = { - 'iDisplayLength' : 25, - 'bLengthChange' : True, - 'bAutoWidth' : True, - }, - )) - - # -------------------------------------------------------------------------- - # MESSAGES (we use transient=False for now) - main_stack.insert(Messages( - page = page, - title = "Runtime messages for slice %s"%slicename, - domid = "msgs-pre", - levels = "ALL", - # plain messages are probably less nice for production but more reliable for development for now - transient = False, - # these make sense only in non-transient mode.. - togglable = True, - toggled = 'persistent', - outline_complete = True, - )) - +# tab_measurements = Tabs ( +# page = page, +# active_domid = 'measurements-list', +# outline_complete = True, +# togglable = True, +# title = 'Measurements', +# domid = 'measurements', +# ) +# main_stack.insert(tab_measurements) +# +# tab_measurements.insert(Hazelnut( +# page = page, +# title = 'Measurements', +# domid = 'measurements-list', +# # tab's sons preferably turn this off +# togglable = False, +# # this is the query at the core of the slice list +# query = sq_measurement, +# # do NOT set checkboxes to False +# # this table being otherwise empty, it just does not fly with dataTables +# checkboxes = True, +# datatables_options = { +# 'iDisplayLength' : 25, +# 'bLengthChange' : True, +# 'bAutoWidth' : True, +# }, +# )) +# +# # -------------------------------------------------------------------------- +# # MESSAGES (we use transient=False for now) +# main_stack.insert(Messages( +# page = page, +# title = "Runtime messages for slice %s"%slicename, +# domid = "msgs-pre", +# levels = "ALL", +# # plain messages are probably less nice for production but more reliable for development for now +# transient = False, +# # these make sense only in non-transient mode.. +# togglable = True, +# toggled = 'persistent', +# outline_complete = True, +# )) +# # variables that will get passed to the view-unfold1.html template template_env = {} -- 2.43.0