Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E4A7C10DEC for ; Mon, 11 Nov 2013 23:53:46 +0000 (UTC) Received: (qmail 84840 invoked by uid 500); 11 Nov 2013 23:53:46 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 84818 invoked by uid 500); 11 Nov 2013 23:53:46 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 84811 invoked by uid 99); 11 Nov 2013 23:53:46 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Nov 2013 23:53:46 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id CDA068A51DB; Mon, 11 Nov 2013 23:53:45 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: ambari-commits@incubator.apache.org Message-Id: <4f16df5fca144b8bbe6aa9ba3fe8a527@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: Revert "AMBARI-3746. Some clean up for previous commits. (xiwang)" Date: Mon, 11 Nov 2013 23:53:45 +0000 (UTC) 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 Authored: Mon Nov 11 15:53:39 2013 -0800 Committer: Yusaku Sako 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.
You can go back to step 1 OR remove this host.
' + 'The host type is {0}, but you selected group {1} in step 1.', 'installer.step3.hostWarningsPopup.report':'Show Report', 'installer.step3.hostWarningsPopup.report.header': '

######################################
# Host Checks Report
#
# Generated: ', @@ -366,7 +366,6 @@ Em.I18n.translations = { '

Note: To clean up in interactive mode, remove --silent option. To clean up all resources, including users, remove --skip=users option. Use --help for a list of available options.
', '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 @@