Merge branch 'onelab' of ssh://git.onelab.eu/git/myslice into onelab
authorjavier <javier.garcial.external@atos.net>
Tue, 17 Jun 2014 16:35:13 +0000 (18:35 +0200)
committerjavier <javier.garcial.external@atos.net>
Tue, 17 Jun 2014 16:35:13 +0000 (18:35 +0200)
README
plugins/testbeds/__init__.py
plugins/testbeds/static/js/testbeds.js
portal/sliceresourceview.py
portal/static/css/fed4fire.css
portal/templates/base.html
portal/templates/fed4fire/fed4fire_home-view.html

diff --git a/README b/README
index 5926c65..4e0b471 100644 (file)
--- a/README
+++ b/README
@@ -11,7 +11,9 @@ See the devel/ subdir for more devel-oriented doc.
 ** see devel/django-install.txt in case of trouble
 $ apt-get install python-django
 $ apt-get install python-django-south
-
+$ apt-get install python-pip
+$ pip install requests
+$ pip install djangorestframework
 * git clone git://git.onelab.eu/myslice.git
 -- or --
 * git clone ssh://yourlogin@git.onelab.eu/git/myslice.git
index 6b2b89d..a7dd15e 100644 (file)
@@ -7,9 +7,6 @@ class TestbedsPlugin(Plugin):
 
         # Until we have a proper way to access queries in Python
         self.query              = query
-        self.query_network      = query_network
-        self.query_network_uuid = query_network.query_uuid if query_network else None
-
         self.query_all          = query_all
         self.query_all_uuid     = query_all.query_uuid if query_all else None
 
@@ -31,7 +28,7 @@ class TestbedsPlugin(Plugin):
         # query_uuid will pass self.query results to the javascript
         # and will be available as "record" in :
         # on_new_record: function(record)
-        return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid', 'query_network_uuid']
+        return ['plugin_uuid', 'domid', 'query_uuid', 'query_all_uuid']
 
     def export_json_settings (self):
         return True
index b977127..5f990b9 100644 (file)
@@ -29,7 +29,7 @@
 
             /* Member variables */
             this.filters = Array();
-
+            this.testbeds = Array();
             /* Plugin events */
 
             /* Setup query and record handlers */
@@ -39,7 +39,6 @@
             // Some can be less efficient
             this.listen_query(options.query_uuid);
             this.listen_query(options.query_all_uuid, 'all');
-            this.listen_query(options.query_network_uuid, 'network');
 
             /* GUI setup and event binding */
             // call function
         // ... be sure to list all events here
 
         /* RECORD HANDLERS */
-        on_network_new_record: function(record)
+        on_all_new_record: function(record)
         {
-            row  = '<a href="#" class="list-group-item sl-platform" id="testbeds-filter_'+record["network_hrn"]+'" data-platform="'+record["network_hrn"]+'">';
-            row += '<span class="list-group-item-heading">'+record["platform"]+'</span>';
-            //row += '<span class="list-group-item-heading">'+record["network_hrn"]+'</span></a>';
-            row += '<p class="list-group-item-text">'+record["network_hrn"]+'</p></a>';
-            $('#testbeds-filter').append(row);
+            var self = this;
+            // If the resource has a network_hrn
+            if(record["network_hrn"]!="None" && record["network_hrn"]!="" && record["network_hrn"]!=null){
+                // If this network_hrn is not listed yet
+                if(jQuery.inArray(record["network_hrn"],self.testbeds)==-1){
+                    row  = '<a href="#" class="list-group-item sl-platform" id="testbeds-filter_'+record["network_hrn"]+'" data-platform="'+record["network_hrn"]+'">';
+                    //row += '<span class="list-group-item-heading">'+record["platform"]+'</span>';
+                    //row += '<span class="list-group-item-heading">'+record["network_hrn"]+'</span></a>';
+                    row += '<p class="list-group-item-heading">'+record["network_hrn"]+'</p></a>';
+                    $('#testbeds-filter').append(row);
+                    self.testbeds.push(record["network_hrn"]);
+                }
+            }
         },
 
