Repository: ambari Updated Branches: refs/heads/branch-1.6.0.slider 39e428ab6 -> 0f3ab01a8
AMBARI-5975. Slider apps table not sorting/filtering properly along with other small fixes (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/0f3ab01a Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0f3ab01a Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0f3ab01a Branch: refs/heads/branch-1.6.0.slider Commit: 0f3ab01a85bb20ca2c844ad1ad4777074fef15ad Parents: 39e428a Author: Alex Antonenko <[email protected]> Authored: Fri May 30 22:04:05 2014 +0300 Committer: Alex Antonenko <[email protected]> Committed: Fri May 30 22:04:53 2014 +0300 ---------------------------------------------------------------------- .../ui/app/mappers/slider_apps_mapper.js | 4 ++-- .../main/resources/ui/app/models/slider_app.js | 20 +++++++++++++++++++- .../resources/ui/app/templates/slider_apps.hbs | 6 +++--- .../resources/ui/app/views/slider_apps_view.js | 10 ---------- 4 files changed, 24 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/0f3ab01a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js index 765ef8c..e751fd6 100644 --- a/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js +++ b/contrib/views/slider/src/main/resources/ui/app/mappers/slider_apps_mapper.js @@ -171,8 +171,8 @@ App.SliderAppsMapper = App.Mapper.createWithMixins(App.RunPeriodically, { name: app.name, status: app.state, user: app.user, - started: app.startTime ? (new Date(app.startTime).toUTCString()) : "-", - ended: app.endTime ? (new Date(app.endTime).toUTCString()) : "-", + started: app.startTime ? app.startTime : 0, + ended: app.endTime ? app.endTime : 0, appType: app.type.toUpperCase(), diagnostics: app.diagnostics ? app.diagnostics : "-", components: componentsId, http://git-wip-us.apache.org/repos/asf/ambari/blob/0f3ab01a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js index 6d6820f..3304c93 100644 --- a/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js +++ b/contrib/views/slider/src/main/resources/ui/app/models/slider_app.js @@ -95,7 +95,25 @@ App.SliderApp = DS.Model.extend({ jmx: DS.attr('object'), supportedMetricNames: DS.attr('string'), - + + startTimeDisplay : function() { + var startTime = this.get('started'); + if (startTime > 0) { + return (new Date(startTime).toUTCString()); + } else { + return "-"; + } + }.property('started'), + + endTimeDisplay : function() { + var endTime = this.get('ended'); + if (endTime > 0) { + return (new Date(endTime).toUTCString()); + } else { + return "-"; + } + }.property('ended'), + /** * Global configs * @type {{key: string, value: *}[]} http://git-wip-us.apache.org/repos/asf/ambari/blob/0f3ab01a/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs b/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs index 31ebd2d..f20ef6e 100644 --- a/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs +++ b/contrib/views/slider/src/main/resources/ui/app/templates/slider_apps.hbs @@ -62,7 +62,7 @@ <th>{{view view.statusFilterView}}</th> <th>{{view view.typeFilterView}}</th> <th>{{view view.userFilterView}}</th> - <th>{{view view.startFilterView}}</th> + <th></th> <th></th> </tr> </thead> @@ -83,9 +83,9 @@ <td>{{slider.user}}</td> - <td>{{slider.started}}</td> + <td>{{slider.startTimeDisplay}}</td> - <td>{{slider.ended}}</td> + <td>{{slider.endTimeDisplay}}</td> {{/view}} {{/each}} http://git-wip-us.apache.org/repos/asf/ambari/blob/0f3ab01a/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js ---------------------------------------------------------------------- diff --git a/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js b/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js index 3b50950..8c05306 100644 --- a/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js +++ b/contrib/views/slider/src/main/resources/ui/app/views/slider_apps_view.js @@ -127,16 +127,6 @@ App.SliderAppsView = App.TableView.extend({ } }), - startFilterView: filters.createSelectView({ - column: 4, - fieldType: 'filter-input-width', - content: ['', 'Past 1 hour', 'Past 1 Day', 'Past 2 Days', 'Past 7 Days', 'Past 14 Days', 'Past 30 Days', 'Custom'], - onChangeValue: function(){ - this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'date'); - }, - type: 'number' - }), - /** * associations between host property and column index * @type {Array}
