Pod dedication action button functionality

Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/97cb514f
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/97cb514f
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/97cb514f

Branch: refs/heads/master
Commit: 97cb514f052ea8abf75e1073cb84238fa0e164be
Parents: aab0bb4
Author: Pranav Saxena <pranav.sax...@citrix.com>
Authored: Wed May 15 01:19:21 2013 +0530
Committer: Pranav Saxena <pranav.sax...@citrix.com>
Committed: Thu May 30 21:57:10 2013 +0530

----------------------------------------------------------------------
 ui/scripts/system.js |   66 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 66 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/97cb514f/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 1b1f61d..b0bc9a1 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8714,6 +8714,71 @@
                 }
               },
 
+                dedicate:{
+                   label: 'Dedicate Pod',
+                messages: {
+                  confirm: function(args) {
+                    return 'Do you really want to dedicate this pod to a 
domain/account? ';
+                  },
+                  notification: function(args) {
+                    return 'Pod Dedicated';
+                  }
+                },
+                createForm:{
+                   title:'Dedicate Pod',
+                   fields:{
+                         domainId:{
+                      label:'Domain',
+                      validation:{required:true},
+                      select:function(args){
+                         $.ajax({
+                              url:createURL("listDomains&listAll=true"),
+                              dataType:"json",
+                              async:false,
+                               success: function(json) {
+                                  var domainObjs= 
json.listdomainsresponse.domain;
+                                  var items=[];
+
+                                  $(domainObjs).each(function() {
+                                  items.push({id:this.id 
,description:this.name });
+                                  });
+
+                                  args.response.success({
+                                  data: items
+                                });
+                               }
+
+
+                        });
+                       }
+                   },
+
+                   accountId:{
+                     label:'Account',
+                    // docID:'helpAccountForDedication',
+                     validation:{required:false}
+
+                  }
+
+
+                     }
+                },
+                action: function(args) {
+                    $.ajax({
+                    url: createURL("dedicatePod&podId=" + 
args.context.pods[0].id),
+                    dataType: "json",
+                    success: function(json) {
+                      var item = json.dedicatepodresponse.pod;
+                      args.response.success({
+                        actionFilter: podActionfilter,
+                        data:item
+                      });
+                    }
+                  });
+                }
+
+              },
+
               disable: {
                 label: 'label.action.disable.pod',
                 messages: {
@@ -12557,6 +12622,7 @@
     var podObj = args.context.item;
     var allowedActions = [];
     allowedActions.push("edit");
+     allowedActions.push("dedicate");
     if(podObj.allocationstate == "Disabled")
       allowedActions.push("enable");
     else if(podObj.allocationstate == "Enabled")

Reply via email to