Merge pull request #1049 from wazuh/issue-964

Reset timefilter auto-refresh feature when not in visualization tabs
This commit is contained in:
Jesús Ángel 2018-11-28 13:26:44 +01:00 committed by GitHub
commit 89f7099acf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -69,6 +69,7 @@ export class AgentsController {
}
$onInit() {
timefilter.setRefreshInterval({pause:true,value:0})
this.$scope.TabDescription = TabDescription;
this.$rootScope.reportStatus = false;
@ -321,12 +322,7 @@ export class AgentsController {
// Switch tab
async switchTab(tab, force = false) {
if (this.ignoredTabs.includes(tab)) {
const timeFilterRefreshStatus = timefilter.getRefreshInterval();
const toggle =
timeFilterRefreshStatus &&
timeFilterRefreshStatus.value &&
!timeFilterRefreshStatus.pause;
if (toggle) timefilter.toggleRefresh();
timefilter.setRefreshInterval({pause:true,value:0})
}
try {

View File

@ -10,6 +10,7 @@
* Find more information about this on the LICENSE file.
*/
import { FilterHandler } from '../../utils/filter-handler';
import { timefilter } from 'ui/timefilter';
export function ClusterController(
$scope,
@ -27,6 +28,7 @@ export function ClusterController(
appState,
genericReq
) {
timefilter.setRefreshInterval({pause:true,value:0})
$scope.search = term => {
$scope.$broadcast('wazuhSearch', { term });
};

View File

@ -25,6 +25,7 @@ import {
} from '../../utils/overview-metrics';
import { queryConfig } from '../../services/query-config';
import { timefilter } from 'ui/timefilter';
export class OverviewController {
constructor(
@ -54,6 +55,7 @@ export class OverviewController {
}
$onInit() {
timefilter.setRefreshInterval({pause:true,value:0})
this.wodlesConfiguration = false;
this.TabDescription = TabDescription;
this.$rootScope.reportStatus = false;
@ -211,6 +213,10 @@ export class OverviewController {
// Switch tab
async switchTab(newTab, force = false) {
try {
if(newTab === 'welcome') {
timefilter.setRefreshInterval({pause:true,value:0})
}
if (newTab !== 'welcome') {
await this.fetchWodles();
}