+<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>
+<div class="col-md-10 col-md-offset-1">
+<div id="access">
+ <h2>How to access your reserved resources?</h2>
+ <img src="{{ STATIC_URL }}img/loading.gif" id="loading" alt="Loading reserved resources" />
+</div>
+<div id="warning_message" style="display:none; color:orange; font-weigh:bold;">
+Please add resources to your slice from the left tab <a href="/resources/{{slicename}}">"Resources"</a>
+</div>
+<div id="default">