Merge branch 'master' of ssh://git.planet-lab.org/git/plstackapi
diff --git a/planetstack/templates/admin/dashboard/tenant.html b/planetstack/templates/admin/dashboard/tenant.html
index 83556fd..24db6c4 100644
--- a/planetstack/templates/admin/dashboard/tenant.html
+++ b/planetstack/templates/admin/dashboard/tenant.html
@@ -227,7 +227,7 @@
count : newTableData[newRow] - tableData[newRow],
slice : $("#advTenantSliceDropDown").val(),
actionToDo: "add",
- csrfmiddlewaretoken: "{{ csrf_token }}", // < here
+ csrfmiddlewaretoken: "{{ csrf_token }}", // < here
state:"inactive" },
type : 'POST',
complete:function(){
@@ -300,9 +300,42 @@
width: 350,
modal: true,
buttons: {
- "Submit": function () {
- /************Code to add or remove slivers for a slice will go here*******/
- },
+ "Add": function () {
+ delta = parseInt($("#numOfSlivers").val());
+ $(this).dialog("close");
+ $.ajax({
+ url : '/tenantaddorremsliver/',
+ dataType : 'json',
+ data: {
+ count : delta,
+ slice : $("#tenantSliceDropDown").val(),
+ actionToDo: "add",
+ csrfmiddlewaretoken: "{{ csrf_token }}", // < here
+ state:"inactive" },
+ type : 'POST',
+ complete:function(){
+ location.reload();
+ }
+ });
+ },
+ "Remove": function () {
+ delta = parseInt($("#numOfSlivers").val());
+ $(this).dialog("close");
+ $.ajax({
+ url : '/tenantaddorremsliver/',
+ dataType : 'json',
+ data: {
+ count : delta,
+ slice : $("#tenantSliceDropDown").val(),
+ actionToDo: "rem",
+ csrfmiddlewaretoken: "{{ csrf_token }}", // < here
+ state:"inactive" },
+ type : 'POST',
+ complete:function(){
+ location.reload();
+ }
+ });
+ },
Cancel: function () {
$(this).dialog("close");
}