From 8c4194ead0952c7d668fc84199cdf7fa6e682c24 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jordan=20Aug=C3=A9?= Date: Fri, 28 Mar 2014 15:54:46 +0100 Subject: [PATCH] Scheduler2: display nodes, each new_record create a row, to be optimized may require filtering for a big number of nodes --- plugins/scheduler2/static/css/scheduler2.css | 3 ++- plugins/scheduler2/static/js/scheduler2.js | 15 ++++++++++----- .../onelab/onelab_slice-resource-view.html | 3 ++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/scheduler2/static/css/scheduler2.css b/plugins/scheduler2/static/css/scheduler2.css index 11334334..d58f6d86 100755 --- a/plugins/scheduler2/static/css/scheduler2.css +++ b/plugins/scheduler2/static/css/scheduler2.css @@ -93,7 +93,8 @@ border-spacing: 0; max-width: 500px; width: 450px; - margin-top:55px; + margin-top: 6px !important; + /* margin-top:55px; */ } #ShedulerNodes th{ diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index 7c6c323d..f8830028 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -78,6 +78,7 @@ var schdlr_PartsInOneHour = 6; //this.listen_query(options.query_lease_uuid, 'lease'); if (Debug) console.timeEnd("Listening_to_queries"); + $("#ShedulerNodes tbody").html(''); }, /* PLUGIN EVENTS */ @@ -101,7 +102,8 @@ var schdlr_PartsInOneHour = 6; // same output as a jquery selector with some guarantees }, - drawResources: function () { + //drawResources: function () { + drawLeases: function () { //if (Debug) this.debug('foo'); if (Debug) console.time("each:SchedulerResources"); @@ -114,7 +116,7 @@ var schdlr_PartsInOneHour = 6; var totalCell = ""; for (var i = 0; i < totalColums; i++) totalCell +=""; var srt_body = ""; - + /* $.each(SchedulerResources, function (i, group) { console.log(group.groupName); //var groupTR = $("#ShedulerNodes tbody").html('
' + group.groupName + '
'); @@ -135,9 +137,10 @@ var schdlr_PartsInOneHour = 6; //srt_body.push(''); srt_body = srt_body.concat(totalCell.concat()); srt_body.push('/'); }); }); - + */ + srt_body += "" + totalCell + ""; //$("#scheduler-reservation-table tbody").html(srt_body.join("")); - $("#scheduler-reservation-table tbody").html(srt_body); + $("#scheduler-reservation-table tbody").append(srt_body); if (Debug) console.timeEnd("each:SchedulerResources"); @@ -185,6 +188,8 @@ var schdlr_PartsInOneHour = 6; //data is empty on load }, on_all_resources_new_record: function (data) { + $("#ShedulerNodes tbody").find("tr:last").after('' + data.urn + ''); + this.drawLeases(); //console.log(data); var tmpGroup = lookup(SchedulerResources, 'groupName', data.type); if (tmpGroup == null) { @@ -196,7 +201,7 @@ var schdlr_PartsInOneHour = 6; //alert('new_record'); }, on_all_resources_query_done: function (data) { - this.drawResources(); + //this.drawResources(); //data is empty on load /* GUI setup and event binding */ this._initUI(); diff --git a/portal/templates/onelab/onelab_slice-resource-view.html b/portal/templates/onelab/onelab_slice-resource-view.html index 8cb357b8..f92a1a39 100644 --- a/portal/templates/onelab/onelab_slice-resource-view.html +++ b/portal/templates/onelab/onelab_slice-resource-view.html @@ -10,6 +10,7 @@ {% block content %}
+ test
@@ -63,7 +64,7 @@ {{map_resources}}