<div class="tab-pane row" id="users" data-authority="{{user_details.parent_authority}}">
<div class="col-md-12">
<table class="table"><tr><td><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></td></tr></table>
+ {%if 'is_pi' in pi %}
<div>
<button id="deleteusers" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Users</button>
</div>
+ {%endif%}
</div>
</div>
<div class="tab-pane row" id="slices">
+ {%if 'is_pi' in pi %}
<button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> create slice</button>
+ {%else%}
+ <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> request slice</button>
+ {%endif%}
<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">
</tr>
</table>
<br>
+ {%if 'is_pi' in pi %}
<div>
<button id="renewslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
<button id="deleteslices" type="button" class="btn btn-default"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
</div>
+ {%endif%}
</div>
</div>
</div>
$.post("/rest/slice/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
var list_slices = [];
var table_slices = [];
- /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "user", "slice_urn", "slice_expires" */
+ /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
$.each( data, function( key, val ) {
list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
if(val.nodes=="undefined" || val.nodes==null){
}else{
nodes_length=val.nodes.length;
}
-
- if(val.user=="undefined" || val.user==null){
- user_length=0;
+ if(val.users=="undefined" || val.users==null){
+ users_length=0;
}else{
- user_length=val.user.length;
+ users_length=val.users.length;
}
if(val.slice_url=="undefined" || val.slice_url==null){
slice_row = "<tr id='"+val.slice_hrn+"'>";
slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
- slice_row += "<td>"+user_length+"</td>";
+ slice_row += "<td>"+users_length+"</td>";
slice_row += "<td>"+slice_url+"</td>";
slice_row += "<td>"+nodes_length+"</td>";
slice_row += "<td>"+val.slice_expires+"</td>";