cd $DIRNAME/..
# default port : if hostname starts with z -> use 8080 ; otherwise take 80
-hostname | grep -q '^z' && port=8080 || port=8080
-#hostname | grep -q '^z' && port=8080 || port=80
+#hostname | grep -q '^z' && port=8080 || port=8080
+hostname | grep -q '^z' && port=8080 || port=80
[[ -n "$@" ]] && port=$1
while true; do
errors = []
# Using cache manifold-tables to get the list of authorities faster
- authorities_query = Query.get('authority').select('name', 'authority_hrn')
+ authorities_query = Query.get('authority').select('authority_hrn')
#onelab_enabled_query = Query.get('local:platform').filter_by('platform', '==', 'ple').filter_by('disabled', '==', 'False')
#onelab_enabled = not not execute_admin_query(request, onelab_enabled_query)
{% block unfold_main %}
<div class="wrapper" id="institution">
<ul class="nav nav-tabs">
- <li class="active"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
- <li><a class="home-tab" data-panel="users" href="#">USERS</a></li>
- <li><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
+ <li class="active" id="authority-tab"><a class="home-tab" data-panel="institution" href="#">INSTITUTION</a></li>
+ <li id="users-tab"><a class="home-tab" data-panel="users" href="#">USERS</a></li>
+ <li id="slices-tab"><a class="home-tab" data-panel="slices" href="#">SLICES</a></li>
</ul>
<div class="home-panel" id="institution">
<h1><img src="{{ STATIC_URL }}img/icon_authority_color_small.png" alt="" /> Affiliation to an Institution</h1>
$('div.home-panel').hide();
$('div#'+$(this).data('panel')).show();
});
+ var url = window.location;
+ if(url.hash) {
+ // Fragment exists
+ tab = url.href.split("#")[1];
+ tab_exists = $('div#'+tab).length;
+ if (tab_exists) {
+ $('ul.nav-tabs li').removeClass('active');
+ $('li#'+tab+'-tab').addClass('active');
+ $('div.home-panel').hide();
+ $('div#'+tab).show();
+ }
+ }
$('button#createslice').click(function() {
window.location="/portal/slice_request/";
})
slice_row = "<tr>";
slice_row += "<td><input type='checkbox'></td>";
- slice_row += "<td><a href=\"/portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
+ slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
slice_row += "<td>"+user_length+"</td>";
slice_row += "<td>"+slice_url+"</td>";
slice_row += "<td>"+nodes_length+"</td>";
</tr>
<tr>
<td><a href="/portal/institution"><img src="{{ STATIC_URL }}img/icon_authority_color.png" alt="" /></a></td>
- <td><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></td>
+ <td><a href="/portal/institution#slices"><img src="{{ STATIC_URL }}img/icon_slices.png" alt="" /></a></td>
<td><a href="/portal/validate"><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></a></td>
</tr>
<tr>
<div class="col-md-10">
<br>
<br>
- <table>
- <tr>
- <td><b>Description:</b></td>
- <td>this slice is dedicated to debug the myslice software...</td>
- </tr>
- <tr>
- <td><b>url:</b></td>
- <td><a href="http://myslice.info" target="_blank">http://myslice.info</a></td>
- </tr>
- <tr>
- <td><b>users:</b></td>
- <td>3</td>
- </tr>
- <tr>
- <td><b>resources:</b></td>
- <td>8</td>
- </tr>
- <tr>
- <td><b>created:</b></td>
- <td>2012-06-21 10:00</td>
- </tr>
- <tr>
- <td><b>last update:</b></td>
- <td>2014-02-25 14:00</td>
- </tr>
- <tr>
- <td><b>expires:</b></td>
- <td>2014-04-01 12:00</td>
- </tr>
- </table>
+ <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>
</div>
</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>
{% endblock unfold_main %}
];
$( "#authority_hrn" ).autocomplete({
source: availableTags,
+ minLength: 0,
select: function( event, ui ) {console.log(jQuery(this))}
});
});