js updated for accessing nitos nodes
authorLoic Baron <loic.baron@lip6.fr>
Fri, 26 Jun 2015 10:46:23 +0000 (12:46 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 26 Jun 2015 10:46:23 +0000 (12:46 +0200)
plugins/asap/static/js/asap.js
plugins/asap/templates/asap.html
plugins/querytable/static/js/querytable.js
portal/static/img/testbeds/FIT NITOS Paris.png [new file with mode: 0644]
portal/static/img/testbeds/FIT NITOS R2Lab.png [new file with mode: 0644]
portal/static/js/experiment.js
portal/static/js/join.js
portal/templates/join_view.html
portal/templates/slice-tab-experiment.html

index 861f0cf..107049b 100644 (file)
@@ -50,7 +50,7 @@ var AsapDateSelected = new Date();
         /* PLUGIN EVENTS */
         // on_show like in querytable
 
-        remove(id) {
+        remove: function(id) {
             return (elem=document.getElementById(id)).parentNode.removeChild(elem);
         },
         /* GUI EVENTS */
index 3da6041..f26847a 100644 (file)
@@ -1,6 +1,7 @@
 <div id={{ domid }}>
     <div class="col-md-12">
-        <h2>Reserve resources as soon as possible</h2>
+        <h2>Reserve resources as soon as possible <sup id="note">*</sup></h2>
+        <div class="copy">* This feature is only available for FIT IoT-Lab testbed at the moment</div>
     </div>
 
     <div class="col-md-12" style="height:30px">
index c1b1923..444fe60 100644 (file)
@@ -164,7 +164,7 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
             $('table.dataTable').delegate('a.resource-info','click',function() {
                 var aPos = sTable.fnGetPosition( this.parentNode );
                 var aData = sTable.fnGetData( aPos[0] );
-                //console.log(aData);
+                console.log(aData);
 
                 var index = {}
                 // XXX Loic @ Hardcoded !!! Maybe a loop over all fields would be better 
@@ -206,16 +206,17 @@ QUERYTABLE_BGCOLOR_REMOVED = 2;
                 } else {
                     var logo = resourceData['testbed'];
                     var resourceLocation = {
-                        'longitude' : aData[13],
-                        'latitude' : aData[23],
+                        'longitude' : aData[20],
+                        'latitude' : aData[17],
                     };
                     var coordinates = resourceLocation['latitude']+','+resourceLocation['longitude'];
+                    console.log(coordinates);
                 }
                 
                 var modal = $('#resource-info-modal');
                 modal.find('.modal-title').text(resourceData['testbed'] + ': ' +resourceData['hostname']);
                 table = modal.find('.modal-resource-info');
-                table.html('<tr><td colspan="2"><img class="img-responsive" src="/static/img/testbeds/'+logo+'.png" alt="'+resourceData['facility']+' - '+resourceData['testbed']+'" /></td></tr>');
+                table.html('<tr><td colspan="2"><center><img class="img-responsive" src="/static/img/testbeds/'+logo+'.png" alt="'+resourceData['facility']+' - '+resourceData['testbed']+'" /></center></td></tr>');
                 for (var j in resourceData) {
                     table.append('<tr><td>' + j + '</td><td>' + resourceData[j] + '</td></tr>');
                 }
diff --git a/portal/static/img/testbeds/FIT NITOS Paris.png b/portal/static/img/testbeds/FIT NITOS Paris.png
new file mode 100644 (file)
index 0000000..1030227
Binary files /dev/null and b/portal/static/img/testbeds/FIT NITOS Paris.png differ
diff --git a/portal/static/img/testbeds/FIT NITOS R2Lab.png b/portal/static/img/testbeds/FIT NITOS R2Lab.png
new file mode 100644 (file)
index 0000000..1030227
Binary files /dev/null and b/portal/static/img/testbeds/FIT NITOS R2Lab.png differ
index 3bddd23..2094cda 100644 (file)
@@ -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
index 44d8c75..87a7c28 100644 (file)
@@ -40,9 +40,9 @@ jQuery(document).ready(function(){
           pi_title: {
               required: true
           },
-          pi_phone: {
+          /*pi_phone: {
               required: true
-          },
+          },*/
           pi_email: {
               required: true
           },
index ff9dad4..d065766 100644 (file)
@@ -97,7 +97,7 @@
        <div class="form-group">
        <input type="tel" id="pi_phone" name="pi_phone" value="{{ pi_phone }}" 
                title="We may phone the manager as part of the validation process, and in case any issues arise with the use of the system."
-               style="width:200px" placeholder="Phone number"  maxlength="20" class="form-control" required>
+               style="width:200px" placeholder="Phone number"  maxlength="20" class="form-control">
     </div>
        <div class="form-group">
                <input type="password"  id="password" name="pi_password"   class="form-control" style="width:200px" minlength="8" value="{{ password }}" placeholder="Password" required/>
index 9673ad6..1af5661 100644 (file)
@@ -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 %}
 });
 </script>
-
 <div class="col-md-10 col-md-offset-1">
 <div id="access">
     <h2>How to access your reserved resources?</h2>
@@ -91,15 +89,12 @@ Please add resources to your slice from the left tab <a href="/resources/{{slice
     <script type="text/javascript">
     $(document).ready(function() {
         $.post("/initscript/get/",{'slice_hrn':'{{slicename}}'}, function( data ) {
-            console.log(data);
             jQuery('#initscript_code').val(data['initscript_code']);
         });
     });
     function deploy(slice_hrn){
-        console.log("deploy = "+slice_hrn);
         var initscript_code = jQuery('#initscript_code').val()
         $.post("/initscript/update/",{'slice_hrn':slice_hrn, 'initscript_code':initscript_code}, function( data ) {
-            console.log(data);
             if (data['ret'] == 0) {
                 mysliceAlert('Success: initscript deployed','success', true);
             }else{
@@ -109,9 +104,7 @@ Please add resources to your slice from the left tab <a href="/resources/{{slice
         });
     }
     function del(slice_hrn){
-        console.log("delete");
         $.post("/initscript/delete/",{'slice_hrn':slice_hrn}, function( data ) {
-            console.log(data);
             if (data['ret'] == 0) {
                 mysliceAlert('Success: initscript deleted','success', true);
                 jQuery('#initscript_code').val('');
@@ -175,8 +168,8 @@ Please add resources to your slice from the left tab <a href="/resources/{{slice
        </p>
 
        <p>
-       The complete tutorial on NITOS nodes:
-       <a target="_blank" href="http://nitlab.inf.uth.gr/NITlab/index.php/testbed/instructions/basic-tutorial">NITOS basic tutorial</a>
+       The complete tutorial on FIT NITOS nodes:
+       <a target="_blank" href="http://doc.onelab.eu/nitos.html">basic tutorial</a>
        </p>
     <p>OMF based experiments' tutorials are available <a href="http://nitlab.inf.uth.gr/NITlab/index.php/testbed/instructions/omf-tutorials-scenarios" target="_blank">here.</a></p> 
        <p>To learn more about OMF, please click <a href="http://omf.mytestbed.net/projects/omf/wiki/OMF_Main_Page" target="_blank">here.</a></p>