From: Loic Baron Date: Thu, 11 Feb 2016 14:27:07 +0000 (+0100) Subject: Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=33710d17d14e2056a27ad77fca004929bf116bd5;hp=9fae97104e1a1cc73e0b3321310ebbb42a5b96fd;p=unfold.git Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab --- diff --git a/activity/__init__.py b/activity/__init__.py index be5779d9..4a7d5c30 100644 --- a/activity/__init__.py +++ b/activity/__init__.py @@ -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)) diff --git a/manifoldapi/static/js/manifold.js b/manifoldapi/static/js/manifold.js index b8bd502d..305231e0 100644 --- a/manifoldapi/static/js/manifold.js +++ b/manifoldapi/static/js/manifold.js @@ -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); diff --git a/plugins/filter_status/static/js/filter_status.js b/plugins/filter_status/static/js/filter_status.js index 7a301005..676d3ee1 100644 --- a/plugins/filter_status/static/js/filter_status.js +++ b/plugins/filter_status/static/js/filter_status.js @@ -121,6 +121,9 @@ 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) { diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index 76934e79..c22dbd2c 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -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]+).*?>(.*?)"); + 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]+).*?>(.*?)"); + 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)); + }; diff --git a/portal/templates/slice-resource-view.html b/portal/templates/slice-resource-view.html index cbd8d1bd..0a5d65ed 100644 --- a/portal/templates/slice-resource-view.html +++ b/portal/templates/slice-resource-view.html @@ -33,7 +33,7 @@ $(document).ready(function() {
-
+
{{ filter_status }}
@@ -55,7 +55,7 @@ $(document).ready(function() {
  • Table
  • Map
  • Scheduler
  • - +
    @@ -94,9 +94,9 @@ $(document).ready(function() {
    {{scheduler}}
    - +