You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2014/06/18 02:37:08 UTC

[2/2] git commit: AMBARI-6172. Show repo names on Review step.(xiwang)

AMBARI-6172. Show repo names on Review step.(xiwang)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/2724fc98
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2724fc98
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2724fc98

Branch: refs/heads/trunk
Commit: 2724fc98874483719fcc63cec56db2f783d659b9
Parents: f414d1c
Author: Xi Wang <xi...@apache.org>
Authored: Tue Jun 17 15:03:00 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Tue Jun 17 17:36:32 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step8_controller.js  | 28 ++++++++++----------
 ambari-web/app/templates/wizard/step8.hbs       |  2 +-
 2 files changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2724fc98/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index 40ae764..23685e6 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -563,16 +563,17 @@ App.WizardStep8Controller = Em.Controller.extend({
     //repo
     if (['addHostController', 'addServiceController'].contains(this.get('content.controllerName'))) {
       this.loadRepoInfo();
-    } else { // from install wizard
+    } else {
+     // from install wizard
       var selectedStack = this.get('content.stacks').findProperty('isSelected', true);
       var allRepos = [];
-      var supportedOs = ['redhat5', 'redhat6', 'sles11'];
       if (selectedStack && selectedStack.operatingSystems) {
         selectedStack.operatingSystems.forEach(function (os) {
-          if (os.selected && supportedOs.contains(os.osType)) {
+          if (os.selected) {
             allRepos.push(Em.Object.create({
               base_url: os.baseUrl,
-              os_type: Em.I18n.t("installer.step8.repoInfo.osType." + os.osType)
+              os_type: os.osType,
+              repo_id: os.repoId
             }));
           }
         }, this);
@@ -583,7 +584,7 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
 
   /**
-   * Get the repositories info of HDP from server. Used only in addHost controller.
+   * Load repo info for add Service/Host wizard review page
    * @return {$.ajax|null}
    * @method loadRepoInfo
    */
@@ -602,28 +603,27 @@ App.WizardStep8Controller = Em.Controller.extend({
   },
 
   /**
-   *
+   * Save all repo base URL of all OS type to <code>repoInfo<code>
    * @param {object} data
    * @method loadRepoInfoSuccessCallback
    */
   loadRepoInfoSuccessCallback: function (data) {
     var allRepos = [];
-    var supportedOs = ['redhat5', 'redhat6', 'sles11'];
-    data.items.forEach(function (item) {
-      var os = item.repositories[0].Repositories;
-      if (supportedOs.contains(os.os_type)) {
+    data.items.forEach(function (os) {
+      if (!App.supports.ubuntu && os.OperatingSystems.os_type == 'debian12') return; // @todo: remove after Ubuntu support confirmation
+      os.repositories.forEach(function (repository) {
         allRepos.push(Em.Object.create({
-          base_url: os.base_url,
-          os_type: Em.I18n.t("installer.step8.repoInfo.osType." + os.os_type)
+          base_url: repository.Repositories.base_url,
+          os_type: repository.Repositories.os_type,
+          repo_id: repository.Repositories.repo_id
         }));
-      }
+      });
     }, this);
     allRepos.set('display_name', Em.I18n.t("installer.step8.repoInfo.displayName"));
     this.get('clusterInfo').set('repoInfo', allRepos);
   },
 
   /**
-   *
    * @param {object} request
    * @method loadRepoInfoErrorCallback
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/2724fc98/ambari-web/app/templates/wizard/step8.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step8.hbs b/ambari-web/app/templates/wizard/step8.hbs
index ce5b9ba..2352736 100644
--- a/ambari-web/app/templates/wizard/step8.hbs
+++ b/ambari-web/app/templates/wizard/step8.hbs
@@ -45,7 +45,7 @@
       <ul>
         {{#each item in controller.clusterInfo.repoInfo}}
           <li>
-            <p><span class="text text-info">{{item.os_type}} : </span>{{item.base_url}}</p>
+            <p><span class="text text-info">{{item.os_type}} ({{item.repo_id}}): <br/></span>{{item.base_url}}</p>
           </li>
         {{/each}}
       </ul>