changes to the sliceview
authorCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Wed, 12 Mar 2014 18:04:23 +0000 (19:04 +0100)
committerCiro Scognamiglio <ciro.scognamiglio@cslash.net>
Wed, 12 Mar 2014 18:04:23 +0000 (19:04 +0100)
myslice/urls.py
portal/slicetabexperiment.py [moved from portal/experimentview.py with 100% similarity]
portal/slicetabtestbeds.py [moved from portal/testbedlist.py with 100% similarity]
portal/static/icons/authority-xs.png [new file with mode: 0644]
portal/static/icons/slices-xs.png [new file with mode: 0644]
portal/static/icons/support-xs.png [new file with mode: 0644]
portal/static/icons/testbed-xs.png [new file with mode: 0644]
portal/static/icons/user-xs.png [new file with mode: 0644]
portal/static/icons/users-xs.png [new file with mode: 0644]
portal/templates/slice-tab-info.html [new file with mode: 0644]
portal/templates/slice-tab-testbeds.html [moved from portal/templates/onelab/onelab_testbed-list.html with 100% similarity]

index 0a811d9..b1cb78e 100644 (file)
@@ -23,6 +23,11 @@ platforms_view=portal.platformsview.PlatformsView.as_view()
 import portal.testbedlist
 import portal.sliceview
 import portal.sliceresourceview
+
+import portal.slicetabexperiment
+import portal.slicetabinfo
+import portal.slicetabtestbeds
+
 from portal.sliceuserview import SliceUserView 
 
 #### high level choices
@@ -75,10 +80,15 @@ urls = [
     #
     #
     # Portal
-    (r'^testbeds/(?P<slicename>[^/]+)/?$', portal.testbedlist.TestbedList.as_view()),
+    
     (r'^resources/(?P<slicename>[^/]+)/?$', portal.sliceresourceview.SliceResourceView.as_view()),
-    (r'^users/(?P<slicename>[^/]+)/?$', SliceUserView.as_view()),
+    
     (r'^slice/(?P<slicename>[^/]+)/?$', portal.sliceview.SliceView.as_view()),
+    
+    (r'^info/(?P<slicename>[^/]+)/?$', portal.slicetabinfo.SliceInfoView.as_view()),
+    (r'^testbeds/(?P<slicename>[^/]+)/?$', portal.slicetabtestbeds.SliceTabTestbeds.as_view()),
+    (r'^users/(?P<slicename>[^/]+)/?$', SliceUserView.as_view()),
+    (r'^experiment/(?P<slicename>[^/]+)/?$', portal.slicetabexperiment.ExperimentView.as_view()),
     url(r'^portal/', include('portal.urls')),
 ]
 
diff --git a/portal/static/icons/authority-xs.png b/portal/static/icons/authority-xs.png
new file mode 100644 (file)
index 0000000..471bbd5
Binary files /dev/null and b/portal/static/icons/authority-xs.png differ
diff --git a/portal/static/icons/slices-xs.png b/portal/static/icons/slices-xs.png
new file mode 100644 (file)
index 0000000..6b64058
Binary files /dev/null and b/portal/static/icons/slices-xs.png differ
diff --git a/portal/static/icons/support-xs.png b/portal/static/icons/support-xs.png
new file mode 100644 (file)
index 0000000..409ffc6
Binary files /dev/null and b/portal/static/icons/support-xs.png differ
diff --git a/portal/static/icons/testbed-xs.png b/portal/static/icons/testbed-xs.png
new file mode 100644 (file)
index 0000000..b5242a7
Binary files /dev/null and b/portal/static/icons/testbed-xs.png differ
diff --git a/portal/static/icons/user-xs.png b/portal/static/icons/user-xs.png
new file mode 100644 (file)
index 0000000..942c5a8
Binary files /dev/null and b/portal/static/icons/user-xs.png differ
diff --git a/portal/static/icons/users-xs.png b/portal/static/icons/users-xs.png
new file mode 100644 (file)
index 0000000..563a23e
Binary files /dev/null and b/portal/static/icons/users-xs.png differ
diff --git a/portal/templates/slice-tab-info.html b/portal/templates/slice-tab-info.html
new file mode 100644 (file)
index 0000000..d3f90fe
--- /dev/null
@@ -0,0 +1,44 @@
+<div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
+<div id="slice-tab-loaded" style="display:none;">
+    <table id="slice-tab">
+    </table>
+</div>
+<script>
+    $(document).ready(function() {
+        $.post("/rest/slice/",{'filters':{'slice_hrn':'{{slice}}'}}, function( data ) {
+            var table_slices = [];
+            /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
+            $.each( data, function( key, val ) {
+                if(val.nodes=="undefined" || val.nodes==null){
+                    nodes_length=0;
+                }else{
+                    nodes_length=val.nodes.length;
+                }
+
+                if(val.user=="undefined" || val.user==null){
+                    user_length=0;
+                }else{
+                    user_length=val.user.length;
+                }
+
+                if(val.slice_url=="undefined" || val.slice_url==null){
+                    slice_url="";
+                }else{
+                    slice_url="<a href='"+val.slice_url+"' target='_blank'>"+val.slice_url+"</a>";
+                }
+                
+                slice_row = "<tr><td><b>Description:</b></td><td>"+val.slice_description+"</td></tr>";
+                slice_row += "<tr><td><b>url:</b></td><td><a href='"+val.slice_url+" target='_blank'>"+val.slice_url+"</a></td></tr>";
+                slice_row += "<tr><td><b>users:</b></td><td>"+user_length+"</td></tr>";
+                slice_row += "<tr><td><b>resources:</b></td><td>"+nodes_length+"</td></tr>";
+                slice_row += "<tr><td><b>created:</b></td><td>"+val.created+"</td></tr>";
+                slice_row += "<tr><td><b>last update:</b></td><td>"+val.last_updated+"</td></tr>";
+                slice_row += "<tr><td><b>expires:</b></td><td>"+val.slice_expires+"</td></tr>";
+                table_slices.push(slice_row);
+            });
+           $("table#slice-tab").html(table_slices.join( "" ));
+           $("div#slice-tab-loaded").css("display","block");
+           $("div#slice-tab-loading").css("display","none");
+        });
+    });
+</script>
\ No newline at end of file