ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal content (alexantonenko)
Date Fri, 02 Dec 2016 21:08:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 8f0a0ae41 -> f39bd6b6c


AMBARI-19049. Alerts Popup displays full error stacktrace instead of minimal content (alexantonenko)


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

Branch: refs/heads/branch-2.5
Commit: f39bd6b6c8ca5790f5370c7f910f60d21b5f2c8d
Parents: 8f0a0ae
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri Dec 2 01:16:00 2016 +0200
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Fri Dec 2 23:08:23 2016 +0200

----------------------------------------------------------------------
 .../controllers/main/service/info/summary.js    | 37 +++++++++++---------
 .../main/service/info/service_alert_popup.hbs   | 15 +++++---
 2 files changed, 31 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f39bd6b6/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 821b796..09f3429 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -386,25 +386,30 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix
           var property = context.get('componentName') ? 'componentName' : 'serviceName';
           var serviceDefinitions = this.get('controller.content').filterProperty(property,
context.get(property));
           // definitions should be sorted in order: critical, warning, ok, unknown, other
-          var criticalDefinitions = [], warningDefinitions = [], okDefinitions = [], unknownDefinitions
= [];
+          var definitionTypes = {
+            "isCritical": [],
+            "isWarning": [],
+            "isOK": [],
+            "isUnknown": []
+          };
+
           serviceDefinitions.forEach(function (definition) {
-            if (definition.get('isCritical')) {
-              criticalDefinitions.push(definition);
-              serviceDefinitions = serviceDefinitions.without(definition);
-            } else if (definition.get('isWarning')) {
-              warningDefinitions.push(definition);
-              serviceDefinitions = serviceDefinitions.without(definition);
-            } else if (definition.get('isOK')) {
-              okDefinitions.push(definition);
-              serviceDefinitions = serviceDefinitions.without(definition);
-            } else if (definition.get('isUnknown')) {
-              unknownDefinitions.push(definition);
-              serviceDefinitions = serviceDefinitions.without(definition);
-            }
+            Object.keys(definitionTypes).forEach(function (type) {
+              if (definition.get(type)) {
+                definition.set('isCollapsed', true);
+                definitionTypes[type].push(definition);
+                serviceDefinitions = serviceDefinitions.without(definition);
+              }
+            });
           });
-          serviceDefinitions = criticalDefinitions.concat(warningDefinitions, okDefinitions,
unknownDefinitions, serviceDefinitions);
+          serviceDefinitions = definitionTypes.isCritical.concat(definitionTypes.isWarning,
definitionTypes.isOK, definitionTypes.isUnknown, serviceDefinitions);
+
           return serviceDefinitions;
         }.property('controller.content'),
+        onToggleBlock: function (alert) {
+          this.$('#' + alert.context.clientId).toggle('blind', 500);
+          alert.context.set("isCollapsed", !alert.context.get("isCollapsed"));
+        },
         gotoAlertDetails: function (event) {
           if (event && event.context) {
             this.get('parentView').hide();
@@ -855,4 +860,4 @@ App.MainServiceInfoSummaryController = Em.Controller.extend(App.WidgetSectionMix
     App.router.route('main' + event.context.href);
   }
 
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/f39bd6b6/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
index cbadf06..6ab6b3f 100644
--- a/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
+++ b/ambari-web/app/templates/main/service/info/service_alert_popup.hbs
@@ -22,11 +22,16 @@
       <li class="alert-list-wrap">
         <div class="row-fluid">
           <div class="span8 name-text">
-            <div>
-              <a href="#" {{action "gotoAlertDetails" alert target="view"}}>{{alert.label}}</a>
-            </div>
-            <div class="definition-latest-text">
-              {{alert.latestText}}
+            <div class="accordion-group block">
+              <div class="accordion-heading" {{action "onToggleBlock" alert target="view"}}>
+                <i {{bindAttr class=":pull-left :accordion-toggle alert.isCollapsed:icon-caret-right:icon-caret-down"}}></i>
+                <a class="accordion-toggle" href="#" {{action "gotoAlertDetails" alert
target="view"}}>{{alert.label}}</a>
+              </div>
+              <div id="{{unbound alert.clientId}}" class="accordion-body collapse in"
style="display: none">
+                <div class="accordion-inner definition-latest-text">
+                  {{alert.latestText}}
+                </div>
+              </div>
             </div>
           </div>
           <div class="span4 status-col" rel="alert-status-tooltip" >


Mime
View raw message