ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject ambari git commit: AMBARI-12717. Ambari UI with 10K+ alerts on the cluster becomes unresponsive after opening alerts popup (onechiporenko)
Date Tue, 11 Aug 2015 09:48:59 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1.1 591709e7e -> 959874c2a


AMBARI-12717. Ambari UI with 10K+ alerts on the cluster becomes unresponsive after opening
alerts popup (onechiporenko)


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

Branch: refs/heads/branch-2.1.1
Commit: 959874c2a2caca8ff0df319f31cb7a5b6c2b53c3
Parents: 591709e
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Tue Aug 11 12:28:42 2015 +0300
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Tue Aug 11 12:47:37 2015 +0300

----------------------------------------------------------------------
 .../main/alerts/alert_instances_controller.js   | 42 ++++++++++++--------
 .../common/modal_popups/alerts_popup.hbs        |  4 +-
 2 files changed, 28 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/959874c2/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 391c326..0117104 100644
--- a/ambari-web/app/controllers/main/alerts/alert_instances_controller.js
+++ b/ambari-web/app/controllers/main/alerts/alert_instances_controller.js
@@ -27,11 +27,18 @@ App.MainAlertInstancesController = Em.Controller.extend({
   /**
    * @type {App.AlertInstance[]}
    */
-  unhealthyAlertInstances: function () {
-    return App.AlertInstance.find().filter(function (item) {
+  unhealthyAlertInstances: [],
+
+  updateUnhealthyAlertInstances: function () {
+    Em.run.once(this, this.updateUnhealthyAlertInstancesOnce);
+  }.observes('content.[]'),
+
+  updateUnhealthyAlertInstancesOnce: function() {
+    var alertInstances = App.AlertInstance.find().filter(function (item) {
       return ['CRITICAL', 'WARNING'].contains(item.get('state'));
     });
-  }.property('content.[]'),
+    this.set('unhealthyAlertInstances', alertInstances);
+  },
 
   /**
    * Are alertInstances loaded
@@ -117,9 +124,11 @@ App.MainAlertInstancesController = Em.Controller.extend({
    * @method loadAlertInstances
    */
   loadAlertInstances: function () {
-    this.set('isLoaded', false);
-    this.set('sourceType', null);
-    this.set('sourceName', null);
+    this.setProperties({
+      isLoaded: false,
+      sourceType: null,
+      sourceName: null
+    });
     this.fetchAlertInstances();
   },
 
@@ -130,9 +139,11 @@ App.MainAlertInstancesController = Em.Controller.extend({
    * @method loadAlertInstancesByHost
    */
   loadAlertInstancesByHost: function (hostName) {
-    this.set('isLoaded', false);
-    this.set('sourceType', 'HOST');
-    this.set('sourceName', hostName);
+    this.setProperties({
+      isLoaded: false,
+      sourceType: 'HOST',
+      sourceName: hostName
+    });
     this.fetchAlertInstances();
   },
 
@@ -143,9 +154,11 @@ App.MainAlertInstancesController = Em.Controller.extend({
    * @method loadAlertInstancesByAlertDefinition
    */
   loadAlertInstancesByAlertDefinition: function (definitionId) {
-    this.set('isLoaded', false);
-    this.set('sourceType', 'ALERT_DEFINITION');
-    this.set('sourceName', definitionId);
+    this.setProperties({
+      isLoaded: false,
+      sourceType: 'ALERT_DEFINITION',
+      sourceName: definitionId
+    });
     this.fetchAlertInstances();
   },
 
@@ -171,7 +184,7 @@ App.MainAlertInstancesController = Em.Controller.extend({
   getAlertInstancesSuccessCallback: function (json) {
     App.alertInstanceMapper.map(json);
     this.set('isLoaded', true);
-    this.set('reload', !this.get('reload'));
+    this.toggleProperty('reload');
   },
 
   /**
@@ -199,8 +212,6 @@ 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'),
@@ -343,7 +354,6 @@ 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/959874c2/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 2e57a50..5b235de 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" rel="alert-status-tooltip" {{bindAttr title="alertInstance.lastTriggered"}}>
+                  <div class="status-col" {{bindAttr title="alertInstance.lastTriggered"}}>
                     <span>
                       <span class="status-icon">{{{alertInstance.status}}}</span>
-                      <time class="timeago" {{bindAttr data-original-title="alertInstance.lastTriggeredVerboseDisplay"}}>{{alertInstance.lastTriggeredForFormatted}}</time>
+                      <time>{{alertInstance.lastTriggeredForFormatted}}</time>
                     </span>
                   </div>
               </div>


Mime
View raw message