From: Ciro Scognamiglio Date: Tue, 4 Mar 2014 18:20:02 +0000 (+0100) Subject: update pending badge X-Git-Tag: myslice-1.1~234 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b9f2bf8e9dde750eb6348e02f72f78b2248e8e5c;hp=06bb8f5589ce25cbf4b3215367105ddf6cd3fa57;p=unfold.git update pending badge --- diff --git a/portal/static/img/testbeds/iotlab.png b/portal/static/img/testbeds/iotlab.png new file mode 100644 index 00000000..0c373e63 Binary files /dev/null and b/portal/static/img/testbeds/iotlab.png differ diff --git a/portal/static/img/testbeds/nitos.png b/portal/static/img/testbeds/nitos.png new file mode 100644 index 00000000..311fbbb8 Binary files /dev/null and b/portal/static/img/testbeds/nitos.png differ diff --git a/portal/static/img/testbeds/planetlab.png b/portal/static/img/testbeds/planetlab.png new file mode 100644 index 00000000..bb0a1971 Binary files /dev/null and b/portal/static/img/testbeds/planetlab.png differ diff --git a/portal/static/img/testbeds/plc.png b/portal/static/img/testbeds/plc.png new file mode 100644 index 00000000..e44bf474 Binary files /dev/null and b/portal/static/img/testbeds/plc.png differ diff --git a/portal/static/img/testbeds/ple.png b/portal/static/img/testbeds/ple.png new file mode 100644 index 00000000..64e1cbfb Binary files /dev/null and b/portal/static/img/testbeds/ple.png differ diff --git a/portal/static/img/testbeds/wilab.png b/portal/static/img/testbeds/wilab.png new file mode 100644 index 00000000..4ce8035c Binary files /dev/null and b/portal/static/img/testbeds/wilab.png differ diff --git a/portal/static/js/institution.js b/portal/static/js/institution.js index 17858fed..dc448702 100644 --- a/portal/static/js/institution.js +++ b/portal/static/js/institution.js @@ -51,6 +51,29 @@ $(document).ready(function() { } }); }); + $('button#renewslices').click(function() { + var now = new Date(); + /* In Javascript getMonth() gives month[0] = january, month[1] = february, and so on... */ + var month = now.getMonth()+2; + var one_month_later = now.getFullYear()+"-"+month+"-"+now.getDate()+" "+now.getHours()+":"+now.getMinutes()+":"+now.getSeconds(); + console.log(one_month_later); + $('input:checkbox.slice').each(function (index) { + if(this.checked){ + var record_id = this.id; + $.post("/update/slice/",{'filters':{'slice_hrn':this.id},'params':{'expires':one_month_later}}, function(data) { + if(data.success){ + // TODO: highlight row after success + //$('tr[id="'+record_id+'"]').highlight(); + }else{ + alert("Rest Error for "+record_id+": "+data.error); + } + }); + + } + }); + // TODO: refresh table + //window.location="/portal/institution#slices"; + }); $('button#createslice').click(function() { window.location="/portal/slice_request/"; diff --git a/portal/static/js/myslice-ui.js b/portal/static/js/myslice-ui.js index ef95e465..4aa83ced 100644 --- a/portal/static/js/myslice-ui.js +++ b/portal/static/js/myslice-ui.js @@ -8,20 +8,44 @@ $(document).ready(function() { /* Testbeds list */ - $("table#testbedList").load("/table/network/", { "fields" : ["network_hrn","description"], "options": ["checkbox"] }, function() { - $(this).dataTable( { - "sScrollY": window.innerHeight - 275, - "sDom": "frtiS", - "bScrollCollapse": true, - "bStateSave": true, - "bPaginate": false, - "bLengthChange": false, - "bFilter": false, - "bSort": true, - "bInfo": false, - "bAutoWidth": true, - "bAutoHeight": false - } ); + + $.post("/rest/network/", { "fields" : ["network_hrn", "network_longname", "description"]}, function(data) { + var testbed_data = []; + var testbed_row = ""; + testbed_row += ""; + testbed_row += ""; + testbed_row += ""; + testbed_row += "network_hrn"; + testbed_row += "Full name"; + testbed_row += "Description"; + testbed_row += ""; + testbed_row += ""; + testbed_data.push(testbed_row); + $.each( data, function(key, val) { + testbed_row = "" + testbed_row += ""; + testbed_row += ""; + testbed_row += ""+val.network_hrn+""; + testbed_row += ""+val.network_longname+""; + testbed_row += ""+val.description+""; + testbed_row += ""; + + testbed_data.push(testbed_row); + }); + $("table#testbedList").html(testbed_data.join('')); + $("div#testbed-list-loaded").css("display","block"); + $("div#testbed-list-loading").css("display","none"); + + $("input[type=checkbox]").click(function() { + var cnt = 0; + var id = $(this).val(); + var row = $(this).parent().parent() + if (row.hasClass("active")) { + row.removeClass("active"); + } else { + row.addClass("active"); + } + }); }); $("#objectList").load("/table/resource/", {"fields" : ["hostname","hrn","country","type"], "options": ["checkbox"] }, function(data) { diff --git a/portal/templates/onelab/onelab_testbed-list.html b/portal/templates/onelab/onelab_testbed-list.html index a0872bf6..e16b4e37 100644 --- a/portal/templates/onelab/onelab_testbed-list.html +++ b/portal/templates/onelab/onelab_testbed-list.html @@ -13,6 +13,9 @@
  • -
    +
    Loading Testbeds +
    -{% endblock %} \ No newline at end of file +{% endblock %}