Skip to content

Commit 55d67a0

Browse files
committed
Merge branch 'Commit-Ratio'
2 parents 23e54bb + ab24e84 commit 55d67a0

1 file changed

Lines changed: 57 additions & 0 deletions

File tree

ui/scripts/system.js

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7440,6 +7440,18 @@
74407440
validation: { required: true }
74417441
},
74427442

7443+
cpuovercommit:{
7444+
label: 'CPU overcommit ratio',
7445+
defaultValue:'1'
7446+
7447+
},
7448+
7449+
memoryovercommit:{
7450+
label: 'RAM overcommit ratio',
7451+
defaultValue:'1'
7452+
7453+
},
7454+
74437455
//hypervisor==VMWare begins here
74447456
vCenterHost: {
74457457
label: 'label.vcenter.host',
@@ -7497,6 +7509,13 @@
74977509
array1.push("&podId=" + args.data.podId);
74987510

74997511
var clusterName = args.data.name;
7512+
7513+
if(args.data.cpuovercommit != "")
7514+
array1.push("&cpuovercommitratio=" + todb(args.data.cpuovercommit));
7515+
7516+
if(args.data.memoryovercommit != "")
7517+
array1.push("&memoryovercommitratio=" + todb(args.data.memoryovercommit));
7518+
75007519
if(args.data.hypervisor == "VMware") {
75017520
array1.push("&username=" + todb(args.data.vCenterUsername));
75027521
array1.push("&password=" + todb(args.data.vCenterPassword));
@@ -7572,6 +7591,38 @@
75727591
},
75737592

75747593
actions: {
7594+
7595+
edit: {
7596+
label: 'label.edit',
7597+
action: function(args) {
7598+
var array1 = [];
7599+
7600+
if (args.data.cpuovercommitratio != "" && args.data.cpuovercommitratio > 0)
7601+
array1.push("&cpuovercommitratio=" + args.data.cpuovercommitratio);
7602+
7603+
if (args.data.memoryovercommitratio != "" && args.data.memoryovercommitratio > 0)
7604+
array1.push("&memoryovercommitratio=" + args.data.memoryovercommitratio);
7605+
7606+
$.ajax({
7607+
7608+
url: createURL("updateCluster&id=" + args.context.clusters[0].id + array1.join("")),
7609+
dataType: "json",
7610+
async: true,
7611+
success: function(json) {
7612+
var item = json.updateclusterresponse.cluster;
7613+
args.context.clusters[0].cpuovercommitratio = item.cpuovercommitratio;
7614+
args.context.clusters[0].memoryovercommitratio = item.memoryovercommitratio;
7615+
addExtraPropertiesToClusterObject(item);
7616+
args.response.success({
7617+
actionFilter: clusterActionfilter,
7618+
data:item
7619+
});
7620+
7621+
}
7622+
});
7623+
}
7624+
},
7625+
75757626
enable: {
75767627
label: 'label.action.enable.cluster',
75777628
messages: {
@@ -7741,6 +7792,8 @@
77417792
podname: { label: 'label.pod' },
77427793
hypervisortype: { label: 'label.hypervisor' },
77437794
clustertype: { label: 'label.cluster.type' },
7795+
cpuovercommitratio:{ label: 'CPU overcommit Ratio', isEditable:true},
7796+
memoryovercommitratio:{ label: 'Memory overcommit Ratio', isEditable:true},
77447797
//allocationstate: { label: 'label.allocation.state' },
77457798
//managedstate: { label: 'Managed State' },
77467799
state: { label: 'label.state' }
@@ -10413,10 +10466,14 @@
1041310466
if(jsonObj.state == "Enabled") {//managed, allocation enabled
1041410467
allowedActions.push("unmanage");
1041510468
allowedActions.push("disable");
10469+
allowedActions.push("edit");
10470+
1041610471
}
1041710472
else if(jsonObj.state == "Disabled") { //managed, allocation disabled
1041810473
allowedActions.push("unmanage");
1041910474
allowedActions.push("enable");
10475+
allowedActions.push("edit");
10476+
1042010477
}
1042110478
else { //Unmanaged, PrepareUnmanaged , PrepareUnmanagedError
1042210479
allowedActions.push("manage");

0 commit comments

Comments
 (0)