+<script type="text/javascript">
+function is_finished(len_platforms, pf_status){
+ if(len_platforms == pf_status){
+ return true;
+ }else{
+ return false;
+ }
+}
+
+// Specific DIVs for each type of testbed
+$(document).ready(function() {
+ var platform_status = Array();
+ var platform_empty = Array();
+ {% 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'];
+ if('node' in rspec){
+ if(rspec['node'] instanceof Array) {
+ jQuery.each( rspec['node'], function( i, node ) {
+ render_node('{{platform}}',node);
+ });
+ }else{
+ render_node('{{platform}}',rspec['node']);
+ }
+ }else{
+ platform_empty.push('{{platform}}');
+ }
+ }else{
+ platform_empty.push('{{platform}}');
+ }
+ platform_status.push('{{platform}}');
+ if(is_finished({{len_platforms}},platform_status.length)){
+ $("#loading").hide();
+ if(platform_empty.length == {{len_platforms}}){
+ $("#warning_message").show();
+ }
+ }
+ });
+ {% endfor %}
+});
+</script>