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/10/24 23:28:00 UTC
git commit: updated refs/heads/4.2 to 12fbaf9
Updated Branches:
refs/heads/4.2 99cf9943d -> 12fbaf9b4
CLOUDSTACK-4649: UI > Edit Instance, Edit Template > fix a bug that XenServer Tools Version 6.1+ field didn't get updated correctly.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/12fbaf9b
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/12fbaf9b
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/12fbaf9b
Branch: refs/heads/4.2
Commit: 12fbaf9b49aca2838357bbc88bddc12bea5affb2
Parents: 99cf994
Author: Jessica Wang <je...@apache.org>
Authored: Thu Oct 24 14:25:21 2013 -0700
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Oct 24 14:27:51 2013 -0700
----------------------------------------------------------------------
ui/scripts/instances.js | 34 +++++++++++++++++++++++++++++++---
ui/scripts/templates.js | 32 ++++++++++++++++++++++++++++++--
2 files changed, 61 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12fbaf9b/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index d8b997a..436e1aa 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -820,12 +820,40 @@
url: createURL('addResourceDetail'),
data: {
resourceType: 'uservm',
- resourceId: 3,
+ resourceId: args.context.instances[0].id,
'details[0].key': 'hypervisortoolsversion',
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
},
- success: function(json) {
- //do nothing
+ success: function(json) {
+ var jobId = json.addResourceDetailresponse.jobid;
+ var addResourceDetailIntervalID = setInterval(function() {
+ $.ajax({
+ url: createURL("queryAsyncJobResult&jobid=" + jobId),
+ dataType: "json",
+ success: function(json) {
+ var result = json.queryasyncjobresultresponse;
+
+ if (result.jobstatus == 0) {
+ return; //Job has not completed
+ } else {
+ clearInterval(addResourceDetailIntervalID);
+
+ if (result.jobstatus == 1) {
+ //do nothing
+ } else if (result.jobstatus == 2) {
+ cloudStack.dialog.notice({
+ message: "Failed to update XenServer Tools Version 6.1+ field. Error: " + _s(result.jobresult.errortext)
+ });
+ }
+ }
+ },
+ error: function(XMLHttpResponse) {
+ cloudStack.dialog.notice({
+ message: "Failed to update XenServer Tools Version 6.1+ field. Error: " + parseXMLHttpResponse(XMLHttpResponse)
+ });
+ }
+ });
+ }, g_queryAsyncJobResultInterval);
}
});
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/12fbaf9b/ui/scripts/templates.js
----------------------------------------------------------------------
diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js
index 891d0b1..e6a5fcc 100644
--- a/ui/scripts/templates.js
+++ b/ui/scripts/templates.js
@@ -665,12 +665,40 @@
url: createURL('addResourceDetail'),
data: {
resourceType: 'template',
- resourceId: 1,
+ resourceId: args.context.templates[0].id,
'details[0].key': 'hypervisortoolsversion',
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
},
success: function(json) {
- //do nothing
+ var jobId = json.addResourceDetailresponse.jobid;
+ var addResourceDetailIntervalID = setInterval(function() {
+ $.ajax({
+ url: createURL("queryAsyncJobResult&jobid=" + jobId),
+ dataType: "json",
+ success: function(json) {
+ var result = json.queryasyncjobresultresponse;
+
+ if (result.jobstatus == 0) {
+ return; //Job has not completed
+ } else {
+ clearInterval(addResourceDetailIntervalID);
+
+ if (result.jobstatus == 1) {
+ //do nothing
+ } else if (result.jobstatus == 2) {
+ cloudStack.dialog.notice({
+ message: "Failed to update XenServer Tools Version 6.1+ field. Error: " + _s(result.jobresult.errortext)
+ });
+ }
+ }
+ },
+ error: function(XMLHttpResponse) {
+ cloudStack.dialog.notice({
+ message: "Failed to update XenServer Tools Version 6.1+ field. Error: " + parseXMLHttpResponse(XMLHttpResponse)
+ });
+ }
+ });
+ }, g_queryAsyncJobResultInterval);
}
});
}