You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ja...@apache.org on 2013/11/16 00:24:23 UTC
git commit: AMBARI-3781: JS error on trying to login after launching
Security Wizard. (jaimin)
Updated Branches:
refs/heads/trunk 05cb1b7d6 -> 8ba18c255
AMBARI-3781: JS error on trying to login after launching Security Wizard. (jaimin)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/8ba18c25
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/8ba18c25
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/8ba18c25
Branch: refs/heads/trunk
Commit: 8ba18c255fdf3c614940bb952b35154bdbb23772
Parents: 05cb1b7
Author: Jaimin Jetly <ja...@hortonworks.com>
Authored: Fri Nov 15 15:22:06 2013 -0800
Committer: Jaimin Jetly <ja...@hortonworks.com>
Committed: Fri Nov 15 15:22:14 2013 -0800
----------------------------------------------------------------------
ambari-web/app/models/cluster_states.js | 22 +++++++++++-----------
ambari-web/app/router.js | 2 +-
ambari-web/app/routes/add_security.js | 4 +---
ambari-web/app/routes/main.js | 4 +---
ambari-web/app/utils/ajax.js | 3 +--
5 files changed, 15 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/8ba18c25/ambari-web/app/models/cluster_states.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/cluster_states.js b/ambari-web/app/models/cluster_states.js
index 0ab9c43..b82e079 100644
--- a/ambari-web/app/models/cluster_states.js
+++ b/ambari-web/app/models/cluster_states.js
@@ -114,36 +114,36 @@ App.clusterStatus = Ember.Object.create({
*/
setClusterStatus: function(newValue){
if(App.testMode) return false;
+ var val = {clusterName: this.get('clusterName')};
if (newValue) {
//setter
- if (newValue.clusterState) {
- this.set('clusterState', newValue.clusterState);
- }
if (newValue.clusterName) {
this.set('clusterName', newValue.clusterName);
+ val.clusterName = newValue.clusterName;
+ }
+
+ if (newValue.clusterState) {
+ this.set('clusterState', newValue.clusterState);
+ val.clusterState = newValue.clusterState;
}
if (newValue.wizardControllerName) {
this.set('wizardControllerName', newValue.wizardControllerName);
+ val.wizardControllerName = newValue.wizardControllerName;
}
if (newValue.localdb) {
this.set('localdb', newValue.localdb);
+ val.localdb = newValue.localdb;
}
var keyValuePair = {};
- var val = {
- clusterName: this.get('clusterName'),
- clusterState: this.get('clusterState'),
- wizardControllerName: this.get('wizardControllerName'),
- localdb: this.get('localdb')
- };
+
keyValuePair[this.get('key')] = JSON.stringify(val);
App.ajax.send({
name: 'cluster.state',
sender: this,
data: {
- key: keyValuePair,
- newVal: newValue
+ keyValuePair: keyValuePair
},
beforeSend: 'clusterStatusBeforeSend',
error: 'clusterStatusErrorCallBack'
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/8ba18c25/ambari-web/app/router.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js
index 0ec62f9..c1169c3 100644
--- a/ambari-web/app/router.js
+++ b/ambari-web/app/router.js
@@ -268,7 +268,7 @@ App.Router = Em.Router.extend({
}
App.clusterStatus.updateFromServer();
var clusterStatusOnServer = App.clusterStatus.get('value');
- if (!localStorage.getObject('ambari').app.user.admin || clusterStatusOnServer && clusterStatusOnServer.clusterState === 'DEFAULT') {
+ if (!App.get('isAdmin') || clusterStatusOnServer && clusterStatusOnServer.clusterState === 'DEFAULT') {
return 'main.index';
} else if (clusterStatusOnServer && clusterStatusOnServer.wizardControllerName === App.router.get('addHostController.name')) {
// if wizardControllerName == "addHostController", then it means someone closed the browser or the browser was crashed when we were last in Add Hosts wizard
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/8ba18c25/ambari-web/app/routes/add_security.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/add_security.js b/ambari-web/app/routes/add_security.js
index b7e9236..8a4d730 100644
--- a/ambari-web/app/routes/add_security.js
+++ b/ambari-web/app/routes/add_security.js
@@ -83,9 +83,7 @@ module.exports = Em.Route.extend({
router.get('addSecurityController').setCurrentStep(1);
App.clusterStatus.setClusterStatus({
clusterName: router.get('content.cluster.name'),
- clusterState: 'DEFAULT',
- wizardControllerName: router.get('addSecurityController.name'),
- localdb: App.db.data.AddSecurity
+ clusterState: 'DEFAULT'
});
router.transitionTo('adminSecurity.index');
},
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/8ba18c25/ambari-web/app/routes/main.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/routes/main.js b/ambari-web/app/routes/main.js
index 4239052..42dd63a 100644
--- a/ambari-web/app/routes/main.js
+++ b/ambari-web/app/routes/main.js
@@ -747,9 +747,7 @@ module.exports = Em.Route.extend({
router.get('mainAdminSecurityController').setDisableSecurityStatus(undefined);
App.clusterStatus.setClusterStatus({
clusterName: router.get('content.cluster.name'),
- clusterState: 'DEFAULT',
- wizardControllerName: router.get('mainAdminSecurityDisableController.name'),
- localdb: App.db.data.AddSecurity
+ clusterState: 'DEFAULT'
});
this.hide();
router.transitionTo('adminSecurity.index');
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/8ba18c25/ambari-web/app/utils/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js
index 45da260..992b25c 100644
--- a/ambari-web/app/utils/ajax.js
+++ b/ambari-web/app/utils/ajax.js
@@ -581,8 +581,7 @@ var urls = {
'format': function (data, opt) {
return {
async: false,
- data: JSON.stringify(data.key),
- newValue: data.newVal
+ data: JSON.stringify(data.keyValuePair)
};
}
},