From: Loic Baron Date: Fri, 19 Jun 2015 13:45:47 +0000 (+0200) Subject: Tools tab Experiment: if empty warning msg X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=89029dbe3f25c910364f26852ace08a8979c8cbf;p=myslice.git Tools tab Experiment: if empty warning msg --- diff --git a/portal/static/js/experiment.js b/portal/static/js/experiment.js index 0bf94a61..37e98dda 100644 --- a/portal/static/js/experiment.js +++ b/portal/static/js/experiment.js @@ -1,5 +1,5 @@ function render_node(platform, node){ - console.log(platform,node); + //console.log(platform,node); nitos = false; if('@component_manager_id' in node){ // urn:publicid:IDN+ple+authority+cm @@ -23,7 +23,7 @@ function render_node(platform, node){ elm = document.getElementById(testbed); newElement = document.createElement('p'); if('services' in node && 'login' in node['services']){ - console.log(node['services']['login']); + //console.log(node['services']['login']); login = node['services']['login']; // TODO: Check if this login info has already been printed or not // Ex: IoT-Lab 1 ssh gateway per site, but info is per node in the RSpec diff --git a/portal/templates/slice-tab-experiment.html b/portal/templates/slice-tab-experiment.html index 9673ad61..1af56614 100644 --- a/portal/templates/slice-tab-experiment.html +++ b/portal/templates/slice-tab-experiment.html @@ -11,14 +11,11 @@ function is_finished(len_platforms, pf_status){ $(document).ready(function() { var platform_status = Array(); var platform_empty = Array(); - console.log('{{platforms}}'); {% for platform in platforms %} // /sfa/Describe?hrn=onelab.upmc.projectx.slicex&platform[]={{platform}}&type=slice $.post("/sfa/Describe",{'hrn':'{{slicename}}', 'type':'slice', 'platform':['{{platform}}']}, function( data ) { - console.log(data); if('parsed' in data['{{platform}}'] && 'rspec' in data['{{platform}}']['parsed']){ rspec = data['{{platform}}']['parsed']['rspec']; - console.log(rspec); if('node' in rspec){ if(rspec['node'] instanceof Array) { jQuery.each( rspec['node'], function( i, node ) { @@ -27,6 +24,8 @@ $(document).ready(function() { }else{ render_node('{{platform}}',rspec['node']); } + }else{ + platform_empty.push('{{platform}}'); } }else{ platform_empty.push('{{platform}}'); @@ -34,7 +33,7 @@ $(document).ready(function() { platform_status.push('{{platform}}'); if(is_finished({{len_platforms}},platform_status.length)){ $("#loading").hide(); - if(platform_empty.length > 0){ + if(platform_empty.length == {{len_platforms}}){ $("#warning_message").show(); } } @@ -42,7 +41,6 @@ $(document).ready(function() { {% endfor %} }); -