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 2014/12/05 01:26:52 UTC
git commit: updated refs/heads/master to 7743947
Repository: cloudstack
Updated Branches:
refs/heads/master 8927975ca -> 774394792
CLOUDSTACK-8023: UI > VM wizard > service offering > trigger event handler of event "cloudStack.module.instanceWizard.serviceOffering.dataProvider" to get serviceOfferingObjs if module is enabled.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/77439479
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/77439479
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/77439479
Branch: refs/heads/master
Commit: 774394792e288e9be08b0e0f4f75016c7ad0f007
Parents: 8927975
Author: Jessica Wang <je...@apache.org>
Authored: Thu Dec 4 16:26:03 2014 -0800
Committer: Jessica Wang <je...@apache.org>
Committed: Thu Dec 4 16:26:41 2014 -0800
----------------------------------------------------------------------
ui/scripts/instanceWizard.js | 45 +++++++++++++++++++++++++--------------
1 file changed, 29 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/77439479/ui/scripts/instanceWizard.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index 2a02ad5..c5cb6ff 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -306,23 +306,36 @@
// if the user is leveraging a template, then we can show custom IOPS, if applicable
var canShowCustomIopsForServiceOffering = (args.currentData["select-template"] != "select-iso" ? true : false);
- $.ajax({
- url: createURL("listServiceOfferings&issystem=false"),
- dataType: "json",
- async: true,
- success: function(json) {
- serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
- args.response.success({
- canShowCustomIops: canShowCustomIopsForServiceOffering,
- customFlag: 'iscustomized',
- //customFlag: 'offerha', //for testing only
- customIopsFlag: 'iscustomizediops',
- data: {
- serviceOfferings: serviceOfferingObjs
- }
- });
+
+ // get serviceOfferingObjs
+ $(window).removeData("cloudStack.module.instanceWizard.serviceOfferingObjs");
+ $(window).trigger("cloudStack.module.instanceWizard.serviceOffering.dataProvider", {
+ context: args.context,
+ currentData: args.currentData
+ });
+ if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
+ $.ajax({
+ url: createURL("listServiceOfferings&issystem=false"),
+ dataType: "json",
+ async: false,
+ success: function(json) {
+ serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
+ }
+ });
+ } else {
+ serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
+ }
+
+
+ args.response.success({
+ canShowCustomIops: canShowCustomIopsForServiceOffering,
+ customFlag: 'iscustomized',
+ //customFlag: 'offerha', //for testing only
+ customIopsFlag: 'iscustomizediops',
+ data: {
+ serviceOfferings: serviceOfferingObjs
}
- });
+ });
},
// Step 4: Data disk offering