From 538377ef211c2ad4c16cb51fd99d13b09120fe9f Mon Sep 17 00:00:00 2001 From: Loic Baron Date: Tue, 19 May 2015 18:06:32 +0200 Subject: [PATCH] Scheduler plugin: nodes available now = false or boot_state = disabled are displayed in maintenance --- plugins/scheduler2/static/js/scheduler2.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index 933f32f3..f56e6702 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -637,12 +637,17 @@ var SCHEDULER_COLWIDTH = 50; // Setup leases with a default free status... $.each(this.scope_resources_by_key, function(resource_key, resource) { resource.leases = []; + if(resource.available == 'false' || resource.boot_state == 'disabled'){ + state = 'maintenance'; + }else{ + state = 'free'; + } var colspan_lease = resource.granularity / self._slot_length; //eg. 3600 / 1800 => 2 cells time = SchedulerDateSelected.getTime(); for (i=0; i < self._all_slots.length / colspan_lease; i++) { // divide by granularity resource.leases.push({ id: 'coucou', - status: (time < now) ? 'disabled': 'free', // 'selected', 'reserved', 'maintenance' XXX pending ?? + status: (time < now) ? 'disabled': state, //'free', // 'selected', 'reserved', 'maintenance' XXX pending ?? }); time += resource.granularity * 1000; } -- 2.43.0