Pārlūkot izejas kodu

HUE-3228 [dashboard] Turn off auto refresh when in fixed time filter

Romain Rigaux 8 gadi atpakaļ
vecāks
revīzija
0b106be76d

+ 1 - 1
apps/impala/src/impala/dashboard_api.py

@@ -415,7 +415,7 @@ class SQLApi():
         props['from'] = "now() - interval %(coeff)s %(unit)s" % {'coeff': coeff, 'unit': unit.strip('S')}
         props['to'] = 'now()' # TODO +/- Tz of user
       elif collection['timeFilter']['type'] == 'fixed':
-        props['from'] = collection['timeFilter'].get('from', 'now() - 7 DAY')
+        props['from'] = collection['timeFilter'].get('from', 'now() - interval 7 DAY')
         props['to'] = collection['timeFilter'].get('to', 'now()')
 
       return "(`%(field)s` >= %(from)s AND `%(field)s` <= %(to)s)" %  props

+ 4 - 1
apps/search/src/search/static/search/js/search.ko.js

@@ -496,7 +496,10 @@ var Collection = function (vm, collection) {
     vm.search();
   });
   self.timeFilter.type.subscribe(function (val) {
-    if (val == 'fixed' && self.timeFilter.from().length == 0) {
+	if (val == 'fixed'){
+      self.autorefresh(false);
+	}
+	if (val == 'fixed' && self.timeFilter.from().length == 0) {
       $.ajax({
         type: "POST",
         url: "/search/get_range_facet",