ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: Revert "AMBARI-3746. Some clean up for previous commits. (xiwang)"
Date Mon, 11 Nov 2013 23:53:45 GMT
Updated Branches:
  refs/heads/trunk 38f6f48d0 -> 4b84ed171


Revert "AMBARI-3746. Some clean up for previous commits. (xiwang)"

This reverts commit 5fe89e76bac17cf6d53fa51d2ea106cfa9fbb54b.


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

Branch: refs/heads/trunk
Commit: 4b84ed171da60533032099fc94f4aa013a82465d
Parents: 38f6f48
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Mon Nov 11 15:53:39 2013 -0800
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Mon Nov 11 15:53:39 2013 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/application.js       | 75 ++++++++++----------
 .../app/controllers/wizard/step3_controller.js  |  2 +-
 ambari-web/app/messages.js                      |  3 +-
 ambari-web/app/templates/common/modal_popup.hbs |  2 +-
 ambari-web/app/utils/ajax.js                    | 23 +-----
 5 files changed, 41 insertions(+), 64 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4b84ed17/ambari-web/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/application.js b/ambari-web/app/controllers/application.js
index ac7295f..1b41900 100644
--- a/ambari-web/app/controllers/application.js
+++ b/ambari-web/app/controllers/application.js
@@ -58,59 +58,58 @@ App.ApplicationController = Em.Controller.extend({
   },
   persistKey: function () {
     var loginName = App.router.get('loginName');
-    return 'app-settings-show-bg-' + loginName;
+    return 'admin-settings-show-bg-' + loginName;
   },
   currentPrefObject: null,
-
   /**
    * get persist value from server with persistKey
    */
-  getUserPref: function(key){
-    App.ajax.send({
-      name: 'settings.get.user_pref',
-      sender: this,
-      data: {
-        key: key
-      },
-      success: 'getUserPrefSuccessCallback',
-      error: 'getUserPrefErrorCallback'
-    });
-  },
-  getUserPrefSuccessCallback: function (response, request, data) {
-    if (response != null) {
-      console.log('Got persist value from server with key ' + data.key + '. Value is: ' +
response);
-      this.set('currentPrefObject', response);
-      return response;
-    }
-  },
-  getUserPrefErrorCallback: function (request, ajaxOptions, error) {
-    // this user is first time login
-    if (request.status == 404) {
-      console.log('Persist did NOT find the key');
-      this.set('currentPrefObject', null);
-      return null;
-    }
+  getUserPref: function (key) {
+    var self = this;
+    var url = App.apiPrefix + '/persist/' + key;
+    jQuery.ajax(
+      {
+        url: url,
+        context: this,
+        async: false,
+        success: function (response) {
+          if (response) {
+            var value = jQuery.parseJSON(response);
+            console.log('Got persist value from server with key: ' + key + '. Value is: '
+ response);
+            self.set('currentPrefObject', value);
+            return value;
+          }
+        },
+        error: function (xhr) {
+          // this user is first time login
+          if (xhr.status == 404) {
+            console.log('Persist did NOT find the key: '+ key);
+            self.set('currentPrefObject', null);
+            return null;
+          }
+        },
+        statusCode: require('data/statusCodes')
+      }
+    );
   },
-
   /**
    * post persist key/value to server, value is object
    */
   postUserPref: function (key, value) {
+    var url = App.apiPrefix + '/persist/';
     var keyValuePair = {};
     keyValuePair[key] = JSON.stringify(value);
-    App.ajax.send({
-      'name': 'settings.post.user_pref',
-      'sender': this,
-      'beforeSend': 'postUserPrefBeforeSend',
-      'data': {
-        'keyValuePair': keyValuePair
+    jQuery.ajax({
+      async: false,
+      context: this,
+      type: "POST",
+      url: url,
+      data: JSON.stringify(keyValuePair),
+      beforeSend: function () {
+        console.log('BeforeSend to persist: persistKeyValues', keyValuePair);
       }
     });
   },
-  postUserPrefBeforeSend: function(request, ajaxOptions, data){
-    console.log('BeforeSend to persist: persistKeyValues', data.keyValuePair);
-  },
-
   showSettingsPopup: function() {
     var self = this;
     var initValue = this.loadShowBgChecked();

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4b84ed17/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js
index bb2b556..1078d06 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -562,7 +562,7 @@ App.WizardStep3Controller = Em.Controller.extend({
     });
     if (hostsContext.length > 0) { // warning exist
       var repoWarning = {
-        name:  Em.I18n.t('installer.step3.hostWarningsPopup.repositories.name'),
+        name: 'Repository for OS not available',
         hosts: hostsContext,
         category: 'repositories',
         onSingleHost: false

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4b84ed17/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index f4ac81c..019be0a 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -348,7 +348,7 @@ Em.I18n.translations = {
   'installer.step3.hosts.remove.popup.body':'Are you sure you want to remove the selected
host(s)?',
   'installer.step3.hostInformation.popup.header':'Error in retrieving host Information',
   'installer.step3.hostInformation.popup.body' : 'All bootstrapped hosts registered but unable
to retrieve cpu and memory related information',
-  'installer.step3.hostOsTypeCheck.popup.body' : 'Host registered successfully, but the host
operating system type NOT match the selected group in "Select Stack" step: Advanced Repository
Option. You can go back to "Select Stack" step OR remove this host.' +
+  'installer.step3.hostOsTypeCheck.popup.body' : 'Host registered successfully, but the host
operating system type NOT match the selected group in step 1:Advanced Repository Option.<br>
You can go back to step 1 OR remove this host. <br>' +
     'The host type is {0}, but you selected group {1} in step 1.',
   'installer.step3.hostWarningsPopup.report':'Show Report',
   'installer.step3.hostWarningsPopup.report.header': '<p style="font-family: monospace">######################################<br>#
Host Checks Report<br>#<br># Generated: ',
@@ -366,7 +366,6 @@ Em.I18n.translations = {
     '<div class="alert alert-warn"><b>Note</b>: To clean up in interactive
mode, remove <b>--silent</b> option. To clean up all resources, including <i>users</i>,
remove <b>--skip=users</b> option. Use <b>--help</b> for a list of
available options.</div>',
   'installer.step3.hostWarningsPopup.summary':'{0} on {1}',
   'installer.step3.hostWarningsPopup.firewall':'Firewall Issues',
-  'installer.step3.hostWarningsPopup.repositories.name':'Repository for OS not available',
   'installer.step3.hostWarningsPopup.repositories':'Repositories Issues',
   'installer.step3.hostWarningsPopup.repositories.context':'Host ({0}) has a {1} OS type,
But the repositories chosen in "Select Stack" step was {2}.',
   'installer.step3.hostWarningsPopup.repositories.message':'The following registered hosts
have different Operating System types from the local repositories chosen in "Select Stack"
step. You can go back to "Select Stack" step to select another os group OR remove related
host.',

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4b84ed17/ambari-web/app/templates/common/modal_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/modal_popup.hbs b/ambari-web/app/templates/common/modal_popup.hbs
index 1d7a0f8..a846231 100644
--- a/ambari-web/app/templates/common/modal_popup.hbs
+++ b/ambari-web/app/templates/common/modal_popup.hbs
@@ -49,7 +49,7 @@
       <div class="modal-footer">
         {{#if view.hasFooterCheckbox}}
           <label id="footer-checkbox">{{view Ember.Checkbox classNames="checkbox" checkedBinding="view.isNotShowBgChecked"}}
&nbsp;
-          {{t app.settings.notShowBgOperations}}</label>
+          {{t admin.userSettings.notShowBgOperations}}</label>
         {{/if}}
         {{#if view.secondary}}
           <a class="btn" {{action onSecondary target="view"}}>{{view.secondary}}</a>

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/4b84ed17/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 52cd32e..dd74893 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -556,7 +556,7 @@ var urls = {
     'type': 'GET',
     'format': function (data, opt) {
       return {
-        data: data.data
+        async: false
       };
     }
   },
@@ -856,27 +856,6 @@ var urls = {
     'real': '/clusters/{cluster}/requests/{requestId}?fields=tasks/*',
     'mock': '/data/wizard/{mock}'
   },
-  'settings.get.user_pref': {
-    'real': '/persist/{key}',
-    'mock': '',
-    'type': 'GET',
-    'format': function (data, opt) {
-      return {
-        async: false
-      };
-    }
-  },
-  'settings.post.user_pref': {
-    'real': '/persist',
-    'mock': '',
-    'type': 'POST',
-    'format': function (data) {
-      return {
-        async: false,
-        data: JSON.stringify(data.keyValuePair)
-      }
-    }
-  },
   'wizard.advanced_repositories.valid_url': {
     'real': '/stacks2/{stackName}/versions/{stackVersion}/operatingSystems/{osType}/repositories/{nameVersionCombo}',
     'mock': '',


Mime
View raw message