cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pran...@apache.org
Subject [17/25] git commit: updated refs/heads/master to 2f29185
Date Fri, 31 May 2013 04:36:07 GMT
explicit Dedication - Pod action filter for releasing dedicated pod (API Call)


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

Branch: refs/heads/master
Commit: cee82eca5581676539ff8e250159cb7ed06ff040
Parents: 1c9a34a
Author: Pranav Saxena <pranav.saxena@citrix.com>
Authored: Tue May 28 16:52:43 2013 +0530
Committer: Pranav Saxena <pranav.saxena@citrix.com>
Committed: Thu May 30 21:57:14 2013 +0530

----------------------------------------------------------------------
 ui/css/cloudstack3.css |    6 +++-
 ui/scripts/system.js   |   51 +++++++++++++++++++++++++++++++++++++++---
 2 files changed, 51 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cee82eca/ui/css/cloudstack3.css
----------------------------------------------------------------------
diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css
index da64787..df433d9 100644
--- a/ui/css/cloudstack3.css
+++ b/ui/css/cloudstack3.css
@@ -11725,11 +11725,13 @@ div.ui-dialog div.autoscaler div.field-group div.form-container
form div.form-it
   background-position: 0px -613px;
 }
 
-.restart .icon {
+.restart .icon,
+.release .icon {
   background-position: 0px -63px;
 }
 
-.restart:hover .icon {
+.restart:hover .icon,
+.release:hover .icon {
   background-position: 0px -645px;
 }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/cee82eca/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 933f271..7508e94 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -8805,6 +8805,43 @@
 
               },
 
+               release:{
+                label:'Release Dedicated Pod',
+                messages:{
+                   confirm: function(args) {
+                    return 'Do you want to release this dedicated pod ?';
+                  },
+                  notification: function(args) {
+                    return 'Pod dedication released';
+                  }
+                },
+               action:function(args){
+                  $.ajax({
+                     url:createURL("releaseDedicatedPod&podid=" + args.context.pods[0].id),
+                     dataType:"json",
+                     async:true,
+                     success:function(json){
+                       var jid = json.releasededicatedpodresponse.jobid;
+                       args.response.success({
+                             _custom:
+                           {      jobId: jid
+                             },
+                            notification: {
+                                 poll: pollAsyncJobResult
+                              },
+                            actionFilter:podActionfilter
+
+                       });
+                     },
+                    error:function(args){
+                      args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+                    }
+                  });
+
+               }
+              },
+
+
               disable: {
                 label: 'label.action.disable.pod',
                 messages: {
@@ -12763,20 +12800,26 @@
   var podActionfilter = function(args) {
     var podObj = args.context.item;
     var allowedActions = [];
-
+    var flag = 0;
      $.ajax({
        url:createURL("listDedicatedPods&podId=" + args.context.pods[0].id),
        success:function(json){
          if(json.listdedicatedpodsresponse.dedicatedpod != undefined){
          var dedicatedPodObj = json.listdedicatedpodsresponse.dedicatedpod[0];
            if(dedicatedPodObj.domainid != null)
-             allowedActions.push("release");
-          }
+              flag =1;
+           }
            else
-            allowedActions.push("dedicate");
+             flag =0;
        }
      });
 
+   // if(flag == 0)
+      allowedActions.push("dedicate");
+
+   // if(flag == 1)
+      allowedActions.push("release");
+
     allowedActions.push("edit");
     if(podObj.allocationstate == "Disabled")
       allowedActions.push("enable");


Mime
View raw message