Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorLoic Baron <loic.baron@lip6.fr>
Thu, 11 Feb 2016 14:29:13 +0000 (15:29 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Thu, 11 Feb 2016 14:29:13 +0000 (15:29 +0100)
activity/__init__.py
manifoldapi/static/js/manifold.js
plugins/filter_status/static/js/filter_status.js
plugins/querytable/static/js/querytable.js
portal/static/img/bg-smartfire.png
portal/templates/slice-resource-view.html
portal/templates/slice-tab-experiment.html
portal/templates/user_request_email.html
rest/sfa_api.py

index be5779d..4a7d5c3 100644 (file)
@@ -67,12 +67,12 @@ def logWrite(request, action, message, objects = None):
         "facility"      : None,
         "testbed"       : None,
     }
-    
+   
     if objects is not None:
         for o in objects :
             if (o in log) :
                 log[o] = objects[o]
-    
+
     try :
         result = urllib2.urlopen(server, urllib.urlencode(log))
         logger.info("===============>> activity: {} <{}> {}".format(action, request.user,message))
index b8bd502..305231e 100644 (file)
@@ -1715,7 +1715,7 @@ case TYPE_LIST_OF_VALUES:
                 // 
                 // +) If a reservable node is added to the slice, then it should have a corresponding lease
                 // XXX Not always a resource
-                var is_reservable = (record.exclusive == true);
+                var is_reservable = (record.exclusive == 'true' || record.exclusive == true);
                 if (is_reservable) {
                     // var warnings = manifold.query_store.get_record_state(query.query_uuid, record_key, STATE_WARNINGS);
 
index 7a30100..676d3ee 100644 (file)
             filter_status = this.dataset['status'];
             self.select_tab(filter_status);
 
+            // manifoldapi/static/js/manifold.js
+            // See this.apply_filters
+
             // ... and communicate the appropriate filters to the manager
             // NOTE: we use the manifold namespace for internal filters 
             if (self.prev_filter_status) {
index 76934e7..c22dbd2 100644 (file)
@@ -90,7 +90,7 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
                 sPaginationType: 'bootstrap',
                 // Handle the null values & the error : Datatables warning Requested unknown parameter
                 // http://datatables.net/forums/discussion/5331/datatables-warning-...-requested-unknown-parameter/p2
-                aoColumnDefs: [{sDefaultContent: '', aTargets: [ '_all' ]}],
+                aoColumnDefs: [{sDefaultContent: '', aTargets: [ '_all' ], "sType": "mysort"}],
                 // WARNING: this one causes tables in a 'tabs' that are not exposed at the time this is run to show up empty
                 // sScrollX: '100%',       /* Horizontal scrolling */
                 bProcessing: true,      /* Loading */
@@ -669,6 +669,66 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
             return result=$('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0';
         });
     };
+
+    // use sType: "mysort"  for any columns you wish to use these routines
+    // http://datatables.net/forums/discussion/7546/alpha-numeric-sort
+    jQuery.fn.dataTableExt.oSort['mysort-asc']  = function(a,b) {
+      var r = new RegExp("<([a-zA-Z]+).*?>(.*?)</\\1>");
+      if (r.exec(a) != null){
+        a = r.exec(a)[2];
+      }
+      if (r.exec(b) != null){
+        b = r.exec(b)[2];
+      }
+      a = a.replace(/[^A-Za-z0-9]/, "");
+      b = b.replace(/[^A-Za-z0-9]/, "");
+      var re = new RegExp("^([a-zA-Z]*)(.*)");
+      var x = re.exec(a);
+      var y = re.exec(b);
+     
+      // you might want to force the first portion to lowercase
+      // for case insensitive matching
+      // x[1] = x[1].toLowerCase();
+      // y[1] = y[1].toLowerCase();
+     
+      if (x[1] > y[1]) return 1;
+      if (x[1] < y[1]) return -1;
+     
+      // if you want to force the 2nd part to only be numeric:
+      x[2] = parseInt(x[2]);
+      y[2] = parseInt(y[2]);
+     
+      return ((x[2] < y[2]) ? -1 : ((x[2] > y[2]) ?  1 : 0));
+    };
+      
+    jQuery.fn.dataTableExt.oSort['mysort-desc'] = function(a,b) {
+      var r = new RegExp("<([a-zA-Z]+).*?>(.*?)</\\1>");
+      if (r.exec(a) != null){
+        a = r.exec(a)[2];
+      }
+      if (r.exec(b) != null){
+        b = r.exec(b)[2];
+      }
+      a = a.replace(/[^A-Za-z0-9]/, "");
+      b = b.replace(/[^A-Za-z0-9]/, "");
+      var re = new RegExp("^([a-zA-Z]*)(.*)");
+      var x = re.exec(a);
+      var y = re.exec(b);
+     
+      // you might want to force the first portion to lowercase
+      // for case insensitive matching
+      // x[1] = x[1].toLowerCase();
+      // y[1] = y[1].toLowerCase();
+     
+      if (x[1] > y[1]) return -1;
+      if (x[1] < y[1]) return 1;
+     
+      // if you want to force the 2nd part to only be numeric:
+      x[2] = parseInt(x[2]);
+      y[2] = parseInt(y[2]);
+     
+       return ((x[2] < y[2]) ?  1 : ((x[2] > y[2]) ? -1 : 0));
+    };
     
     
 
