1 {% extends "layout_wide.html" %}
4 <script type="text/javascript" src="{{STATIC_URL}}/js/institution.js"></script>
8 <div class="container">
10 <div class="col-md-12">
11 <div class="breadcrumbs">
12 Management > Institution: <span id="authority_name"></span>
17 <div class="container">
19 <div class="col-md-12">
20 <ul class="nav nav-tabs nav-section">
21 <li class="active"><a href="#about">About</a></li>
22 <li><a href="#users">Users</a></li>
23 <li><a href="#slices">Slices</a></li>
24 <li><a href="#requests">Requests</a></li>
29 <div class="container tab-content">
30 <div class="tab-pane active row" id="about">
33 <div class="tab-pane row" id="users" data-authority="{{user_details.parent_authority}}">
34 <div class="col-md-12 el">
35 <div id="user-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
36 <div id="user-tab-loaded" style="display:none;">
37 <table id="user-tab" class="table">
53 <button id="deleteusers" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete selected users</button>
59 <div class="tab-pane row" id="slices">
60 <div class="col-md-12 el">
61 <div id="slice-tab-loading"><img src="{{ STATIC_URL }}img/loading.gif" alt="Loading Slices" /></div>
62 <div id="slice-tab-loaded" style="display:none;">
63 <table id="slice-tab" class="table">
69 <!-- <th>nodes</th> -->
74 {% if 'is_pi' in pi %}
76 {% if 'is_pi' in pi %}
77 <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create slice</button>
79 <button id="createslice" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request slice</button>
81 <button id="renewslices" type="button" class="btn btn-primary"><span class="glyphicon glyphicon-refresh"></span> Renew Slices</button>
82 <button id="deleteslices" type="button" class="btn btn-danger"><span class="glyphicon glyphicon-remove"></span> Delete Slices</button>
87 <div class="tab-pane row" id="requests">
91 $(document).ready(function() {
93 {% if user_details.parent_authority %}
95 $.post("/rest/slice/",{'fields':['slice_hrn','users','url','slice_date_created'],'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
97 var table_slices = [];
98 /* "slice_hrn", "slice_description", "slice_type", "parent_authority", "created", "nodes", "slice_url", "slice_last_updated", "users", "slice_urn", "slice_expires" */
99 $.each( data, function( key, val ) {
100 list_slices.push( "<li><a href=\"portal/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></li>" );
101 if(val.nodes=="undefined" || val.nodes==null){
104 nodes_length=val.nodes.length;
106 if(val.users=="undefined" || val.users==null){
109 users_length=val.users.length;
112 if(val.url=="undefined" || val.url==null){
115 slice_url="<a href='"+val.url+"' target='_blank'>"+val.url+"</a>";
118 slice_row = "<tr id='"+val.slice_hrn+"'>";
119 slice_row += "<td><input type='checkbox' class='slice' id='"+val.slice_hrn+"'></td>";
120 slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
121 slice_row += "<td>"+users_length+"</td>";
122 slice_row += "<td>"+slice_url+"</td>";
123 //slice_row += "<td>"+nodes_length+"</td>";
124 slice_row += "<td>"+val.slice_date_created+"</td>";
125 slice_row += "</tr>";
126 table_slices.push(slice_row);
130 /* $("div#slice-list").html($( "<ul/>", { html: list_slices.join( "" ) })); */
131 $("table#slice-tab tr:last").after(table_slices.join( "" ));
132 $("div#slice-tab-loaded").css("display","block");
133 $("div#slice-tab-loading").css("display","none");
137 $.post("/rest/user/",{'fields':['user_hrn','user_email'],'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
139 var table_users = [];
141 user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
142 user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
144 $.each( data, function( key, val ) {
145 list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
146 user_row = "<tr id='"+val.user_hrn+"'>";
147 user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
148 user_row += "<td>"+val.user_email+"</td>";
149 user_row += "<td>"+val.user_hrn+"</td>";
151 user_row += "<td>"+val.user_first_name+"</td>";
152 user_row += "<td>"+val.user_last_name+"</td>";
153 user_row += "<td>"+val.user_enabled+"</td>";
156 table_users.push(user_row);
158 $("table#user-tab tr:last").after(table_users.join( "" ));
159 $("div#user-tab-loaded").css("display","block");
160 $("div#user-tab-loading").css("display","none");
166 }); // End document.ready
168 $(document).ready(function() {
169 $('.nav-tabs a').click(function (e) {
172 var id = $(this).attr('href').substr(1);
173 if ((id == 'requests') || (id == 'about'))
174 $("#" + id).load('/management/' + id);
176 var hash = window.location.hash;
178 $('.nav-tabs a[href='+hash+']').click();
180 $('.nav-tabs a[href=#about]').click();