You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/08/12 13:21:04 UTC
[4/5] ambari git commit: Revert "AMBARI-12717. Ambari UI with 10K+
alerts on the cluster becomes unresponsive after opening alerts popup
(onechiporenko)"
Revert "AMBARI-12717. Ambari UI with 10K+ alerts on the cluster becomes unresponsive after opening alerts popup (onechiporenko)"
This reverts commit 959874c2a2caca8ff0df319f31cb7a5b6c2b53c3.
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/bf809c19
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bf809c19
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bf809c19
Branch: refs/heads/branch-2.1.1
Commit: bf809c19dd9243d0965ac6a54220b6865fbb4bb1
Parents: fc71869
Author: Alex Antonenko <hi...@gmail.com>
Authored: Wed Aug 12 14:20:09 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Wed Aug 12 14:20:09 2015 +0300
----------------------------------------------------------------------
.../main/alerts/alert_instances_controller.js | 42 ++++++++------------
.../common/modal_popups/alerts_popup.hbs | 4 +-
2 files changed, 18 insertions(+), 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/bf809c19/ambari-web/app/controllers/main/alerts/alert_instances_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/alerts/alert_instances_controller.js b/ambari-web/app/controllers/main/alerts/alert_instances_controller.js
index 0117104..391c326 100644
--- a/ambari-web/app/controllers/main/alerts/alert_instances_controller.js
+++ b/ambari-web/app/controllers/main/alerts/alert_instances_controller.js
@@ -27,18 +27,11 @@ App.MainAlertInstancesController = Em.Controller.extend({
/**
* @type {App.AlertInstance[]}
*/
- unhealthyAlertInstances: [],
-
- updateUnhealthyAlertInstances: function () {
- Em.run.once(this, this.updateUnhealthyAlertInstancesOnce);
- }.observes('content.[]'),
-
- updateUnhealthyAlertInstancesOnce: function() {
- var alertInstances = App.AlertInstance.find().filter(function (item) {
+ unhealthyAlertInstances: function () {
+ return App.AlertInstance.find().filter(function (item) {
return ['CRITICAL', 'WARNING'].contains(item.get('state'));
});
- this.set('unhealthyAlertInstances', alertInstances);
- },
+ }.property('content.[]'),
/**
* Are alertInstances loaded
@@ -124,11 +117,9 @@ App.MainAlertInstancesController = Em.Controller.extend({
* @method loadAlertInstances
*/
loadAlertInstances: function () {
- this.setProperties({
- isLoaded: false,
- sourceType: null,
- sourceName: null
- });
+ this.set('isLoaded', false);
+ this.set('sourceType', null);
+ this.set('sourceName', null);
this.fetchAlertInstances();
},
@@ -139,11 +130,9 @@ App.MainAlertInstancesController = Em.Controller.extend({
* @method loadAlertInstancesByHost
*/
loadAlertInstancesByHost: function (hostName) {
- this.setProperties({
- isLoaded: false,
- sourceType: 'HOST',
- sourceName: hostName
- });
+ this.set('isLoaded', false);
+ this.set('sourceType', 'HOST');
+ this.set('sourceName', hostName);
this.fetchAlertInstances();
},
@@ -154,11 +143,9 @@ App.MainAlertInstancesController = Em.Controller.extend({
* @method loadAlertInstancesByAlertDefinition
*/
loadAlertInstancesByAlertDefinition: function (definitionId) {
- this.setProperties({
- isLoaded: false,
- sourceType: 'ALERT_DEFINITION',
- sourceName: definitionId
- });
+ this.set('isLoaded', false);
+ this.set('sourceType', 'ALERT_DEFINITION');
+ this.set('sourceName', definitionId);
this.fetchAlertInstances();
},
@@ -184,7 +171,7 @@ App.MainAlertInstancesController = Em.Controller.extend({
getAlertInstancesSuccessCallback: function (json) {
App.alertInstanceMapper.map(json);
this.set('isLoaded', true);
- this.toggleProperty('reload');
+ this.set('reload', !this.get('reload'));
},
/**
@@ -212,6 +199,8 @@ App.MainAlertInstancesController = Em.Controller.extend({
return Em.I18n.t('alerts.fastAccess.popup.header').format(this.get('alertsNumber'));
}.property('alertsNumber'),
+ definitionsController: this,
+
classNames: ['sixty-percent-width-modal', 'alerts-popup'],
secondary: Em.I18n.t('alerts.fastAccess.popup.body.showmore'),
@@ -354,6 +343,7 @@ App.MainAlertInstancesController = Em.Controller.extend({
didInsertElement: function () {
this.filter();
+ this.ensureTooltip();
this.addObserver('filteringComplete', this, this.overlayObserver);
this.overlayObserver();
return this._super();
http://git-wip-us.apache.org/repos/asf/ambari/blob/bf809c19/ambari-web/app/templates/common/modal_popups/alerts_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/modal_popups/alerts_popup.hbs b/ambari-web/app/templates/common/modal_popups/alerts_popup.hbs
index 5b235de..2e57a50 100644
--- a/ambari-web/app/templates/common/modal_popups/alerts_popup.hbs
+++ b/ambari-web/app/templates/common/modal_popups/alerts_popup.hbs
@@ -42,10 +42,10 @@
{{alertInstance.text}}
</div>
</div>
- <div class="status-col" {{bindAttr title="alertInstance.lastTriggered"}}>
+ <div class="status-col" rel="alert-status-tooltip" {{bindAttr title="alertInstance.lastTriggered"}}>
<span>
<span class="status-icon">{{{alertInstance.status}}}</span>
- <time>{{alertInstance.lastTriggeredForFormatted}}</time>
+ <time class="timeago" {{bindAttr data-original-title="alertInstance.lastTriggeredVerboseDisplay"}}>{{alertInstance.lastTriggeredForFormatted}}</time>
</span>
</div>
</div>