From: Yasin Date: Tue, 17 Jun 2014 13:52:40 +0000 (+0200) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Tag: myslice-1.1~64^2~10^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=147918f7fc73743e7665abcbfb376027d5d414f3;hp=fbc07f4f82f0d8ca8aee2db5399106d039d4ad69;p=unfold.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/plugins/queryupdater/static/js/queryupdater.js b/plugins/queryupdater/static/js/queryupdater.js index bf650bb4..8c68037f 100644 --- a/plugins/queryupdater/static/js/queryupdater.js +++ b/plugins/queryupdater/static/js/queryupdater.js @@ -93,12 +93,13 @@ var flagVW = false; var flagWi = false; + promt.append('

SLA description

'); + var wilabForm = ""; - var wimessage = '

SLA description

to be deployed

'; + wilabForm += ""; //var wallmessage = '

SLA description

Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime

'; var wallForm = ""; + wallForm += ""; + var flagDouble = false; if(flagWi) { flagDouble = true; + promt.append('

Testbed guarantees 0.99 Uptime rate for 0.99 rate of the WiLab2 resources during the sliver lifetime

'); promt.append(wilabForm); + promt.append('
'); } if(flagVW) { //promt.append(wallmessage); flagDouble = true; + promt.append('

Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime

'); promt.append(wallForm); + promt.append('
'); } @@ -182,7 +190,7 @@ $('#slamodal-wilab2').modal('hide'); accepted_sla["wilab2"] = true; - //this.do_update(e); + this.do_update(e); } }); diff --git a/plugins/testbeds/__init__.py b/plugins/testbeds/__init__.py index 6b2b89d9..a7dd15e9 100644 --- a/plugins/testbeds/__init__.py +++ b/plugins/testbeds/__init__.py @@ -7,9 +7,6 @@ class TestbedsPlugin(Plugin): # Until we have a proper way to access queries in Python self.query = query - self.query_network = query_network - self.query_network_uuid = query_network.query_uuid if query_network else None - self.query_all = query_all self.query_all_uuid = query_all.query_uuid if query_all else None @@ -31,7 +28,7 @@ class TestbedsPlugin(Plugin): # query_uuid will pass self.query results to the javascript # and will be available as "record" in : # on_new_record: function(record) - return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid', 'query_network_uuid'] + return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid'] def export_json_settings (self): return True diff --git a/plugins/testbeds/static/js/testbeds.js b/plugins/testbeds/static/js/testbeds.js index b9771270..5f990b99 100644 --- a/plugins/testbeds/static/js/testbeds.js +++ b/plugins/testbeds/static/js/testbeds.js @@ -29,7 +29,7 @@ /* Member variables */ this.filters = Array(); - + this.testbeds = Array(); /* Plugin events */ /* Setup query and record handlers */ @@ -39,7 +39,6 @@ // Some can be less efficient this.listen_query(options.query_uuid); this.listen_query(options.query_all_uuid, 'all'); - this.listen_query(options.query_network_uuid, 'network'); /* GUI setup and event binding */ // call function @@ -114,17 +113,25 @@ // ... be sure to list all events here /* RECORD HANDLERS */ - on_network_new_record: function(record) + on_all_new_record: function(record) { - row = ''; - row += ''+record["platform"]+''; - //row += ''+record["network_hrn"]+''; - row += '

'+record["network_hrn"]+'

'; - $('#testbeds-filter').append(row); + var self = this; + // If the resource has a network_hrn + if(record["network_hrn"]!="None" && record["network_hrn"]!="" && record["network_hrn"]!=null){ + // If this network_hrn is not listed yet + if(jQuery.inArray(record["network_hrn"],self.testbeds)==-1){ + row = ''; + //row += ''+record["platform"]+''; + //row += ''+record["network_hrn"]+''; + row += '

'+record["network_hrn"]+'

'; + $('#testbeds-filter').append(row); + self.testbeds.push(record["network_hrn"]); + } + } }, - /* When the network query is done, add the click event to the elements */ - on_network_query_done: function() { + /* When the query is done, add the click event to the elements */ + on_all_query_done: function() { var self = this; console.log('query network DONE'); $("[id^='testbeds-filter_']").on('click',function(e) { diff --git a/portal/sliceresourceview.py b/portal/sliceresourceview.py index 1ea6eada..5b8ce0f7 100644 --- a/portal/sliceresourceview.py +++ b/portal/sliceresourceview.py @@ -202,8 +202,8 @@ class SliceResourceView (LoginRequiredView, ThemeView): network_md = metadata.details_by_object('network') network_fields = [column['name'] for column in network_md['column']] - query_network = Query.get('network').select(network_fields) - page.enqueue_query(query_network) + #query_network = Query.get('network').select(network_fields) + #page.enqueue_query(query_network) filter_testbeds = TestbedsPlugin( page = page, @@ -211,7 +211,7 @@ class SliceResourceView (LoginRequiredView, ThemeView): title = 'Filter by testbeds', query = sq_resource, query_all = query_resource_all, - query_network = query_network, + #query_network = query_network, init_key = "network_hrn", checkboxes = True, datatables_options = { diff --git a/portal/static/css/fed4fire.css b/portal/static/css/fed4fire.css index fd9bc193..5633f19f 100644 --- a/portal/static/css/fed4fire.css +++ b/portal/static/css/fed4fire.css @@ -488,11 +488,11 @@ div#appservices div.row { padding: 15px 15px; } -div.portfolio-item { - +div.portfolio-item img{ + width: 150px; } div.portfolio-item p[id*='name-'] { font-weight: bold; cursor: pointer; -} \ No newline at end of file +} diff --git a/portal/static/img/servicedirectory/hadoop.png b/portal/static/img/servicedirectory/hadoop.png new file mode 100755 index 00000000..5e8affe8 Binary files /dev/null and b/portal/static/img/servicedirectory/hadoop.png differ diff --git a/portal/static/img/servicedirectory/smartsantander.png b/portal/static/img/servicedirectory/smartsantander.png new file mode 100755 index 00000000..806e459e Binary files /dev/null and b/portal/static/img/servicedirectory/smartsantander.png differ diff --git a/portal/templates/base.html b/portal/templates/base.html index decd041e..af81a0ed 100644 --- a/portal/templates/base.html +++ b/portal/templates/base.html @@ -3,7 +3,7 @@ {{theme}} portal - {{ section }} - + {# This is where insert_str will end up #}{% media_container prelude %} {% include 'messages-transient-header.html' %} diff --git a/portal/templates/fed4fire/fed4fire_home-view.html b/portal/templates/fed4fire/fed4fire_home-view.html index 8b94581b..71f110e0 100644 --- a/portal/templates/fed4fire/fed4fire_home-view.html +++ b/portal/templates/fed4fire/fed4fire_home-view.html @@ -16,7 +16,7 @@
- +
Loading Slices
@@ -27,9 +27,9 @@
@@ -50,11 +50,11 @@
- +

- +
@@ -66,7 +66,7 @@
- +
{% if person.last_name %} diff --git a/portal/templates/servicedirectory.html b/portal/templates/servicedirectory.html index 7a1893f6..ebd98d89 100644 --- a/portal/templates/servicedirectory.html +++ b/portal/templates/servicedirectory.html @@ -109,10 +109,17 @@ loadedTabs = []; $.each(data, function(i, item){ - console.log(item); + var imgsrc; + + if(item.name.toLowerCase().indexOf("santander") >= 0){ + imgsrc = "smartsantander.png"; + } else if(item.name.toLowerCase().indexOf("hadoop") >= 0){ + imgsrc = "hadoop.png"; + } + var row = $('
').append( $('
').addClass("col-md-3 portfolio-item").append( - $('').attr('src', "http://placehold.it/150x150") + $('').attr('src', "{{ STATIC_URL }}img/servicedirectory/" + imgsrc) ), $('
').addClass("col-md-6 portfolio-item").append( $('

').text(item.name), diff --git a/sla/slaclient/restclient.py b/sla/slaclient/restclient.py index cdada8a5..9d1306b1 100755 --- a/sla/slaclient/restclient.py +++ b/sla/slaclient/restclient.py @@ -117,6 +117,7 @@ class Client(object): result = requests.get(url, **kwargs) print "GET {} {} {}".format( result.url, result.status_code, result.text[0:70]) + return result def post(self, path, data=None, **kwargs): @@ -279,9 +280,20 @@ class Agreements(object): """ path = _buildpath_(agreementid, "guaranteestatus") r = self.res.client.get(path, headers={'accept': 'application/json'}) + + print "---- JSON Response ----" + print r.text + json_obj = r.json() + print "-- json_obj() --" + print type(json_obj) + print json_obj + status = wsag_model.AgreementStatus.json_decode(json_obj) + print "---- STATUS ----" + print status + return status, r def create(self, agreement):