|
7440 | 7440 | validation: { required: true } |
7441 | 7441 | }, |
7442 | 7442 |
|
| 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 | + |
7443 | 7455 | //hypervisor==VMWare begins here |
7444 | 7456 | vCenterHost: { |
7445 | 7457 | label: 'label.vcenter.host', |
|
7497 | 7509 | array1.push("&podId=" + args.data.podId); |
7498 | 7510 |
|
7499 | 7511 | 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 | + |
7500 | 7519 | if(args.data.hypervisor == "VMware") { |
7501 | 7520 | array1.push("&username=" + todb(args.data.vCenterUsername)); |
7502 | 7521 | array1.push("&password=" + todb(args.data.vCenterPassword)); |
|
7572 | 7591 | }, |
7573 | 7592 |
|
7574 | 7593 | 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 | + |
7575 | 7626 | enable: { |
7576 | 7627 | label: 'label.action.enable.cluster', |
7577 | 7628 | messages: { |
|
7741 | 7792 | podname: { label: 'label.pod' }, |
7742 | 7793 | hypervisortype: { label: 'label.hypervisor' }, |
7743 | 7794 | clustertype: { label: 'label.cluster.type' }, |
| 7795 | + cpuovercommitratio:{ label: 'CPU overcommit Ratio', isEditable:true}, |
| 7796 | + memoryovercommitratio:{ label: 'Memory overcommit Ratio', isEditable:true}, |
7744 | 7797 | //allocationstate: { label: 'label.allocation.state' }, |
7745 | 7798 | //managedstate: { label: 'Managed State' }, |
7746 | 7799 | state: { label: 'label.state' } |
@@ -10413,10 +10466,14 @@ |
10413 | 10466 | if(jsonObj.state == "Enabled") {//managed, allocation enabled |
10414 | 10467 | allowedActions.push("unmanage"); |
10415 | 10468 | allowedActions.push("disable"); |
| 10469 | + allowedActions.push("edit"); |
| 10470 | + |
10416 | 10471 | } |
10417 | 10472 | else if(jsonObj.state == "Disabled") { //managed, allocation disabled |
10418 | 10473 | allowedActions.push("unmanage"); |
10419 | 10474 | allowedActions.push("enable"); |
| 10475 | + allowedActions.push("edit"); |
| 10476 | + |
10420 | 10477 | } |
10421 | 10478 | else { //Unmanaged, PrepareUnmanaged , PrepareUnmanagedError |
10422 | 10479 | allowedActions.push("manage"); |
|
0 commit comments