瀏覽代碼

AMBARI-13839 Config History: Filter applied after refresh. (atkach)

Andrii Tkach 9 年之前
父節點
當前提交
e384c7d8bc

+ 6 - 0
ambari-web/app/controllers/main/dashboard/config_history_controller.js

@@ -32,6 +32,12 @@ App.MainConfigHistoryController = Em.ArrayController.extend(App.TableServerMixin
     return App.apiPrefix + '/clusters/' + App.get('clusterName') + '/configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,hosts,service_config_version_note,is_cluster_compatible,stack_id&minimal_response=true';
     return App.apiPrefix + '/clusters/' + App.get('clusterName') + '/configurations/service_config_versions?<parameters>fields=service_config_version,user,group_id,group_name,is_current,createtime,service_name,hosts,service_config_version_note,is_cluster_compatible,stack_id&minimal_response=true';
   }.property('App.clusterName'),
   }.property('App.clusterName'),
 
 
+  /**
+   * @type {boolean}
+   * @default false
+   */
+  showFilterConditionsFirstLoad: false,
+
   /**
   /**
    * associations between host property and column index
    * associations between host property and column index
    * @type {Array}
    * @type {Array}

+ 10 - 0
ambari-web/app/views/main/dashboard/config_history_view.js

@@ -70,6 +70,16 @@ App.MainConfigHistoryView = App.TableView.extend(App.TableServerViewMixin, {
     clearTimeout(this.get('controller.timeoutRef'));
     clearTimeout(this.get('controller.timeoutRef'));
   },
   },
 
 
+  /**
+   * clear filters on initial loading
+   */
+  willInsertElement: function () {
+    if (!this.get('controller.showFilterConditionsFirstLoad')) {
+      this.clearFilterConditionsFromLocalStorage();
+    }
+    this._super();
+  },
+
   updateFilter: function (iColumn, value, type) {
   updateFilter: function (iColumn, value, type) {
     if (!this.get('isInitialRendering')) {
     if (!this.get('isInitialRendering')) {
       this._super(iColumn, value, type);
       this._super(iColumn, value, type);