ambari git commit: AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb)
Repository: ambari Updated Branches: refs/heads/trunk e6dcc0920 -> 9c07b8b54 AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9c07b8b5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9c07b8b5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9c07b8b5 Branch: refs/heads/trunk Commit: 9c07b8b54c52d332d3f0268e9cbf920e959af208 Parents: e6dcc09 Author: Dipayan BhowmickAuthored: Thu Feb 9 15:54:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 9 15:54:38 2017 +0530 -- .../resources/ui/app/components/jobs-browser.js | 39 ++-- .../src/main/resources/ui/app/styles/app.scss | 2 +- .../app/templates/components/jobs-browser.hbs | 17 +++-- 3 files changed, 49 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/9c07b8b5/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index b0a82b0..7179d45 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -22,15 +22,33 @@ export default Ember.Component.extend({ startTime: null, endTime: null, maxEndTime: null, - statusCounts: Ember.computed('jobs', function() { -return this.get('jobs').reduce((acc, item, index) => { + statusFilter: null, + titleFilter: null, + + titleFilteredJobs: Ember.computed('jobs', 'titleFilter', function() { +if (!Ember.isEmpty(this.get('titleFilter'))) { + return (this.get('jobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); +} else { + return this.get('jobs'); +} + }), + + filteredJobs: Ember.computed('titleFilteredJobs', 'statusFilter', function () { +if (this.get('statusFilter')) { + return this.get('titleFilteredJobs').filter((entry) => entry.get('status').toLowerCase() === this.get('statusFilter')); +} else { + return this.get('titleFilteredJobs'); +} + }), + + statusCounts: Ember.computed('titleFilteredJobs', function () { +return this.get('titleFilteredJobs').reduce((acc, item, index) => { let status = item.get('status').toLowerCase(); - if(Ember.isEmpty(acc[status])) { + if (Ember.isEmpty(acc[status])) { acc[status] = 1; } else { acc[status] = acc[status] + 1; } - return acc; }, {}); }), @@ -39,6 +57,19 @@ export default Ember.Component.extend({ actions: { setDateRange(startDate, endDate) { this.sendAction('filterChanged', startDate, endDate); +}, + +selectJobForStatus(status) { + let s = status.toLowerCase(); + if (s === 'all') { +this.set('statusFilter'); + } else { +this.set('statusFilter', s); + } +}, + +clearTitleFilter() { + this.set('titleFilter'); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/9c07b8b5/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss index 4f73ef8..0dae396 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss @@ -787,7 +787,7 @@ pre { border-top: 1px solid darken($body-bg, 10%); border-bottom: 1px solid darken($body-bg, 10%); .strip { -margin-top: 25px; +margin-top: 20px; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/9c07b8b5/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs index abb4a97..014691e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs @@ -18,15 +18,24 @@ - + - + + {{titleFilteredJobs.length}} All {{#each-in statusCounts as |status count|}} -{{count}} {{status}} +
ambari git commit: AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb)
Repository: ambari Updated Branches: refs/heads/branch-2.5 38cf7a63d -> a512b3e67 AMBARI-19916. HiveView2.0: No option to search for jobs in the jobs tab. (dipayanb) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a512b3e6 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a512b3e6 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a512b3e6 Branch: refs/heads/branch-2.5 Commit: a512b3e67f6023166471dd6b05e9fb2e5c497454 Parents: 38cf7a6 Author: Dipayan BhowmickAuthored: Thu Feb 9 15:54:11 2017 +0530 Committer: Dipayan Bhowmick Committed: Thu Feb 9 15:54:11 2017 +0530 -- .../resources/ui/app/components/jobs-browser.js | 39 ++-- .../src/main/resources/ui/app/styles/app.scss | 2 +- .../app/templates/components/jobs-browser.hbs | 17 +++-- 3 files changed, 49 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/ambari/blob/a512b3e6/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js index b0a82b0..7179d45 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js +++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js @@ -22,15 +22,33 @@ export default Ember.Component.extend({ startTime: null, endTime: null, maxEndTime: null, - statusCounts: Ember.computed('jobs', function() { -return this.get('jobs').reduce((acc, item, index) => { + statusFilter: null, + titleFilter: null, + + titleFilteredJobs: Ember.computed('jobs', 'titleFilter', function() { +if (!Ember.isEmpty(this.get('titleFilter'))) { + return (this.get('jobs').filter((entry) => entry.get('title').toLowerCase().indexOf(this.get('titleFilter').toLowerCase()) >= 0)); +} else { + return this.get('jobs'); +} + }), + + filteredJobs: Ember.computed('titleFilteredJobs', 'statusFilter', function () { +if (this.get('statusFilter')) { + return this.get('titleFilteredJobs').filter((entry) => entry.get('status').toLowerCase() === this.get('statusFilter')); +} else { + return this.get('titleFilteredJobs'); +} + }), + + statusCounts: Ember.computed('titleFilteredJobs', function () { +return this.get('titleFilteredJobs').reduce((acc, item, index) => { let status = item.get('status').toLowerCase(); - if(Ember.isEmpty(acc[status])) { + if (Ember.isEmpty(acc[status])) { acc[status] = 1; } else { acc[status] = acc[status] + 1; } - return acc; }, {}); }), @@ -39,6 +57,19 @@ export default Ember.Component.extend({ actions: { setDateRange(startDate, endDate) { this.sendAction('filterChanged', startDate, endDate); +}, + +selectJobForStatus(status) { + let s = status.toLowerCase(); + if (s === 'all') { +this.set('statusFilter'); + } else { +this.set('statusFilter', s); + } +}, + +clearTitleFilter() { + this.set('titleFilter'); } } }); http://git-wip-us.apache.org/repos/asf/ambari/blob/a512b3e6/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss index 4f73ef8..0dae396 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss +++ b/contrib/views/hive20/src/main/resources/ui/app/styles/app.scss @@ -787,7 +787,7 @@ pre { border-top: 1px solid darken($body-bg, 10%); border-bottom: 1px solid darken($body-bg, 10%); .strip { -margin-top: 25px; +margin-top: 20px; } } http://git-wip-us.apache.org/repos/asf/ambari/blob/a512b3e6/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs -- diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs index abb4a97..014691e 100644 --- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs +++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs @@ -18,15 +18,24 @@ - + - + + {{titleFilteredJobs.length}} All {{#each-in statusCounts as |status count|}} -{{count}} {{status}} +