Skip to content

Commit cee82ec

Browse files
committed
explicit Dedication - Pod action filter for releasing dedicated pod (API Call)
1 parent 1c9a34a commit cee82ec

2 files changed

Lines changed: 51 additions & 6 deletions

File tree

‎ui/css/cloudstack3.css‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11725,11 +11725,13 @@ div.ui-dialog div.autoscaler div.field-group div.form-container form div.form-it
1172511725
background-position: 0px -613px;
1172611726
}
1172711727

11728-
.restart .icon {
11728+
.restart .icon,
11729+
.release .icon {
1172911730
background-position: 0px -63px;
1173011731
}
1173111732

11732-
.restart:hover .icon {
11733+
.restart:hover .icon,
11734+
.release:hover .icon {
1173311735
background-position: 0px -645px;
1173411736
}
1173511737

‎ui/scripts/system.js‎

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8805,6 +8805,43 @@
88058805

88068806
},
88078807

8808+
release:{
8809+
label:'Release Dedicated Pod',
8810+
messages:{
8811+
confirm: function(args) {
8812+
return 'Do you want to release this dedicated pod ?';
8813+
},
8814+
notification: function(args) {
8815+
return 'Pod dedication released';
8816+
}
8817+
},
8818+
action:function(args){
8819+
$.ajax({
8820+
url:createURL("releaseDedicatedPod&podid=" + args.context.pods[0].id),
8821+
dataType:"json",
8822+
async:true,
8823+
success:function(json){
8824+
var jid = json.releasededicatedpodresponse.jobid;
8825+
args.response.success({
8826+
_custom:
8827+
{ jobId: jid
8828+
},
8829+
notification: {
8830+
poll: pollAsyncJobResult
8831+
},
8832+
actionFilter:podActionfilter
8833+
8834+
});
8835+
},
8836+
error:function(args){
8837+
args.response.error(parseXMLHttpResponse(XMLHttpResponse));
8838+
}
8839+
});
8840+
8841+
}
8842+
},
8843+
8844+
88088845
disable: {
88098846
label: 'label.action.disable.pod',
88108847
messages: {
@@ -12763,20 +12800,26 @@
1276312800
var podActionfilter = function(args) {
1276412801
var podObj = args.context.item;
1276512802
var allowedActions = [];
12766-
12803+
var flag = 0;
1276712804
$.ajax({
1276812805
url:createURL("listDedicatedPods&podId=" + args.context.pods[0].id),
1276912806
success:function(json){
1277012807
if(json.listdedicatedpodsresponse.dedicatedpod != undefined){
1277112808
var dedicatedPodObj = json.listdedicatedpodsresponse.dedicatedpod[0];
1277212809
if(dedicatedPodObj.domainid != null)
12773-
allowedActions.push("release");
12774-
}
12810+
flag =1;
12811+
}
1277512812
else
12776-
allowedActions.push("dedicate");
12813+
flag =0;
1277712814
}
1277812815
});
1277912816

12817+
// if(flag == 0)
12818+
allowedActions.push("dedicate");
12819+
12820+
// if(flag == 1)
12821+
allowedActions.push("release");
12822+
1278012823
allowedActions.push("edit");
1278112824
if(podObj.allocationstate == "Disabled")
1278212825
allowedActions.push("enable");

0 commit comments

Comments
 (0)