Repository: ambari Updated Branches: refs/heads/trunk a1729a3e9 -> a9484c6e6
AMBARI-14062. $.timeago for config versions should use not converted with timezone timestamps (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a9484c6e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a9484c6e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a9484c6e Branch: refs/heads/trunk Commit: a9484c6e67b1eacc064feb2476c305276e3f03c4 Parents: a1729a3 Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Wed Nov 25 14:16:15 2015 +0200 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Wed Nov 25 14:19:58 2015 +0200 ---------------------------------------------------------------------- ambari-web/app/mappers/hosts_mapper.js | 2 ++ ambari-web/app/models/configs/service_config_version.js | 5 +++-- ambari-web/app/models/host.js | 1 + ambari-web/app/views/main/host/summary.js | 4 ++-- 4 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a9484c6e/ambari-web/app/mappers/hosts_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/hosts_mapper.js b/ambari-web/app/mappers/hosts_mapper.js index 3fcf295..7691f2b 100644 --- a/ambari-web/app/mappers/hosts_mapper.js +++ b/ambari-web/app/mappers/hosts_mapper.js @@ -50,6 +50,7 @@ App.hostsMapper = App.QuickDataMapper.create({ mem_total: 'metrics.memory.mem_total', mem_free: 'metrics.memory.mem_free', last_heart_beat_time: "Hosts.last_heartbeat_time", + raw_last_heart_beat_time: "Hosts.last_heartbeat_time", os_arch: 'Hosts.os_arch', os_type: 'Hosts.os_type', ip: 'Hosts.ip', @@ -175,6 +176,7 @@ App.hostsMapper = App.QuickDataMapper.create({ } var parsedItem = this.parseIt(item, this.config); parsedItem.is_requested = true; + parsedItem.last_heart_beat_time = App.dateTimeWithTimeZone(parsedItem.last_heart_beat_time); parsedItem.selected = selectedHosts.contains(parsedItem.host_name); parsedItem.not_started_components = notStartedComponents; parsedItem.components_in_passive_state = componentsInPassiveState; http://git-wip-us.apache.org/repos/asf/ambari/blob/a9484c6e/ambari-web/app/models/configs/service_config_version.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/configs/service_config_version.js b/ambari-web/app/models/configs/service_config_version.js index 02aeb92..ed7e9b3 100644 --- a/ambari-web/app/models/configs/service_config_version.js +++ b/ambari-web/app/models/configs/service_config_version.js @@ -30,6 +30,7 @@ App.ServiceConfigVersion = DS.Model.extend({ groupId: DS.attr('number'), version: DS.attr('number'), createTime: DS.attr('number'), + rawCreateTime: DS.attr('number'), author: DS.attr('string'), notes: DS.attr('string'), service: DS.belongsTo('App.Service'), @@ -74,8 +75,8 @@ App.ServiceConfigVersion = DS.Model.extend({ return dateUtil.dateFormat(this.get('createTime')); }.property('createTime'), timeSinceCreated: function () { - return $.timeago(this.get('createTime')); - }.property('createTime'), + return $.timeago(this.get('rawCreateTime')); + }.property('rawCreateTime'), /** * determine whether ServiceConfigVersion is requested from server */ http://git-wip-us.apache.org/repos/asf/ambari/blob/a9484c6e/ambari-web/app/models/host.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/host.js b/ambari-web/app/models/host.js index 1c6da8d..c9be63d 100644 --- a/ambari-web/app/models/host.js +++ b/ambari-web/app/models/host.js @@ -38,6 +38,7 @@ App.Host = DS.Model.extend({ rack: DS.attr('string'), healthStatus: DS.attr('string'), lastHeartBeatTime: DS.attr('number'), + rawLastHeartBeatTime: DS.attr('number'), osType: DS.attr("string"), diskInfo: DS.attr('object'), loadOne:DS.attr('number'), http://git-wip-us.apache.org/repos/asf/ambari/blob/a9484c6e/ambari-web/app/views/main/host/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js index dd5adab..a8d1bed 100644 --- a/ambari-web/app/views/main/host/summary.js +++ b/ambari-web/app/views/main/host/summary.js @@ -293,9 +293,9 @@ App.MainHostSummaryView = Em.View.extend(App.TimeRangeMixin, { * @type {String} */ timeSinceHeartBeat: function () { - var d = this.get('content.lastHeartBeatTime'); + var d = this.get('content.rawLastHeartBeatTime'); return d ? $.timeago(d) : ''; - }.property('content.lastHeartBeatTime'), + }.property('content.rawLastHeartBeatTime'), /** * Get clients with custom commands