|
6278 | 6278 | } |
6279 | 6279 | }, |
6280 | 6280 |
|
| 6281 | + scaleUp:{ |
| 6282 | + label:'scaleUp Router VM', |
| 6283 | + createForm: { |
| 6284 | + title: 'label.change.service.offering', |
| 6285 | + desc: '', |
| 6286 | + fields: { |
| 6287 | + |
| 6288 | + serviceOfferingId: { |
| 6289 | + label: 'label.compute.offering', |
| 6290 | + select: function(args) { |
| 6291 | + $.ajax({ |
| 6292 | + url: createURL('listServiceOfferings'), |
| 6293 | + data: { |
| 6294 | + issystem: true, |
| 6295 | + systemvmtype: 'domainrouter' |
| 6296 | + }, |
| 6297 | + success: function(json) { |
| 6298 | + var serviceofferings = json.listserviceofferingsresponse.serviceoffering; |
| 6299 | + var items = []; |
| 6300 | + $(serviceofferings).each(function() { |
| 6301 | + // if(this.id != args.context.routers[0].serviceofferingid) { |
| 6302 | + items.push({id: this.id, description: this.name}); //default one (i.e. "System Offering For Software Router") doesn't have displaytext property. So, got to use name property instead. |
| 6303 | + |
| 6304 | + }); |
| 6305 | + args.response.success({data: items}); |
| 6306 | + } |
| 6307 | + }); |
| 6308 | + } |
| 6309 | + } |
| 6310 | + } |
| 6311 | + }, |
| 6312 | + |
| 6313 | + action: function(args) { |
| 6314 | + $.ajax({ |
| 6315 | + url: createURL("scaleVirtualMachine&id=" + args.context.routers[0].id + "&serviceofferingid=" + args.data.serviceOfferingId), |
| 6316 | + dataType: "json", |
| 6317 | + async: true, |
| 6318 | + success: function(json) { |
| 6319 | + var jid = json.scalevirtualmachineresponse.jobid; |
| 6320 | + args.response.success( |
| 6321 | + {_custom: |
| 6322 | + {jobId: jid, |
| 6323 | + getUpdatedItem: function(json) { |
| 6324 | + return json.queryasyncjobresultresponse.jobresult.virtualmachine; |
| 6325 | + }, |
| 6326 | + getActionFilter: function() { |
| 6327 | + return vmActionfilter; |
| 6328 | + } |
| 6329 | + } |
| 6330 | + } |
| 6331 | + ); |
| 6332 | + }, |
| 6333 | + error:function(json){ |
| 6334 | + args.response.error(parseXMLHttpResponse(json)); |
| 6335 | + } |
| 6336 | + |
| 6337 | + }); |
| 6338 | + }, |
| 6339 | + messages: { |
| 6340 | + confirm: function(args) { |
| 6341 | + return 'Do you really want to scale up the Router VM ?'; |
| 6342 | + }, |
| 6343 | + notification: function(args) { |
| 6344 | + |
| 6345 | + return 'Router VM Scaled Up'; |
| 6346 | + } |
| 6347 | + }, |
| 6348 | + notification: { |
| 6349 | + poll: pollAsyncJobResult |
| 6350 | + } |
| 6351 | + |
| 6352 | + }, |
| 6353 | + |
| 6354 | + |
6281 | 6355 | viewConsole: { |
6282 | 6356 | label: 'label.view.console', |
6283 | 6357 | action: { |
@@ -11816,17 +11890,18 @@ |
11816 | 11890 |
|
11817 | 11891 | if (jsonObj.state == 'Running') { |
11818 | 11892 | allowedActions.push("stop"); |
11819 | | - |
| 11893 | + allowedActions.push("scaleUp"); |
11820 | 11894 | // if(jsonObj.vpcid != null) |
11821 | | - allowedActions.push("restart"); |
| 11895 | + allowedActions.push("restart"); |
11822 | 11896 |
|
11823 | 11897 | allowedActions.push("viewConsole"); |
11824 | 11898 | if (isAdmin()) |
11825 | 11899 | allowedActions.push("migrate"); |
11826 | 11900 | } |
11827 | 11901 | else if (jsonObj.state == 'Stopped') { |
11828 | 11902 | allowedActions.push("start"); |
11829 | | - allowedActions.push("remove"); |
| 11903 | + allowedActions.push("scaleUp"); |
| 11904 | + allowedActions.push("remove"); |
11830 | 11905 |
|
11831 | 11906 | if(jsonObj.vpcid != null) |
11832 | 11907 | allowedActions.push("changeService"); |
|
0 commit comments