diff --git a/public/controllers/management/logs.js b/public/controllers/management/logs.js index c782335bb..a3916f4a8 100644 --- a/public/controllers/management/logs.js +++ b/public/controllers/management/logs.js @@ -11,7 +11,7 @@ */ import { uiModules } from 'ui/modules'; import * as FileSaver from '../../services/file-saver'; -import $ from 'jquery'; + const app = uiModules.get('app/wazuh', []); class Logs { @@ -25,7 +25,6 @@ class Logs { this.$scope.nodeList = false; this.$scope.type_log = 'all'; this.$scope.category = 'all'; - this.$scope.custom_search = ''; } /** @@ -45,8 +44,8 @@ class Logs { * Event handler for the search bar. * @param {string} term Term(s) to be searched */ - search() { - this.$scope.$broadcast('wazuhSearch', { term: this.$scope.custom_search }); + search(term) { + this.$scope.$broadcast('wazuhSearch', { term }); } /** @@ -99,9 +98,7 @@ class Logs { } async changeNode(node) { - try { - this.$scope.custom_search = ''; - $('#logsSearchBar').val('') + try { this.$scope.type_log = 'all'; this.$scope.category = 'all'; this.$scope.selectedNode = node; @@ -109,14 +106,14 @@ class Logs { const summary = await this.apiReq.request( 'GET', `/cluster/${node}/logs/summary`, - {} + {} ) const daemons = summary.data.data; this.$scope.daemons = Object.keys(daemons).map(item => ({ title: item })); + if (!this.$scope.$$phase) this.$scope.$digest(); } catch(error) { this.errorHandler.handle(error, 'Logs'); } - if (!this.$scope.$$phase) this.$scope.$digest(); } /** diff --git a/public/templates/management/logs.html b/public/templates/management/logs.html index 1d5be6794..8d79c4fd2 100644 --- a/public/templates/management/logs.html +++ b/public/templates/management/logs.html @@ -55,9 +55,9 @@
- -