You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by je...@apache.org on 2013/07/03 00:00:09 UTC
git commit: updated refs/heads/master-6-17-stable to a35ae3c
Updated Branches:
refs/heads/master-6-17-stable 12e984f86 -> a35ae3ca6
CLOUDSTACK-3093: UI - Infrastructure menu - zone detail - physical network - network service providers - Internal LB VM - add migrate, view console action.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a35ae3ca
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a35ae3ca
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a35ae3ca
Branch: refs/heads/master-6-17-stable
Commit: a35ae3ca66e42324b84df9519389908ca4ce55c1
Parents: 12e984f
Author: Jessica Wang <je...@apache.org>
Authored: Tue Jul 2 14:57:27 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Tue Jul 2 14:59:54 2013 -0700
----------------------------------------------------------------------
ui/scripts/system.js | 94 ++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 93 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a35ae3ca/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 023d151..8d8a8af 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -3060,7 +3060,95 @@
notification: {
poll: pollAsyncJobResult
}
- }
+ },
+
+ migrate: {
+ label: 'Migrate LB VM',
+ createForm: {
+ title: 'Migrate LB VM',
+ fields: {
+ hostId: {
+ label: 'label.host',
+ validation: { required: true },
+ select: function(args) {
+ $.ajax({
+ url: createURL("listHosts&VirtualMachineId=" + args.context.internallbinstances[0].id),
+ dataType: "json",
+ async: true,
+ success: function(json) {
+ var hostObjs = json.listhostsresponse.host;
+ var items = [];
+ $(hostObjs).each(function() {
+ items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")});
+ });
+ args.response.success({data: items});
+ }
+ });
+ },
+ error: function(XMLHttpResponse) {
+ var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+ args.response.error(errorMsg);
+ }
+ }
+ }
+ },
+ messages: {
+ notification: function(args) {
+ return 'Migrate LB VM';
+ }
+ },
+ action: function(args) {
+ $.ajax({
+ url: createURL("migrateSystemVm&hostid=" + args.data.hostId + "&virtualmachineid=" + args.context.internallbinstances[0].id),
+ dataType: "json",
+ async: true,
+ success: function(json) {
+ var jid = json.migratesystemvmresponse.jobid;
+ args.response.success({
+ _custom: {
+ jobId: jid,
+ getUpdatedItem: function(json) {
+ //return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
+ $.ajax({
+ url: createURL("listInternalLoadBalancerVMs&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
+ dataType: "json",
+ async: false,
+ success: function(json) {
+ var items = json.listinternallbvmssresponse.internalloadbalancervm;
+ if(items != null && items.length > 0) {
+ return items[0];
+ }
+ }
+ });
+ },
+ getActionFilter: function() {
+ return internallbinstanceActionfilter;
+ }
+ }
+ });
+ }
+ });
+ },
+ notification: {
+ poll: pollAsyncJobResult
+ }
+ },
+
+ viewConsole: {
+ label: 'label.view.console',
+ action: {
+ externalLink: {
+ url: function(args) {
+ return clientConsoleUrl + '?cmd=access&vm=' + args.context.internallbinstances[0].id;
+ },
+ title: function(args) {
+ return args.context.internallbinstances[0].id.substr(0,8); //title in window.open() can't have space nor longer than 8 characters. Otherwise, IE browser will have error.
+ },
+ width: 820,
+ height: 640
+ }
+ }
+ }
},
tabs: {
details: {
@@ -13536,6 +13624,10 @@
if (jsonObj.state == 'Running') {
allowedActions.push("stop");
+
+ allowedActions.push("viewConsole");
+ if (isAdmin())
+ allowedActions.push("migrate");
}
else if (jsonObj.state == 'Stopped') {
allowedActions.push("start");