index f5340fc..7089931 100644 (file)
Binary files a/portal/static/img/bg-smartfire.png and b/portal/static/img/bg-smartfire.png differ
index cbd8d1b..0a5d65e 100644 (file)
@@ -33,7 +33,7 @@ $(document).ready(function() {
                </div>
        
                <div class="row">
-                       <div class="col-md-8">
+                       <div class="col-md-9">
                                {{ filter_status }}
                        </div>
                        <div class="col-md-1">
@@ -55,7 +55,7 @@ $(document).ready(function() {
                          <li class="active"><a href="#resourcelist" role="tab" data-toggle="tab">Table</a></li>
                          <li> <a href="#resourcemap" role="tab" data-toggle="tab">Map</a></li>
                          <li> <a href="#resourcescheduler" role="tab" data-toggle="tab">Scheduler</a></li>
-                         <!--<li> <a href="#resourcesasap" role="tab" data-toggle="tab">ASAP</a></li> -->
+                         <!-- <li> <a href="#resourcesasap" role="tab" data-toggle="tab">ASAP</a></li> -->
                        </ul>
                        </div>
                </div>
@@ -94,9 +94,9 @@ $(document).ready(function() {
                                <div class="tab-pane" id="resourcescheduler">
                        {{scheduler}}
                                </div>
-                                       <!-- <div class="tab-pane" id="resourcesasap">
+                                       <div class="tab-pane" id="resourcesasap">
                        {{asap}}
-                               </div> -->
+                               </div>
 
                                <!--
                                <div id="reserved" class="tab-pane" style="height:370px;display:none;">
index 1af5661..be351fb 100644 (file)
@@ -14,6 +14,7 @@ $(document).ready(function() {
     {% for platform in platforms %}
     // /sfa/Describe?hrn=onelab.upmc.projectx.slicex&platform[]={{platform}}&type=slice
     $.post("/sfa/Describe",{'hrn':'{{slicename}}', 'type':'slice', 'platform':['{{platform}}']}, function( data ) {
+        console.log(data);
         if('parsed' in data['{{platform}}'] && 'rspec' in data['{{platform}}']['parsed']){
             rspec = data['{{platform}}']['parsed']['rspec'];
             if('node' in rspec){
index 0702a92..204c293 100644 (file)
@@ -1,4 +1,4 @@
-<img src="{{current_site}}/static/img/{{theme.logo}}" width="80px">    
+<img src="{{current_site}}/static/img/{{theme.logo}}"> 
 <br>
 <h1>NEW USER REQUEST</h1>
 <br>
index cacf7fe..0a84093 100644 (file)
@@ -280,6 +280,7 @@ def sfa_client(request, method, hrn=None, urn=None, object_type=None, rspec=None
                             # ListResources(slice_hrn)
                             api_options['geni_slice_urn'] = urn
                             result = server.ListResources([object_cred], api_options)
+                            logger.debug(result)
                             dict_result = xmltodict.parse(result['value'])
                         # else GetVersion = v3
                         else: