Repository: tez Updated Branches: refs/heads/branch-0.7 a542ad3e1 -> 1e03be2cf
TEZ-2513. Tez UI: Allow filtering by DAG ID on All dags table. (cherry picked from commit 0588c144f6e7c6f53b7fd0954bd0e25dbca7493b) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/1e03be2c Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/1e03be2c Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/1e03be2c Branch: refs/heads/branch-0.7 Commit: 1e03be2cffaf01031937c10a1fc82c64d25179e3 Parents: a542ad3 Author: Sreenath Somarajapuram <somarajapu...@gmail.com> Authored: Wed Jun 10 18:51:42 2015 +0530 Committer: Sreenath Somarajapuram <somarajapu...@gmail.com> Committed: Wed Jun 10 18:55:30 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../app/scripts/controllers/dags_controller.js | 26 ++++++++++++++++++-- tez-ui/src/main/webapp/app/templates/dags.hbs | 10 ++++++++ 3 files changed, 35 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/1e03be2c/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 452b4a6..d8bc5fe 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Release 0.7.1: Unreleased INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-2513. Tez UI: Allow filtering by DAG ID on All dags table. TEZ-2541. DAGClientImpl enable TimelineClient check is wrong. TEZ-2539. Tez UI: Pages are not updating in IE. TEZ-2535. Tez UI: Failed task attempts link in vertex details page is broken. http://git-wip-us.apache.org/repos/asf/tez/blob/1e03be2c/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js index 2cc092c..9746906 100644 --- a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js +++ b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js @@ -31,6 +31,7 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C status_filter: 'status', user_filter: 'user', appId_filter: 'appid', + id_filter: 'id', dagName_filter: 'dag_name' }, @@ -39,6 +40,7 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C status_filter: null, user_filter: null, appId_filter: null, + id_filter: null, dagName_filter: null, boundFilterValues: Em.Object.create({ @@ -56,9 +58,10 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C status: this.get('status_filter'), user: this.get('user_filter'), appId: this.get('appId_filter'), + id: this.get('id_filter'), dagName: this.get('dagName_filter') })); - }.observes('status_filter', 'user_filter', 'appId_filter', 'dagName_filter'), + }.observes('status_filter', 'user_filter', 'appId_filter', 'dagName_filter', 'id_filter'), _filterVisiblilityObserver: function () { var visibleFilters = Em.Object.create(); @@ -92,6 +95,7 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C var that = this, store = this.get('store'), childEntityType = this.get('childEntityType'), + finder, record; var defaultErrMsg = 'Error while loading dag info.'; @@ -99,7 +103,23 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C store.unloadAll(childEntityType); store.unloadAll('dagProgress'); - store.findQuery(childEntityType, this.getFilterProperties()).then(function(entities){ + if(this.id_filter) { + finder = store.find(childEntityType, this.id_filter).then(function (entity) { + return ( + (that.dagName_filter && entity.get('name') != that.dagName_filter) || + (that.appId_filter && entity.get('applicationId') != that.appId_filter) || + (that.user_filter && entity.get('user') != that.user_filter) || + (that.status_filter && entity.get('status') != that.status_filter) + ) ? [] : [entity]; + }).catch(function () { + return []; + }); + } + else { + finder = store.findQuery(childEntityType, this.getFilterProperties()); + } + + finder.then(function(entities){ that.set('entities', entities); that.set('loading', false); @@ -160,6 +180,7 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C status_filter: filterValues.get('status') || null, user_filter: filterValues.get('user') || null, appId_filter: filterValues.get('appId') || null, + id_filter: filterValues.get('id') || null, dagName_filter: filterValues.get('dagName') || null, }); this.loadData(); @@ -208,6 +229,7 @@ App.DagsController = Em.ObjectController.extend(App.PaginatedContentMixin, App.C { id: 'id', headerCellName: 'Id', + enableFilter: true, contentPath: 'id' }, { http://git-wip-us.apache.org/repos/asf/tez/blob/1e03be2c/tez-ui/src/main/webapp/app/templates/dags.hbs ---------------------------------------------------------------------- diff --git a/tez-ui/src/main/webapp/app/templates/dags.hbs b/tez-ui/src/main/webapp/app/templates/dags.hbs index 0f272c5..350a688 100644 --- a/tez-ui/src/main/webapp/app/templates/dags.hbs +++ b/tez-ui/src/main/webapp/app/templates/dags.hbs @@ -39,6 +39,16 @@ }} </div> {{/if}} + {{#if visibleFilters.id}} + <div class='filter-elements'> + <div>Id</div> + {{input + action="filterUpdated" + value=boundFilterValues.id + placeholder="Search..." + }} + </div> + {{/if}} {{#if visibleFilters.user}} <div class='filter-elements'> <div>Submitter</div>