You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/01/10 22:24:00 UTC
svn commit: r1431656 - in /incubator/ambari/trunk: CHANGES.txt
ambari-web/app/app.js ambari-web/app/data_adapter.js
ambari-web/app/mappers/service_mapper.js ambari-web/app/models/host.js
Author: yusaku
Date: Thu Jan 10 21:24:00 2013
New Revision: 1431656
URL: http://svn.apache.org/viewvc?rev=1431656&view=rev
Log:
AMBARI-1091. 2 parallel requests for service information resulting in JS exception. (Srimanth Gunturi via yusaku)
Removed:
incubator/ambari/trunk/ambari-web/app/data_adapter.js
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-web/app/app.js
incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js
incubator/ambari/trunk/ambari-web/app/models/host.js
Modified: incubator/ambari/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1431656&r1=1431655&r2=1431656&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Jan 10 21:24:00 2013
@@ -654,6 +654,9 @@ AMBARI-666 branch (unreleased changes)
BUG FIXES
+ AMBARI-1091. 2 parallel requests for service information resulting in JS
+ exception. (Srimanth Gunturi via yusaku)
+
AMBARI-1090. Restrict user to apply service configuration when custom box
properties are already exposed on the management config page.
(Jaimin Jetly via yusaku)
Modified: incubator/ambari/trunk/ambari-web/app/app.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/app.js?rev=1431656&r1=1431655&r2=1431656&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/app.js (original)
+++ incubator/ambari/trunk/ambari-web/app/app.js Thu Jan 10 21:24:00 2013
@@ -24,8 +24,9 @@ module.exports = Em.Application.create({
store: DS.Store.create({
revision: 4,
- adapter: require('data_adapter')
- // adapter: DS.FixtureAdapter.create()
+ adapter: DS.FixtureAdapter.create({
+ simulateRemoteResponse: false
+ })
})
});
Modified: incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js?rev=1431656&r1=1431655&r2=1431656&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js (original)
+++ incubator/ambari/trunk/ambari-web/app/mappers/service_mapper.js Thu Jan 10 21:24:00 2013
@@ -144,6 +144,12 @@ App.servicesMapper = App.QuickDataMapper
}
if (json.items) {
+ try{
+ App.store.commit();
+ }catch (e) {
+ console.log("Error committing store before Service mapper maps");
+ console.log(e);
+ }
var result = [];
json.items.forEach(function (item) {
var finalConfig = jQuery.extend({}, this.config);
Modified: incubator/ambari/trunk/ambari-web/app/models/host.js
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/models/host.js?rev=1431656&r1=1431655&r2=1431656&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/models/host.js (original)
+++ incubator/ambari/trunk/ambari-web/app/models/host.js Thu Jan 10 21:24:00 2013
@@ -111,38 +111,31 @@ App.Host = DS.Model.extend({
if (this.get('loadFifteen') != null) return this.get('loadFifteen').toFixed(2);
}.property('loadOne', 'loadFive', 'loadFifteen'),
- updateHostStatus: function(){
+ healthClass: function(){
+ var healthStatus = this.get('healthStatus');
/**
* Do nothing until load
*/
- if(!this.get('isLoaded')){
- return;
- }
-
- var status;
-
- var masterComponents = this.get('components').filterProperty('isMaster', true);
- var masterComponentsRunning = masterComponents
- .everyProperty('workStatus', App.Component.Status.started);
-
- if(this.get('isNotHeartBeating')){
- status = 'DEAD-YELLOW';
- } else if(masterComponentsRunning){
- status = 'LIVE';
- } else if(masterComponents.length > 0 && !masterComponentsRunning){
- status = 'DEAD';
- } else{
- status = 'DEAD-ORANGE';
+ if (!this.get('isLoaded') || this.get('isSaving')) {
+ } else {
+ var status;
+ var masterComponents = this.get('components').filterProperty('isMaster', true);
+ var masterComponentsRunning = masterComponents.everyProperty('workStatus', App.Component.Status.started);
+ if (this.get('isNotHeartBeating')) {
+ status = 'DEAD-YELLOW';
+ } else if (masterComponentsRunning) {
+ status = 'LIVE';
+ } else if (masterComponents.length > 0 && !masterComponentsRunning) {
+ status = 'DEAD';
+ } else {
+ status = 'DEAD-ORANGE';
+ }
+ if (status) {
+ healthStatus = status;
+ }
}
-
- if(status){
- this.set('healthStatus', status);
- }
- }.observes('components.@each.workStatus'),
-
- healthClass: function(){
- return 'health-status-' + this.get('healthStatus');
- }.property('healthStatus')
+ return 'health-status-' + healthStatus;
+ }.property('healthStatus', 'components.@each.workStatus')
});
App.Host.FIXTURES = [];
\ No newline at end of file