});
+ $('button#deleteusers').click(function() {
+ $('input:checkbox.user').each(function (index) {
+ if(this.checked){
+ var record_id = this.id;
+ $.post("/delete/user/",{'filters':{'user_hrn':this.id}}, function(data) {
+ if(data.success){
+ $('tr[id="'+record_id+'"]').fadeOut("slow");
+ $('tr[id="'+record_id+'"]').remove();
+ mysliceAlert('Success: user deleted','success', true);
+ }else{
+ mysliceAlert('Rest Error for: '+data.error,'warning', true);
+ //alert("Rest Error for "+record_id+": "+data.error);
+ }
+ });
+ }
+ });
+ });
+
/* TODO: factorize into functions */
$('button#deleteslices').click(function() {
$('input:checkbox.slice').each(function (index) {
if(data.success){
$('tr[id="'+record_id+'"]').fadeOut("slow");
$('tr[id="'+record_id+'"]').remove();
+ mysliceAlert('Success: slice deleted','success', true);
}else{
- alert("Rest Error for "+record_id+": "+data.error);
+ mysliceAlert('Rest Error for: '+data.error,'warning', true);
+ //alert("Rest Error for "+record_id+": "+data.error);
}
});
-
}
});
});
if(data.success){
// TODO: highlight row after success
//$('tr[id="'+record_id+'"]').highlight();
+ mysliceAlert('Success: slice renewed','success', true);
}else{
- alert("Rest Error for "+record_id+": "+data.error);
+ mysliceAlert('Rest Error for: '+data.error,'warning', true);
+ //alert("Rest Error for "+record_id+": "+data.error);
}
});
<th>slice_hrn</th>
<th>users</th>
<th>url</th>
- <th>nodes</th>
+ <!-- <th>nodes</th> -->
<th>expiration</th>
</tr>
</table>
</div>
</div>
<script>
- $(document).ready(function() {
- {% if person %}
- {% if user_details.parent_authority %}
+$(document).ready(function() {
+ {% if person %}
+ {% if user_details.parent_authority %}
$.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
var authority_data = [];
slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
slice_row += "<td>"+users_length+"</td>";
slice_row += "<td>"+slice_url+"</td>";
- slice_row += "<td>"+nodes_length+"</td>";
+ //slice_row += "<td>"+nodes_length+"</td>";
slice_row += "<td>"+val.slice_expires+"</td>";
slice_row += "</tr>";
table_slices.push(slice_row);
user_row += "<td>"+val.user_enabled+"</td>";
user_row += "</tr>";
table_users.push(user_row);
-//
});
$("table#user-tab tr:last").after(table_users.join( "" ));
$("div#user-tab-loaded").css("display","block");
$("div#user-tab-loading").css("display","none");
});
- $('button#deleteusers').click(function() {
- $('input:checkbox.user').each(function (index) {
- if(this.checked){
- var record_id = this.id;
- $.post("/delete/user/",{'filters':{'user_hrn':this.id}}, function(data) {
- if(data.success){
- $('tr[id="'+record_id+'"]').fadeOut("slow");
- $('tr[id="'+record_id+'"]').remove();
- }else{
- alert("Rest Error for "+record_id+": "+data.error);
- }
- });
- }
- });
- });
-
-
{% endif %}
{% endif %}
-});
-
+}); // end document.ready
</script>
{% endblock %}
<th>slice_hrn</th>
<th>users</th>
<th>url</th>
- <th>nodes</th>
+ <!-- <th>nodes</th> -->
<th>expiration</th>
</tr>
</table>
</div>
</div>
<script>
- $(document).ready(function() {
- {% if person %}
- {% if user_details.parent_authority %}
+$(document).ready(function() {
+ {% if person %}
+ {% if user_details.parent_authority %}
$.post("/rest/authority/",{'filters':{'authority_hrn':'{{user_details.parent_authority}}'}}, function( data ) {
var authority_data = [];
slice_row += "<td><a href=\"/slice/"+val.slice_hrn+"\">" + val.slice_hrn + "</a></td>";
slice_row += "<td>"+users_length+"</td>";
slice_row += "<td>"+slice_url+"</td>";
- slice_row += "<td>"+nodes_length+"</td>";
+ //slice_row += "<td>"+nodes_length+"</td>";
slice_row += "<td>"+val.slice_expires+"</td>";
slice_row += "</tr>";
table_slices.push(slice_row);
});
- $.post("/rest/user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
- var list_users = [];
- var table_users = [];
- /* Available fields
- user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
- user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
- */
- $.each( data, function( key, val ) {
- list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
- user_row = "<tr id='"+val.user_hrn+"'>";
- user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
- user_row += "<td>"+val.user_email+"</td>";
- user_row += "<td>"+val.user_hrn+"</td>";
- user_row += "<td>"+val.user_first_name+"</td>";
- user_row += "<td>"+val.user_last_name+"</td>";
- user_row += "<td>"+val.user_enabled+"</td>";
- user_row += "</tr>";
- table_users.push(user_row);
-//
- });
- $("table#user-tab tr:last").after(table_users.join( "" ));
- $("div#user-tab-loaded").css("display","block");
- $("div#user-tab-loading").css("display","none");
- });
-
- $('button#deleteusers').click(function() {
- $('input:checkbox.user').each(function (index) {
- if(this.checked){
- var record_id = this.id;
- $.post("/delete/user/",{'filters':{'user_hrn':this.id}}, function(data) {
- if(data.success){
- $('tr[id="'+record_id+'"]').fadeOut("slow");
- $('tr[id="'+record_id+'"]').remove();
- }else{
- alert("Rest Error for "+record_id+": "+data.error);
- }
- });
- }
- });
- });
- {% endif %}
- {% endif %}
-});
+ $.post("/rest/user/",{'filters':{'parent_authority':'{{user_details.parent_authority}}'}}, function( data ) {
+ var list_users = [];
+ var table_users = [];
+ /* Available fields
+ user_gid, user_enabled, slices, pi_authorities, keys, parent_authority, user_first_name,
+ user_urn, user_last_name, user_phone, user_hrn, user_email, user_type
+ */
+ $.each( data, function( key, val ) {
+ list_users.push( "<li><a href=\"portal/user/"+val.user_email+"\">" + val.user_email + "</a></li>" );
+ user_row = "<tr id='"+val.user_hrn+"'>";
+ user_row += "<td><input type='checkbox' class='user' id='"+val.user_hrn+"'></td>";
+ user_row += "<td>"+val.user_email+"</td>";
+ user_row += "<td>"+val.user_hrn+"</td>";
+ user_row += "<td>"+val.user_first_name+"</td>";
+ user_row += "<td>"+val.user_last_name+"</td>";
+ user_row += "<td>"+val.user_enabled+"</td>";
+ user_row += "</tr>";
+ table_users.push(user_row);
+ });
+ $("table#user-tab tr:last").after(table_users.join( "" ));
+ $("div#user-tab-loaded").css("display","block");
+ $("div#user-tab-loading").css("display","none");
+ });
+ {% endif %}
+ {% endif %}
+}); // End document.ready
</script>
{% endblock %}