ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-9216 Versions: multiple issues with versions in Hosts pages. (ababiichuk)
Date Tue, 20 Jan 2015 16:56:47 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 1abd35a7b -> e9ecb672a


AMBARI-9216 Versions: multiple issues with versions in Hosts pages. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: e9ecb672a3211582af984661e36a84de93c4b37a
Parents: 1abd35a
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Tue Jan 20 18:34:09 2015 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Tue Jan 20 18:34:24 2015 +0200

----------------------------------------------------------------------
 .../controllers/global/cluster_controller.js    |  3 ++
 ambari-web/app/controllers/main/host.js         | 14 +++++++--
 ambari-web/app/messages.js                      |  2 ++
 .../mixins/common/table_server_view_mixin.js    | 20 ++++++++++++
 ambari-web/app/views/main/host.js               | 33 +++++++-------------
 .../app/views/main/host/stack_versions_view.js  |  2 +-
 6 files changed, 49 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e9ecb672/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index 728422d..60760b1 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -286,6 +286,9 @@ App.ClusterController = Em.Controller.extend({
       self.updateLoadStatus('stackComponents');
       updater.updateServices(function () {
         self.updateLoadStatus('services');
+        //force clear filters  for hosts page to load all data
+        App.db.setFilterConditions('mainHostController', null);
+
         updater.updateHost(function () {
           self.updateLoadStatus('hosts');
         });

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9ecb672/ambari-web/app/controllers/main/host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host.js b/ambari-web/app/controllers/main/host.js
index c5baddf..166cbfc 100644
--- a/ambari-web/app/controllers/main/host.js
+++ b/ambari-web/app/controllers/main/host.js
@@ -57,6 +57,7 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
     return this.get('dataSource').filterProperty('isRequested');
   }.property('dataSource.@each.isRequested'),
 
+  allHostStackVersions: App.HostStackVersion.find(),
   /**
    * filterProperties support follow types of filter:
    * MATCH - match of RegExp
@@ -123,8 +124,13 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
       type: 'MULTIPLE'
     },
     {
-      name: 'stackVersions',
-      key: 'stack_versions/HostStackVersions',
+      name: 'repositoryVersion',
+      key: 'stack_versions/repository_versions/RepositoryVersions/repository_version',
+      type: 'EQUAL'
+    },
+    {
+      name: 'hostStackVersionState',
+      key: 'stack_versions/HostStackVersions/state',
       type: 'EQUAL'
     }
   ],
@@ -931,7 +937,9 @@ App.MainHostController = Em.ArrayController.extend(App.TableServerMixin,
{
     associations[8] = 'componentsWithStaleConfigsCount';
     associations[9] = 'componentsInPassiveStateCount';
     associations[10] = 'selected';
-    associations[11] = 'stackVersions.repoVersion';
+    associations[11] = 'hostStackVersion';
+    associations[12] = 'repositoryVersion';
+    associations[13] = 'hostStackVersionState';
     return associations;
   }.property()
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9ecb672/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 5bfe3e3..8c00958 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1976,6 +1976,7 @@ Em.I18n.translations = {
   'hosts.host.serviceNotAvailable': 'Service not available on this host',
 
   'hosts.host.menu.stackVersions': 'Versions',
+  'hosts.host.stackVersions.table.allVersions': 'All Versions',
   'hosts.host.stackVersions.table.noVersions': 'No versions',
   'hosts.host.stackVersions.table.filteredInfo': '{0} of {1} versions showing',
   'hosts.host.stackVersions.status.init': 'Uninstalled',
@@ -1983,6 +1984,7 @@ Em.I18n.translations = {
   'hosts.host.stackVersions.status.install_failed': 'Install Failed',
   'hosts.host.stackVersions.status.installing': 'Installing',
   'hosts.host.stackVersions.status.current': 'Current',
+  'hosts.host.stackVersions.status.out_of_sync': 'Out of sync',
 
   'hosts.host.metrics.dataUnavailable':'Data Unavailable',
   'hosts.host.metrics.cpu':'CPU Usage',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9ecb672/ambari-web/app/mixins/common/table_server_view_mixin.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/table_server_view_mixin.js b/ambari-web/app/mixins/common/table_server_view_mixin.js
index 47b16b5..78c1920 100644
--- a/ambari-web/app/mixins/common/table_server_view_mixin.js
+++ b/ambari-web/app/mixins/common/table_server_view_mixin.js
@@ -67,6 +67,26 @@ App.TableServerViewMixin = Em.Mixin.create({
   }.property('filteredContent'),
   /**
    * compute applied filters and run content update from server
+   * @param filterObjects
+   */
+  updateFilters: function(filterObjects) {
+    this.set('controller.resetStartIndex', false);
+    filterObjects.forEach(function(filterObject) {
+      this.saveFilterConditions(filterObject.iColumn, filterObject.value, filterObject.type,
false);
+    }, this);
+    if (!this.get('filteringComplete')) {
+      clearTimeout(this.get('timeOut'));
+      this.set('timeOut', setTimeout(function () {
+        self.updateFilters(filterObjects);
+      }, this.get('filterWaitingTime')));
+    } else {
+      clearTimeout(this.get('timeOut'));
+      this.set('controller.resetStartIndex', true);
+      this.refresh();
+    }
+  },
+  /**
+   * compute applied filter and run content update from server
    * @param iColumn
    * @param value
    * @param type

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9ecb672/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 9effbfd..5153a75 100644
--- a/ambari-web/app/views/main/host.js
+++ b/ambari-web/app/views/main/host.js
@@ -598,8 +598,9 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
      * @returns {String}
      */
     currentVersion: function() {
-      var repoVersion = this.get('content.stackVersions').findProperty('isCurrent');
-      return repoVersion.get('repoVersion') + " (" + repoVersion.get('displayStatus') + ")";
+      var currentRepoVersion = this.get('content.stackVersions').findProperty('isCurrent');
+      var version = currentRepoVersion ? currentRepoVersion : this.get('content.stackVersions').filterProperty('isCurrent',
false)[0];
+      return version.get('repoVersion') + " (" + version.get('displayStatus') + ")";
     }.property('content.stackVersions'),
 
     /**
@@ -1019,26 +1020,28 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin,
{
       value: [],
 
       versionSelectView: filters.createSelectView({
+        column: 12,
         classNames: ['notActive'],
         fieldType: 'filter-input-width',
         content: function () {
           return  [
             {
               value: '',
-              label: Em.I18n.t('common.all')
+              label: Em.I18n.t('hosts.host.stackVersions.table.allVersions')
             }
-          ].concat(App.HostStackVersion.find().mapProperty('version').uniq().map(function
(version) {
+          ].concat(this.get('controller.allHostStackVersions').mapProperty('repoVersion').uniq().map(function
(version) {
             return {
               value: version,
               label: version
             }
           }));
-        }.property('App.router.clusterController.isLoaded'),
+        }.property('App.router.clusterController.isLoaded', 'controller.allHostStackVersions.length'),
         onChangeValue: function () {
           this.set('parentView.selectedVersion', this.get('value'));
         }
       }),
       statusSelectView: filters.createSelectView({
+        column: 13,
         classNames: ['notActive'],
         fieldType: 'filter-input-width',
         content: function () {
@@ -1065,19 +1068,10 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin,
{
         this._super();
         var self = this;
         var filterProperties = [];
-        if (this.get('selectedVersion')) {
-          filterProperties.push({
-            property: 'version',
-            value: this.get('selectedVersion')
-          });
-        }
-        if (this.get('selectedStatus')) {
-          filterProperties.push({
-            property: 'state',
-            value: this.get('selectedStatus')
-          });
-        }
-        self.set('value', filterProperties);
+        var filters = [];
+        filters.pushObject({ iColumn: 12, value: this.get('selectedVersion')});
+        filters.pushObject({ iColumn: 13, value: this.get('selectedStatus')});
+        this.get('parentView.parentView').updateFilters(filters);
       },
       /**
        * Clear filter to initial state
@@ -1089,9 +1083,6 @@ App.MainHostView = App.TableView.extend(App.TableServerViewMixin, {
         });
       }
     }),
-    onChangeValue: function () {
-      this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'sub-resource');
-    },
     clearFilter: function () {
       this._super();
       this.get('childViews').forEach(function (view) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/e9ecb672/ambari-web/app/views/main/host/stack_versions_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/host/stack_versions_view.js b/ambari-web/app/views/main/host/stack_versions_view.js
index 43b1a30..2fd4e79 100644
--- a/ambari-web/app/views/main/host/stack_versions_view.js
+++ b/ambari-web/app/views/main/host/stack_versions_view.js
@@ -118,7 +118,7 @@ App.MainHostStackVersionsView = App.TableView.extend({
       return [
         {
           value: '',
-          label: Em.I18n.t('common.all')
+          label: Em.I18n.t('hosts.host.stackVersions.table.allVersions')
         }
       ].concat(this.get('parentView.content').mapProperty('repoVersion').uniq().map(function
(version) {
         return {


Mime
View raw message