From: Jordan Augé Date: Fri, 11 Jul 2014 13:09:56 +0000 (+0200) Subject: fixed removing pending_in slots X-Git-Tag: myslice-1.0~61 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2a9587298ad16d058568d06e82affd8d0b042988;p=myslice.git fixed removing pending_in slots --- diff --git a/manifoldapi/static/js/manifold.js b/manifoldapi/static/js/manifold.js index 57a6c390..b959c10e 100644 --- a/manifoldapi/static/js/manifold.js +++ b/manifoldapi/static/js/manifold.js @@ -351,6 +351,12 @@ function QueryStore() { return query_ext.records.remove(record_key); } + this.del_state = function(query_uuid, record_key) + { + var query_ext = this.find_analyzed_query_ext(query_uuid); + return query_ext.state.remove(record_key); + } + this.add_record = function(query_uuid, record, new_state) { var query_ext, key, record_key; @@ -386,6 +392,7 @@ function QueryStore() { // Leases that are marked out are in fact leases from other slices // We need to _remove_ leases that we mark as OUT manifold.query_store.del_record(query_uuid, record_key); + manifold.query_store.del_state(query_uuid, record_key); } else { manifold.query_store.set_record_state(query_uuid, record_key, STATE_SET, new_state); } diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index 102c456f..862b8a7b 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -313,7 +313,7 @@ var SCHEDULER_COLWIDTH = 50; } $scope._create_new_lease(model_resource.urn, start_time, end_time); - model_lease.status = 'pendingin'; + model_lease.status = (model_lease.status == 'free') ? 'pendingin' : 'in'; // unless the exact same lease already existed (pending_out status for the lease, not the cell !!) break; @@ -351,7 +351,7 @@ var SCHEDULER_COLWIDTH = 50; } // cf comment in previous switch case - model_lease.status = 'pendingout'; + model_lease.status = (model_lease.status == 'selected') ? 'pendingout' : 'free'; break; @@ -735,7 +735,11 @@ var SCHEDULER_COLWIDTH = 50; lease_success = ''; break; case STATE_SET_OUT_PENDING: - lease_class = 'pendingout'; + // pending_in & pending_out == IN == replacement + if (resource.leases[i].status == 'pendingin') + lease_class = 'pendingin' + else + lease_class = 'pendingout'; lease_success = ''; break;