Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FC901025B for ; Tue, 1 Apr 2014 14:13:45 +0000 (UTC) Received: (qmail 10054 invoked by uid 500); 1 Apr 2014 14:13:44 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 10033 invoked by uid 500); 1 Apr 2014 14:13:41 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 10021 invoked by uid 99); 1 Apr 2014 14:13:38 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 14:13:38 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 909D091BAE6; Tue, 1 Apr 2014 14:13:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: atkach@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-5300 Implement pagination on "Install, Start and Test" step. (atkach) Date: Tue, 1 Apr 2014 14:13:37 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/trunk 762ead1b1 -> 278a18993 AMBARI-5300 Implement pagination on "Install, Start and Test" step. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/278a1899 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/278a1899 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/278a1899 Branch: refs/heads/trunk Commit: 278a18993380b9911166bb197868679a0d10a4e4 Parents: 762ead1 Author: atkach Authored: Tue Apr 1 17:10:36 2014 +0300 Committer: atkach Committed: Tue Apr 1 17:10:36 2014 +0300 ---------------------------------------------------------------------- .../app/controllers/wizard/step3_controller.js | 30 ++--- .../app/controllers/wizard/step9_controller.js | 119 +------------------ ambari-web/app/styles/application.less | 14 +-- ambari-web/app/templates/wizard/step3.hbs | 7 +- ambari-web/app/templates/wizard/step6.hbs | 3 + ambari-web/app/templates/wizard/step9.hbs | 28 +++-- ambari-web/app/views/common/table_view.js | 2 +- ambari-web/app/views/wizard/step3_view.js | 14 ++- ambari-web/app/views/wizard/step6_view.js | 2 +- ambari-web/app/views/wizard/step9_view.js | 114 +++++++++++++++++- 10 files changed, 171 insertions(+), 162 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/278a1899/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index f1796f5..fb0a6f8 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -183,7 +183,6 @@ App.WizardStep3Controller = Em.Controller.extend({ }, retryHosts: function (hosts) { - this.selectAllCategory(); var bootStrapData = JSON.stringify({'verbose': true, 'sshKey': this.get('content.installOptions.sshKey'), 'hosts': hosts.mapProperty('name'), 'user': this.get('content.installOptions.sshUser')}); this.numPolls = 0; if (this.get('content.installOptions.manualInstall') !== true) { @@ -199,8 +198,6 @@ App.WizardStep3Controller = Em.Controller.extend({ }, retrySelectedHosts: function () { - //to display all hosts - this.set('category', 'All'); if (!this.get('isRetryDisabled')) { this.set('isRetryDisabled', true); var selectedHosts = this.get('bootHosts').filterProperty('bootStatus', 'FAILED'); @@ -494,16 +491,16 @@ App.WizardStep3Controller = Em.Controller.extend({ hosts.forEach(function (_host) { var host = (App.testMode) ? jsonData.items[0] : jsonData.items.findProperty('Hosts.host_name', _host.name); if (App.skipBootstrap) { - _host.cpu = 2; - _host.memory = ((parseInt(2000000))).toFixed(2); - _host.disk_info = [{"mountpoint": "/", "type":"ext4"},{"mountpoint": "/grid/0", "type":"ext4"}, {"mountpoint": "/grid/1", "type":"ext4"}, {"mountpoint": "/grid/2", "type":"ext4"}]; + _host.set('cpu', 2); + _host.set('memory', ((parseInt(2000000))).toFixed(2)); + _host.set('disk_info', [{"mountpoint": "/", "type":"ext4"},{"mountpoint": "/grid/0", "type":"ext4"}, {"mountpoint": "/grid/1", "type":"ext4"}, {"mountpoint": "/grid/2", "type":"ext4"}]); } else if (host) { - _host.cpu = host.Hosts.cpu_count; - _host.memory = ((parseInt(host.Hosts.total_mem))).toFixed(2); - _host.disk_info = host.Hosts.disk_info; - _host.os_type = host.Hosts.os_type; - _host.os_arch = host.Hosts.os_arch; - _host.ip = host.Hosts.ip; + _host.set('cpu', host.Hosts.cpu_count); + _host.set('memory', ((parseInt(host.Hosts.total_mem))).toFixed(2)); + _host.set('disk_info', host.Hosts.disk_info); + _host.set('os_type', host.Hosts.os_type); + _host.set('os_arch', host.Hosts.os_arch); + _host.set('ip', host.Hosts.ip); var context = self.checkHostOSType(host.Hosts.os_type, host.Hosts.host_name); if(context) { @@ -541,7 +538,6 @@ App.WizardStep3Controller = Em.Controller.extend({ this.set('repoCategoryWarnings', repoWarnings); this.set('diskCategoryWarnings', diskWarnings); - this.set('bootHosts', hosts); this.stopRegistration(); }, @@ -614,14 +610,6 @@ App.WizardStep3Controller = Em.Controller.extend({ } }, - selectCategory: function(event, context){ - this.set('category', event.context); - }, - - selectAllCategory: function(){ - this.set('category', this.get('categories').get('firstObject')); - }, - submit: function () { if (this.get('isHostHaveWarnings')) { var self = this; http://git-wip-us.apache.org/repos/asf/ambari/blob/278a1899/ambari-web/app/controllers/wizard/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index 7df8661..5a133ed 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -38,11 +38,6 @@ App.WizardStep9Controller = Em.Controller.extend({ hosts: [], - /* - * Indicate whether to show the message(that there are no hosts to display) instead of list of hosts - */ - isAnyHostDisplayed: true, - /** * overall progress of page shown as progress bar on the top of the page */ @@ -107,9 +102,7 @@ App.WizardStep9Controller = Em.Controller.extend({ * This function is called when a click event happens on Next button of page */ submit: function () { - if (!this.get('isSubmitDisabled')) { - App.router.send('next'); - } + App.router.send('next'); }, /** @@ -142,122 +135,14 @@ App.WizardStep9Controller = Em.Controller.extend({ }.property('content.cluster.status'), /** - * Ember Object with the controllerbinding as this controller. This object also contains - * - * hostStatus: {String} A valid status of a host. - * Used to filter hosts in that status. - * hostsCount: {Int} Dynamic count of hosts displayed in the category label - * label : {String} status and hosts in that status displayed which consists as a category on the page - * isActive: {boolean} Gets set when the category is selected/clicked by the user - * itemClass: {computed property} Binds the category link to active class when user clicks on the link - * - */ - categoryObject: Em.Object.extend({ - hostsCount: function () { - var category = this; - var hosts = this.get('controller.hosts').filter(function (_host) { - if (category.get('hostStatus') == 'inProgress') { - return (_host.get('status') == 'info' || _host.get('status') == 'pending' || _host.get('status') == 'in_progress'); - } else if (category.get('hostStatus') == 'failed') { - return (_host.get('status') == 'failed' || _host.get('status') == 'heartbeat_lost'); - } else { - return (_host.get('status') == category.get('hostStatus')); - } - }, this); - return hosts.get('length'); - }.property('controller.hosts.@each.status'), - label: function () { - return "%@ (%@)".fmt(this.get('value'), this.get('hostsCount')); - }.property('value', 'hostsCount') - }), - - /** - * computed property creates the category objects on the load of the page and sets 'All' as the active category - * @Returns: All created categories which are binded and iterated in the template - */ - categories: function () { - var self = this; - self.categoryObject.reopen({ - controller: self, - isActive: function () { - return this.get('controller.category') == this; - }.property('controller.category'), - itemClass: function () { - return this.get('isActive') ? 'active' : ''; - }.property('isActive') - }); - - var categories = [ - self.categoryObject.create({value: Em.I18n.t('common.all'), hostStatus: 'all', hostsCount: function () { - return this.get('controller.hosts.length'); - }.property('controller.hosts.length') }), - self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.inProgress'), hostStatus: 'inProgress'}), - self.categoryObject.create({value: Em.I18n.t('installer.step9.hosts.status.label.warning'), hostStatus: 'warning'}), - self.categoryObject.create({value: Em.I18n.t('common.success'), hostStatus: 'success'}), - self.categoryObject.create({value: Em.I18n.t('common.fail'), hostStatus: 'failed', last: true }) - ]; - - this.set('category', categories.get('firstObject')); - return categories; - }.property(), - - /** - * Registered as an handlebar action in step-9 template. Invoked whenever click event occurs on a category label - * @param event: {categoryObject} - */ - selectCategory: function (event) { - this.set('category', event.context); - }, - - /** - * Present clicked/selected {categoryObject} on the page - */ - category: false, - - /** * Observer function: Calls {hostStatusUpdates} function once with change in a host status from any registered hosts. */ hostStatusObserver: function () { - Ember.run.once(this, 'hostStatusUpdates'); + Ember.run.once(this, 'updateStatus'); }.observes('hosts.@each.status'), /** - * Updates the hosts mapping to the category selected and updates entire page status - */ - hostStatusUpdates: function () { - this.updateVisibleHosts(); - this.updateStatus(); - }, - - /** - * Observer function: Updates {visibleHosts Array} of this controller whenever category is changed - */ - updateVisibleHosts: function () { - var targetStatus = this.get('category.hostStatus'); - var isAnyHostDisplayed = false; - if (targetStatus === 'all') { - isAnyHostDisplayed = true; - this.get('hosts').setEach('isVisible', true); - } else { - this.get('hosts').forEach(function (_host) { - var isVisible = false; - var status = _host.get('status'); - if (targetStatus == 'inProgress') { - isVisible = (status == 'info' || status == 'pending' || status == 'in_progress'); - } else if (targetStatus === 'failed') { - isVisible = (status === 'failed' || status === 'heartbeat_lost'); - } else { - isVisible = (status == targetStatus); - } - isAnyHostDisplayed = (isAnyHostDisplayed || isVisible); - _host.set('isVisible', isVisible); - }, this) - } - this.set('isAnyHostDisplayed', isAnyHostDisplayed); - }.observes('category'), - - /** * A flag that gets set with installation failure. */ installFailed: false, http://git-wip-us.apache.org/repos/asf/ambari/blob/278a1899/ambari-web/app/styles/application.less ---------------------------------------------------------------------- diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less index 537aa46..b6a3d3f 100644 --- a/ambari-web/app/styles/application.less +++ b/ambari-web/app/styles/application.less @@ -456,14 +456,6 @@ h1 { margin-bottom: 0; } } - #confirm-hosts, #step6 { - .page-bar { - padding: 5px; - .selected-hosts-info { - margin: 0; - } - } - } #step4, #step5, #step6 { a.selected { color: #333; @@ -498,6 +490,9 @@ h1 { } } #deploy { + .pre-scrollable { + max-height: 750px; + } #overallProgress { } #host-filter { @@ -524,6 +519,7 @@ h1 { } } #deploy-status-by-host { + margin-bottom: 0; th.host { width: 30%; } @@ -540,7 +536,7 @@ h1 { } } .progress-percentage { - margin-left: 10px; + margin-left: 5px; width: 20% - 10px; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/278a1899/ambari-web/app/templates/wizard/step3.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/step3.hbs b/ambari-web/app/templates/wizard/step3.hbs index dffc01d..54908d0 100644 --- a/ambari-web/app/templates/wizard/step3.hbs +++ b/ambari-web/app/templates/wizard/step3.hbs @@ -30,7 +30,7 @@ {{#unless isRetryDisabled}} {{t installer.step3.retryFailed}} @@ -124,7 +124,7 @@
-
+ +
+ +
{{view.paginationInfo}}
{{view view.paginationFirst}} http://git-wip-us.apache.org/repos/asf/ambari/blob/278a1899/ambari-web/app/templates/wizard/step6.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/step6.hbs b/ambari-web/app/templates/wizard/step6.hbs index 109380f..7dea54f 100644 --- a/ambari-web/app/templates/wizard/step6.hbs +++ b/ambari-web/app/templates/wizard/step6.hbs @@ -68,6 +68,9 @@
+
+ +
{{view.paginationInfo}}
{{view view.paginationFirst}} http://git-wip-us.apache.org/repos/asf/ambari/blob/278a1899/ambari-web/app/templates/wizard/step9.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/step9.hbs b/ambari-web/app/templates/wizard/step9.hbs index b17ad66..6cd5d66 100644 --- a/ambari-web/app/templates/wizard/step9.hbs +++ b/ambari-web/app/templates/wizard/step9.hbs @@ -47,9 +47,9 @@
  • {{t common.show}}:
  • - {{#each category in controller.categories}} + {{#each category in view.categories}}
  • - + {{category.label}}
  • @@ -60,7 +60,7 @@
-
+
@@ -75,9 +75,9 @@ - {{#if isAnyHostDisplayed}} - {{#each host in hosts}} - {{#view App.HostStatusView objBinding="host" controllerBinding="controller" classBinding="host.isVisible::hidden"}} + {{#if view.pageContent}} + {{#each host in view.pageContent}} + {{#view App.HostStatusView objBinding="host" controllerBinding="controller"}} @@ -105,6 +105,20 @@
{{host.name}}
+
+
+
+ +
+
{{view.paginationInfo}}
+
+ {{view view.paginationFirst}} + {{view view.paginationLeft}} + {{view view.paginationRight}} + {{view view.paginationLast}} +
+
+