ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [21/32] ambari git commit: AMBARI-21724 Hosts filters work incorrectly. (atkach)
Date Thu, 17 Aug 2017 10:16:27 GMT
AMBARI-21724 Hosts filters work incorrectly. (atkach)


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

Branch: refs/heads/branch-feature-logsearch-ui
Commit: f2379a4468de071c3fc1dea2de58f53e4a86913f
Parents: fc8dd78
Author: Andrii Tkach <atkach@apache.org>
Authored: Wed Aug 16 15:39:10 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Wed Aug 16 15:39:10 2017 +0300

----------------------------------------------------------------------
 ambari-web/app/mappers/hosts_mapper.js |  2 ++
 ambari-web/app/models/host.js          |  2 ++
 ambari-web/app/views/main/host.js      | 10 ++++++++++
 3 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f2379a44/ambari-web/app/mappers/hosts_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js
index c2c69ca..784c48a 100644
--- a/ambari-web/app/mappers/hosts_mapper.js
+++ b/ambari-web/app/mappers/hosts_mapper.js
@@ -206,6 +206,7 @@ App.hostsMapper = App.QuickDataMapper.create({
         parsedItem.not_started_components = notStartedComponents;
         parsedItem.components_in_passive_state = componentsInPassiveState;
         parsedItem.components_with_stale_configs = componentsWithStaleConfigs;
+        parsedItem.is_filtered = true;
 
         hostIds[item.Hosts.host_name] = parsedItem;
 
@@ -224,6 +225,7 @@ App.hostsMapper = App.QuickDataMapper.create({
 
       //"itemTotal" present only for Hosts page request
       if (!Em.isNone(json.itemTotal)) {
+        App.Host.find().setEach('isFiltered', false);
         App.Host.find().clear();
         //App.HostComponent.find contains master components which requested across the app
hence it should not be cleared
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2379a44/ambari-web/app/models/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js
index 58ffd41..69e43ba 100644
--- a/ambari-web/app/models/host.js
+++ b/ambari-web/app/models/host.js
@@ -55,6 +55,8 @@ App.Host = DS.Model.extend({
   index: DS.attr('number'),
   stackVersions: DS.hasMany('App.HostStackVersion'),
 
+  isFiltered: DS.attr('boolean'),
+
   /**
    * Is host checked at the main Hosts page
    */

http://git-wip-us.apache.org/repos/asf/ambari/blob/f2379a44/ambari-web/app/views/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host.js b/ambari-web/app/views/main/host.js
index 78eb82b..5c4048b 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -50,6 +50,16 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
    */
   contentBinding: 'controller.content',
 
+  filteredContent: [],
+
+  filteredContentObserver: function() {
+    Em.run.once(this, this.setFilteredContentOnce);
+  }.observes('content.@each'),
+
+  setFilteredContentOnce: function() {
+    this.set('filteredContent', this.get('content').filterProperty('isFiltered'));
+  },
+
   onRequestErrorHandler: function() {
     this.set('requestError', null);
     this.set('filteringComplete', true);


Mime
View raw message