From 701acfcea05da4e6c0be057ff8bde8a25f0b2f11 Mon Sep 17 00:00:00 2001 From: CongLu Date: Wed, 11 Feb 2015 16:56:22 -0800 Subject: [PATCH] mockData&review updated Change-Id: I5596ecae38b0c3f6e5c59f41f7bb283781530775 --- v2/src/app/appDev.js | 6 +++ v2/src/app/wizard/package_config.tpl.html | 3 +- v2/src/app/wizard/review.tpl.html | 50 ++++++++++++++++++++++- v2/src/app/wizard/wizard.js | 35 ++++++++++++---- 4 files changed, 84 insertions(+), 10 deletions(-) diff --git a/v2/src/app/appDev.js b/v2/src/app/appDev.js index 58b291e..0976b3b 100644 --- a/v2/src/app/appDev.js +++ b/v2/src/app/appDev.js @@ -664,6 +664,10 @@ compassAppDev.run(function($httpBackend, settings, $http) { "create_by": "user@someemail.com", "create_at": "2014-4-25 12:00:00", "updated_at": "2014-2-27 20:00:00", + "flavor":{ + "display_name": "Multi-node Cluster with HA", + "name": "HA-multinodes" + }, "links": [{ "href": "/clusters/2", "rel": "self" @@ -683,12 +687,14 @@ compassAppDev.run(function($httpBackend, settings, $http) { "id": parseInt(id), "name": "Cluster" + id, "adapter_id": 6, // 6: ceph_openstack_icehouse, 5: openstack_icehouse, 4: ceph(chef), 2: os_only + "adapter_name": "openstack_icehouse", "os_id": 1, "editable": true, "create_by": "user@someemail.com", "create_at": "2014-3-25 12:00:00", "updated_at": "2014-3-26 13:00:00", "flavor": { + "name": "HA-multinodes", "roles": [{ "display_name": "Compute", "name": "os-compute-worker" diff --git a/v2/src/app/wizard/package_config.tpl.html b/v2/src/app/wizard/package_config.tpl.html index 40a82d2..9c90bb6 100644 --- a/v2/src/app/wizard/package_config.tpl.html +++ b/v2/src/app/wizard/package_config.tpl.html @@ -257,7 +257,8 @@ *
- diff --git a/v2/src/app/wizard/review.tpl.html b/v2/src/app/wizard/review.tpl.html index 21a20bf..ce5d376 100644 --- a/v2/src/app/wizard/review.tpl.html +++ b/v2/src/app/wizard/review.tpl.html @@ -232,6 +232,7 @@

+
Target System Configurations - cephConfig @@ -251,6 +252,53 @@

+ + +
+
+ Target System Configurations - NeutronConfig +
+
+ + + + + + + + + + + + + + + + + + + +
tenent_network_type{{neutronConfig.openvswitch.tenant_network_type}}
tunnel_id_ranges_{{key}}{{value}}
network_vlan_ranges_{{key}}{{value}}
bridge_mappins_{{key}}{{value}}
+
+
+
+ +
+
+ Target System Configurations - High Availability Config +
+
+ + + + + + + +
VIP{{haConfig.ha_proxy.vip}}
+
+
+
Target System Configurations - console_credentials @@ -309,4 +357,4 @@
- \ No newline at end of file + diff --git a/v2/src/app/wizard/wizard.js b/v2/src/app/wizard/wizard.js index 24b89dc..3e8a4fc 100644 --- a/v2/src/app/wizard/wizard.js +++ b/v2/src/app/wizard/wizard.js @@ -11,6 +11,14 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne 'ngAnimate' ]); + function isEmpty(obj) { + for (var prop in obj) { + if (obj.hasOwnProperty(prop)) + return false; + } + return true; + } + wizardModule.config(function config($stateProvider) { $stateProvider .state('wizard', { @@ -72,6 +80,20 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne $scope.currentAdapterName = $scope.cluster.adapter_name; $scope.currentFlavor = $scope.cluster.flavor.name; + // angular.forEach($scope.adapters, function(adapter) { + // if (adapter.id == $scope.cluster.adapter_id) { + // // console.log("hi"); + // // console.log(adapter); + // // console.log($scope.cluster.adapter_name); + // $scope.currentAdapterName = adapter.name; + // // if(adapter.flavors!=null) + // $scope.currentFlavor = adapter.flavors.name; + // } + // }); + + // $scope.currentAdapterName = $scope.cluster.adapter_name; + // $scope.currentFlavor = $scope.cluster.flavor.name; + // get pre-config data for wizard and set wizard steps based on different adapters var oldConfig = clusterConfigData; @@ -1269,6 +1291,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne if (!$scope.neutron_config["openvswitch"]) { $scope.neutron_config["openvswitch"] = {}; + $scope.neutron_config["openvswitch"]["tenant_network_type"] = ["gre"]; $scope.neutron_config["openvswitch"]["tunnel_id_ranges"] = [""]; $scope.neutron_config["openvswitch"]["network_vlan_ranges"] = [""]; $scope.neutron_config["openvswitch"]["bridge_mappings"] = [""]; @@ -1290,9 +1313,6 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne "osd_devices": {} };*/ $scope.cephConfig = wizardFactory.getCephConfig(); - - - // $scope.$watch(function() { // return wizardFactory.getCommitState() // }, function(newCommitState, oldCommitState) { @@ -1303,12 +1323,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne // } // } // }); - - - $scope.form = {}; - - $scope.commit = function(sendRequest) { if (!sendRequest) { var commitState = { @@ -1336,6 +1351,7 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne } if ($scope.currentAdapterName == "openstack_icehouse" && $scope.currentFlavor == "HA-multinodes") { + // if ($scope.currentAdapterName == "openstack_icehouse"){ targetSysConfigData["package_config"]["ha_proxy"] = {}; targetSysConfigData["package_config"]["ha_proxy"]["vip"] = $scope.ha_config.ha_proxy.vip; @@ -1780,7 +1796,10 @@ define(['uiRouter', 'angularTable', 'angularDragDrop', 'angularTouch', 'ngSpinne $scope.service_credentials = wizardFactory.getServiceCredentials(); $scope.console_credentials = wizardFactory.getConsoleCredentials(); $scope.global_config = wizardFactory.getGeneralConfig(); + $scope.cephConfig = wizardFactory.getCephConfig(); + $scope.neutronConfig = wizardFactory.getNeutronConfig(); + $scope.haConfig = wizardFactory.getHighAvailabilityConfig(); dataService.getServerColumns().success(function(data) { $scope.server_columns = data.review;