You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ap...@apache.org on 2013/07/25 13:56:47 UTC
[09/50] git commit: updated refs/heads/ldapplugin to 1f64354
CLOUDSTACK-3700: The dedication process should be listed as a step through zone wizard
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/06d89749
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/06d89749
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/06d89749
Branch: refs/heads/ldapplugin
Commit: 06d897498bd77997477a31187c8adc90302e89aa
Parents: cc99a83
Author: Isaac Chiang <is...@gmail.com>
Authored: Wed Jul 24 16:33:49 2013 +0800
Committer: Isaac Chiang <is...@gmail.com>
Committed: Wed Jul 24 16:33:49 2013 +0800
----------------------------------------------------------------------
.../classes/resources/messages.properties | 1 +
ui/dictionary.jsp | 1 +
ui/scripts/zoneWizard.js | 179 ++++++++++++++-----
3 files changed, 138 insertions(+), 43 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06d89749/client/WEB-INF/classes/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties
index 367459b..0aeb490 100644
--- a/client/WEB-INF/classes/resources/messages.properties
+++ b/client/WEB-INF/classes/resources/messages.properties
@@ -1343,6 +1343,7 @@ message.creating.primary.storage=Creating primary storage
message.creating.secondary.storage=Creating secondary storage
message.creating.zone=Creating zone
message.decline.invitation=Are you sure you want to decline this project invitation?
+message.dedicate.zone=Dedicating zone
message.delete.account=Please confirm that you want to delete this account.
message.delete.affinity.group=Please confirm that you would like to remove this affinity group.
message.delete.gateway=Please confirm you want to delete the gateway
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06d89749/ui/dictionary.jsp
----------------------------------------------------------------------
diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp
index 748cc7d..e3d8f77 100644
--- a/ui/dictionary.jsp
+++ b/ui/dictionary.jsp
@@ -1310,6 +1310,7 @@ dictionary = {
'message.creating.secondary.storage': '<fmt:message key="message.creating.secondary.storage" />',
'message.creating.zone': '<fmt:message key="message.creating.zone" />',
'message.decline.invitation': '<fmt:message key="message.decline.invitation" />',
+'message.dedicate.zone': '<fmt:message key="message.dedicate.zone" />',
'message.delete.account': '<fmt:message key="message.delete.account" />',
'message.delete.affinity.group': '<fmt:message key="message.delete.affinity.group" />',
'message.delete.gateway': '<fmt:message key="message.delete.gateway" />',
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/06d89749/ui/scripts/zoneWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js
index 759b123..0af57a1 100755
--- a/ui/scripts/zoneWizard.js
+++ b/ui/scripts/zoneWizard.js
@@ -2099,33 +2099,33 @@
})
});
- dedicatedZoneId = json.createzoneresponse.zone.id;
- //EXPLICIT ZONE DEDICATION
- if (args.data.pluginFrom == null && args.data.zone.ispublic != null) {
- var array2 = [];
- if (args.data.zone.domain != null)
- array2.push("&domainid=" + args.data.zone.domain);
- if (args.data.zone.accountId != "")
- array2.push("&account=" + todb(args.data.zone.accountId));
-
- if (dedicatedZoneId != null) {
- $.ajax({
- url: createURL("dedicateZone&ZoneId=" + dedicatedZoneId + array2.join("")),
- dataType: "json",
- success: function(json) {
- var dedicatedObj = json.dedicatezoneresponse.jobid;
- //args.response.success({ data: $.extend(item, dedicatedObj)});
-
- },
-
- error: function(json) {
-
- args.response.error(parseXMLHttpResponse(XMLHttpResponse));
- }
- });
-
- }
- }
+ // dedicatedZoneId = json.createzoneresponse.zone.id;
+ // //EXPLICIT ZONE DEDICATION
+ // if (args.data.pluginFrom == null && args.data.zone.ispublic != null) {
+ // var array2 = [];
+ // if (args.data.zone.domain != null)
+ // array2.push("&domainid=" + args.data.zone.domain);
+ // if (args.data.zone.accountId != "")
+ // array2.push("&account=" + todb(args.data.zone.accountId));
+
+ // if (dedicatedZoneId != null) {
+ // $.ajax({
+ // url: createURL("dedicateZone&ZoneId=" + dedicatedZoneId + array2.join("")),
+ // dataType: "json",
+ // success: function(json) {
+ // var dedicatedObj = json.dedicatezoneresponse.jobid;
+ // //args.response.success({ data: $.extend(item, dedicatedObj)});
+
+ // },
+
+ // error: function(json) {
+
+ // args.response.error(parseXMLHttpResponse(XMLHttpResponse));
+ // }
+ // });
+
+ // }
+ // }
},
error: function(XMLHttpResponse) {
@@ -4027,11 +4027,22 @@
},
addSecondaryStorage: function(args) {
+
+ var dedicatedZone = (args.data.pluginFrom == null && args.data.zone.ispublic != null);
+
if (args.data.secondaryStorage.provider == '') {
- complete({
- data: args.data
- });
- return; //skip addSecondaryStorage if provider dropdown is blank
+
+ if (dedicatedZone) {
+ stepFns.dedicateZone({
+ data: args.data
+ });
+ } else {
+ complete({
+ data: args.data
+ })
+ }
+
+ return; //skip addSecondaryStorage if provider dropdown is blank
}
@@ -4059,11 +4070,21 @@
url: createURL('addImageStore'),
data: data,
success: function(json) {
- complete({
- data: $.extend(args.data, {
- returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+
+ if (dedicatedZone) {
+ stepFns.dedicateZone({
+ data: $.extend(args.data, {
+ returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ })
})
- });
+ } else {
+ complete({
+ data: $.extend(args.data, {
+ returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ })
+ });
+ }
+
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@@ -4111,11 +4132,20 @@
url: createURL('addImageStore'),
data: data,
success: function(json) {
- complete({
- data: $.extend(args.data, {
- returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ if (dedicatedZone) {
+ stepFns.dedicateZone({
+ data: $.extend(args.data, {
+ returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ })
})
- });
+ } else {
+ complete({
+ data: $.extend(args.data, {
+ returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ })
+ });
+ }
+
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@@ -4179,11 +4209,19 @@
url: createURL('addImageStore'),
data: data,
success: function(json) {
- complete({
- data: $.extend(args.data, {
- returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ if (dedicatedZone) {
+ stepFns.dedicateZone({
+ data: $.extend(args.data, {
+ returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ })
})
- });
+ } else {
+ complete({
+ data: $.extend(args.data, {
+ returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
+ })
+ });
+ }
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@@ -4194,6 +4232,61 @@
}
});
}
+ },
+ dedicateZone: function(args) {
+
+ if(args.data.pluginFrom == null && args.data.zone.ispublic != null) {
+ var dedicatedZoneId = args.data.returnedZone.id;
+ message(dictionary['message.dedicate.zone']);
+
+ var array2 = [];
+ if (args.data.zone.domain != null)
+ array2.push("&domainid=" + args.data.zone.domain);
+ if (args.data.zone.accountId != "")
+ array2.push("&account=" + todb(args.data.zone.accountId));
+
+ if (dedicatedZoneId != null) {
+ $.ajax({
+ url: createURL("dedicateZone&ZoneId=" + dedicatedZoneId + array2.join("")),
+ dataType: "json",
+ success: function(json) {
+ var jobId = json.dedicatezoneresponse.jobid;
+ var dedicatedZoneIntervalId = setInterval(function() {
+ $.ajax({
+ url: createURL("queryAsyncJobResult&jobid=" + jobId),
+ dataType: "json",
+ success: function(json) {
+ if (json.queryasyncjobresultresponse.jobstatus == 0) { // not complete
+ return;
+ } else {
+ clearInterval(dedicatedZoneIntervalId);
+ if(json.queryasyncjobresultresponse.jobstatus == 1) { // successed
+ complete({
+ data: $.extend(args.data, {
+ returnedDedicateZone: json.queryasyncjobresultresponse.jobresult
+ })
+ });
+ } else if(json.queryasyncjobresultresponse.jobstatus == 2) { // failed
+ error('addZone', json.queryasyncjobresultresponse.jobresult.errortext, {
+ fn: 'dedicateZone',
+ args: args
+ })
+ }
+ }
+
+ }
+ });
+ }, g_queryAsyncJobResultInterval);
+ }
+ });
+
+ }
+ } else {
+ complete({
+ data: args.data
+ });
+ }
+
}
};