Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 946b3f52a -> e3b945f65


AMBARI-17110. Date range on comparison tab are different from date range of 
selected logs for comparison in LogSearch portal (Dharmesh Makwana via oleewere)


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

Branch: refs/heads/branch-2.4
Commit: e3b945f657ad7be0d6e44a6e8c8350ed622b9e5c
Parents: 946b3f5
Author: oleewere <[email protected]>
Authored: Mon Jun 13 11:53:29 2016 +0200
Committer: oleewere <[email protected]>
Committed: Mon Jun 13 13:12:16 2016 +0200

----------------------------------------------------------------------
 .../scripts/views/dashboard/MainLayoutView.js   | 27 +++++++++++++-------
 .../src/main/webapp/styles/style.css            |  1 +
 2 files changed, 19 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b945f6/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
index 5b69650..79bd4d6 100644
--- 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
+++ 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
@@ -497,24 +497,33 @@ define(['require',
                                                this.$('.compare .panel-body 
.hostCompList').html('<span class="hasNode" data-id="'+clickedId+'"><i class=" 
closeComponent fa fa-times-circle"></i>'+host.split(".")[0]+' <i class="fa 
fa-angle-double-right"></i><br> '+component+'</span>');
                                        }
                                }
-                               
-                       
-                                       
                        }
                },
                onCompareButtonClick:function(){
-                       var dateRangeLabel = 'Last 1 Hour';
-                       var time = 
this.dateUtil.getRelativeDateFromString(dateRangeLabel);
                        if(this.componetList.length == 1){
                                Utils.alertPopup({
                         msg: "Minimum two components are required for 
comparison. Please select one more component and try again."
                 });
                        }else{
+                                       var dateRangeLabel ='Last 1 Hour';
+                                       var dateObj = 
this.dateUtil.getRelativeDateFromString(dateRangeLabel);
+
+                                       if (this.RHierarchyTab.currentView && 
this.RHierarchyTab.currentView.defaultParams) {
+                                           var dateParams = 
this.RHierarchyTab.currentView.defaultParams;
+                                           if (!_.isUndefined(dateParams) && 
_.isObject(dateParams)) {
+                                               dateObj = {
+                                                   from: dateParams.from,
+                                                   to: dateParams.to,
+                                                   dateRangeLabel: 
dateParams.dateRangeLabel
+                                               };
+                                           }
+                                       }
+
                                        
this.globalVent.trigger("render:comparison:tab",{
-                                       
params:_.extend({},this.searchParams,{from:time[0].toJSON(),to:time[1].toJSON(),dateRangeLabel
 : dateRangeLabel}),
-                                       componetList:this.componetList,
-                                       globalVent : this.globalVent
-                               });
+                                               params: dateObj,
+                                               componetList:this.componetList,
+                                               globalVent : this.globalVent
+                                       });
                        }
                        this.togglePanelPosition(false,false)
                },

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b945f6/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/styles/style.css
----------------------------------------------------------------------
diff --git 
a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/styles/style.css 
b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/styles/style.css
index 4837e5f..6409d18 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/styles/style.css
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/styles/style.css
@@ -1125,6 +1125,7 @@ body {
 }
 .logTime strong {
        margin-left:5px;
+       white-space: normal;
 }
 .hostNodes .col-md-3:nth-child(4n+5) {;
        clear: both;

Reply via email to