-        /* When the network query is done, add the click event to the elements  */
-        on_network_query_done: function() {
+        /* When the query is done, add the click event to the elements  */
+        on_all_query_done: function() {
             var self = this;
             console.log('query network DONE');
             $("[id^='testbeds-filter_']").on('click',function(e) {
index 1ea6ead..5b8ce0f 100644 (file)
@@ -202,8 +202,8 @@ class SliceResourceView (LoginRequiredView, ThemeView):
         network_md = metadata.details_by_object('network')
         network_fields = [column['name'] for column in network_md['column']]
 
-        query_network = Query.get('network').select(network_fields)
-        page.enqueue_query(query_network)
+        #query_network = Query.get('network').select(network_fields)
+        #page.enqueue_query(query_network)
 
         filter_testbeds = TestbedsPlugin(
             page          = page,
@@ -211,7 +211,7 @@ class SliceResourceView (LoginRequiredView, ThemeView):
             title         = 'Filter by testbeds',
             query         = sq_resource,
             query_all     = query_resource_all,
-            query_network = query_network,
+            #query_network = query_network,
             init_key      = "network_hrn",
             checkboxes    = True,
             datatables_options = {
index ad8c332..5633f19 100644 (file)
@@ -495,4 +495,4 @@ div.portfolio-item img{
 div.portfolio-item p[id*='name-'] {
     font-weight: bold;
     cursor: pointer;
-}
\ No newline at end of file
+}
index decd041..af81a0e 100644 (file)
@@ -3,7 +3,7 @@
 <html lang="en"><head>
 <title>{{theme}} portal - {{ section }}</title>
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
-<link rel="shortcut icon" href="/static/img/favicon.ico">
+<link rel="shortcut icon" href="/static/img/favicon_fed4fire.ico">
 {# This is where insert_str will end up #}{% media_container prelude %}
 {% include 'messages-transient-header.html' %}
 <script type="text/javascript"> {# raw js code - use {% insert prelude_js %} ... {% endinsert %} #} {% container prelude_js %}</script>
index 8b94581..71f110e 100644 (file)
@@ -16,7 +16,7 @@
                                <a href="#"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a>
                        </div>
                        <div>
-                               <button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
+                               <button id="slicerequestbtn" type="button" style="width: 150px;" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
                        </div>
                        <div>   
                                <div id="home-slice-list"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
@@ -27,9 +27,9 @@
                         </div>
                        <div>
                                <ul><li>
-                                       <a class="button2" href='http://jfed.iminds.be/releases/r1306/webstart/experimenter/jfed-experimenter.jnlp'
+                                       <a class="button2" href='http://jfed.iminds.be/releases/r1389/webstart/experimenter/jfed-experimenter.jnlp'
                                        title="Click here to start your experiment with jFed" 
-                                       onclick="return  launchApplication('http://jfed.iminds.be/releases/r1306/webstart/experimenter/jfed-experimenter.jnlp');">jFed</a>
+                                       onclick="return  launchApplication('http://jfed.iminds.be/releases/r1389/webstart/experimenter/jfed-experimenter.jnlp');">jFed</a>
                                </li></ul>
                        </div>
                </div>
                                <a href="http://doc.fed4fire.eu/support.html"><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></a>
                        </div>
                        <div>
-                               <button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
+                               <button id="ticketbtn" type="button" style="width: 150px;" class="btn btn-default"><span class="glyphicon glyphicon-envelope"></span> Contact</button>
                        </div>
                        <p></p>
                        <div>
-                       <button id="statbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-stats"></span>Testbeds' status</button>
+                       <button id="statbtn" type="button" style="width: 150px;" class="btn btn-default"><span class="glyphicon glyphicon-stats"></span>Testbeds' status</button>
                        </div>
                </div>
                
@@ -66,7 +66,7 @@
                                <a href="/portal/account/"><img src="{{ STATIC_URL }}img/icon_user_color.png" alt="" /></a>
                        </div>
                        <div>
-                               <button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
+                               <button id="logoutbtn" type="button" style="width: 150px;" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
                        </div>
                        <div>
                                {% if person.last_name %}