Skip to content

Commit

Permalink
Fix agent bar (filter ignored) (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
adri9valle authored and Jesús Ángel committed Jun 21, 2019
1 parent 0fda1bc commit d915e57
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
keys="['id',{value:'name',size:2},'ip','status','group','os.name','os.version','version', {value: 'dateAdd', offset: true}, {value: 'lastKeepAlive', offset: true}]"
allow-click="true" rows-per-page="17"></wazuh-table>
</div>

<!-- Download CSV -->
<div layout="row" class="ruleset-csv-formater">
<span flex></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ define([
* Reload list of agents
*/
reloadList() {
this.scope.$broadcast('wazuhSearch', { term: '' })
this.scope.$broadcast('reloadSearchFilterBar', {})
}
}
app.controller('agentsCtrl', Agents)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,26 @@ define([
* @param {String} query
* @param {String} search
*/
const query = async (query, search) =>
data.queryData(
query,
search,
instance,
$tableFilterService,
$scope,
fetch,
$notificationService
)
const query = async (query, search) => {
try{
await data.queryData(
query,
search,
instance,
$tableFilterService,
$scope,
fetch,
$notificationService
)
}catch(error){
$scope.error = `Error while querying API.`
$notificationService.showErrorToast(
`Error while querying API. ${error.message || error}`
)
}
$scope.wazuhTableLoading = false
$scope.$applyAsync()
}

/**
* Filters API results
Expand Down Expand Up @@ -406,9 +416,10 @@ define([
)
)

$scope.$on('wazuhQuery', (event, parameters) =>
$scope.$on('wazuhQuery', (event, parameters) => {
$scope.wazuhTableLoading = true
listeners.wazuhQuery(parameters, query)
)
})

$scope.$on('wazuhPlayRealTime', () => {
realTime = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,11 @@ define(['../module'], function(app) {
}
})
$('#wz-search-filter-bar-input').attr('autocomplete', 'off')

$scope.$on('reloadSearchFilterBar', () => {
buildQuery($scope.groupedTagList)
})

load()
},
templateUrl:
Expand Down

0 comments on commit d915e57

Please sign in to comment.