- Modified some SLA texts
authorjavier <javier.garcial.external@atos.net>
Tue, 17 Jun 2014 10:36:44 +0000 (12:36 +0200)
committerjavier <javier.garcial.external@atos.net>
Tue, 17 Jun 2014 10:36:44 +0000 (12:36 +0200)
- Added img resources for Service Directory
- Added print information to console to detect bad json parsing error

plugins/queryupdater/static/js/queryupdater.js
portal/static/css/fed4fire.css
portal/static/img/servicedirectory/hadoop.png [new file with mode: 0755]
portal/static/img/servicedirectory/smartsantander.png [new file with mode: 0755]
portal/templates/servicedirectory.html
sla/slaclient/restclient.py

index 7718253..8c68037 100644 (file)
             var flagVW = false;
             var  flagWi = false;
 
+            promt.append('<p>SLA description</p>');
+            
             var wilabForm = "";
-            var wimessage = '<p>SLA description</p><p>to be deployed</p>';
+            wilabForm += "<ul>";
             for(var iter = 0; iter < arrayselectedresources.length; iter++){
-                var list = '<p class="wi'+iter+'" name=wi"'+iter+'">'+arrayselectedresources[iter].toLowerCase()+'</p><br>';
+                var list = '<li class="wi'+iter+'" name=wi"'+iter+'">'+arrayselectedresources[iter].toLowerCase()+'</li>';
                 
-
                 if (arrayselectedresources[iter].toLowerCase().indexOf("wilab2") >= 0){
 
                     accepted_sla.push({"wilab2":false}); 
                 }
 
             }
+            wilabForm += "</ul>";
 
             //var wallmessage = '<p>SLA description</p><p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime</p>';
 
             var wallForm = "";
+            wallForm += "<ul>";
             for(var iter = 0; iter < arrayselectedresources.length; iter++){
-                var list = '<class="wall'+iter+'" name=wall"'+iter+'" >'+arrayselectedresources[iter].toLowerCase()+'</p><br>';
+                var list = '<li class="wall'+iter+'" name=wall"'+iter+'" >'+arrayselectedresources[iter].toLowerCase()+'</li>';
                 
                 if (arrayselectedresources[iter].toLowerCase().indexOf("wall2") >= 0){
 
                 }
 
             }
-            promt.append(wimessage);
+            wallForm += "</ul>";
+            
             var flagDouble = false;
             if(flagWi)
             {
                 flagDouble = true;
+                promt.append('<p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the WiLab2 resources during the sliver lifetime</p>');
                 promt.append(wilabForm);
+                promt.append('<br />');
             }
             if(flagVW)
             {
                 //promt.append(wallmessage);
                 flagDouble = true;
+                promt.append('<p>Testbed guarantees 0.99 Uptime rate for 0.99 rate of the VirtualWall resources during the sliver lifetime</p>');
                 promt.append(wallForm);
+                promt.append('<br />');
             }
 
                         
index fd9bc19..ad8c332 100644 (file)
@@ -488,8 +488,8 @@ div#appservices div.row {
     padding: 15px 15px;
 }
 
-div.portfolio-item {
-    
+div.portfolio-item img{
+    width: 150px;
 }
 
 div.portfolio-item p[id*='name-'] {
diff --git a/portal/static/img/servicedirectory/hadoop.png b/portal/static/img/servicedirectory/hadoop.png
new file mode 100755 (executable)
index 0000000..5e8affe
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 (executable)
index 0000000..806e459
Binary files /dev/null and b/portal/static/img/servicedirectory/smartsantander.png differ
index 7a1893f..ebd98d8 100644 (file)
@@ -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 = $('<div class="row">').append(
                       $('<div>').addClass("col-md-3 portfolio-item").append(
-                        $('<img>').attr('src', "http://placehold.it/150x150")
+                        $('<img>').attr('src', "{{ STATIC_URL }}img/servicedirectory/" + imgsrc)
                      ),
                       $('<div>').addClass("col-md-6 portfolio-item").append(
                         $('<p id="name-' + item.name.replace(/ /g,'') + '">').text(item.name),
index cdada8a..9d1306b 100755 (executable)
@@ -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):