ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [04/10] git commit: AMBARI-7654 Slider View: Apps table start/end time columns not filtering properly and showing GMT. (ababiichuk)
Date Mon, 06 Oct 2014 20:27:35 GMT
AMBARI-7654 Slider View: Apps table start/end time columns not filtering properly and showing
GMT. (ababiichuk)


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

Branch: refs/heads/branch-alerts-dev
Commit: 94d76a41458fc53a9ff8abb35c636c810e8b9010
Parents: 1b06b93
Author: aBabiichuk <ababiichuk@cybervisiontech.com>
Authored: Mon Oct 6 20:49:02 2014 +0300
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
Committed: Mon Oct 6 20:54:27 2014 +0300

----------------------------------------------------------------------
 .../src/main/resources/ui/app/models/slider_app.js  | 16 ++++++++++++++++
 .../main/resources/ui/app/templates/slider_apps.hbs |  4 ++--
 .../resources/ui/app/views/common/filter_view.js    |  2 +-
 .../main/resources/ui/app/views/slider_apps_view.js | 12 +-----------
 4 files changed, 20 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/94d76a41/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 9534d98..e59f931 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
@@ -49,11 +49,27 @@ App.SliderApp = DS.Model.extend({
   started: DS.attr('number'),
 
   /**
+   * @type {String}
+   */
+
+  startedToLocalTime: function () {
+    return new Date(this.get('started')).toString().replace("(FLE Daylight Time)","");
+  }.property('started'),
+
+  /**
    * @type {number}
    */
   ended: DS.attr('number'),
 
   /**
+   * @type {String}
+   */
+
+  endedToLocalTime: function () {
+    return new Date(this.get('ended')).toString().replace("(FLE Daylight Time)","");
+  }.property('ended'),
+
+  /**
    * @type {App.SliderAppType}
    */
   appType: DS.belongsTo('sliderAppType'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d76a41/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 626dfb0..129db30 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
@@ -54,9 +54,9 @@
 
           <td>{{slider.user}}</td>
 
-          <td>{{slider.started}}</td>
+          <td>{{slider.startedToLocalTime}}</td>
 
-          <td>{{slider.ended}}</td>
+          <td>{{slider.endedToLocalTime}}</td>
 
         {{/view}}
       {{/each}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d76a41/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js b/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
index 3390a44..2d357e3 100644
--- a/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
+++ b/contrib/views/slider/src/main/resources/ui/app/views/common/filter_view.js
@@ -291,7 +291,7 @@ module.exports = {
       case 'date':
         return function (rowValue, rangeExp) {
           var match = false;
-          var timePassed = new Date().getTime() - rowValue;
+          var timePassed = new Date().getTime() - new Date(rowValue).getTime();
           switch (rangeExp) {
             case 'Past 1 hour':
               match = timePassed <= 3600000;

http://git-wip-us.apache.org/repos/asf/ambari/blob/94d76a41/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 fa8ae98..307dad4 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
@@ -141,23 +141,13 @@ 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'
-  }),
-
-  startFilterView: filters.createSelectView({
-    column: 4,
     defaultValue: "All Dates",
     fieldType: 'filter-input-width',
     content: ['All Dates', 'Past 1 hour',  'Past 1 Day', 'Past 2 Days', 'Past 7 Days', 'Past
14 Days', 'Past 30 Days'],
     onChangeValue: function(){
       this.get('parentView').updateFilter(this.get('column'), this.get('value'), 'date',
this.get('defaultValue'));
     },
-    type: 'date'
+    type: 'number'
   }),
 
   /**


Mime
View raw message