Fix OS platform selector

This commit is contained in:
Jesús Ángel González 2018-06-08 13:18:11 +02:00 committed by Javier Castro
parent f7b0723b8d
commit 2c3e62413c
3 changed files with 7 additions and 7 deletions

View File

@ -51,7 +51,6 @@ app.controller('agentsPreviewController', function ($scope, $rootScope, $routePa
}
$scope.applyFilters = filter => {
$scope.agents.filters = [];
if(filter.includes('Unknown')){
$scope.agents.addFilter('status','Never connected');

View File

@ -132,7 +132,7 @@ app.factory('DataHandler', function ($q, apiReq,errorHandler) {
addFilter (filterName, value) {
this.removeFilter(filterName, false);
this.filters.push({
name: filterName,
value: value
@ -144,7 +144,8 @@ app.factory('DataHandler', function ($q, apiReq,errorHandler) {
// Only used by agents preview, don't use for any thing more //
///////////////////////////////////////////////////////////////
addMultipleFilters (arrayOfFilters) {
this.filters = [...arrayOfFilters];
for(const filter of arrayOfFilters) this.removeFilter(filter.name,false)
this.filters.push(...arrayOfFilters);
return this.search();
}

View File

@ -51,7 +51,7 @@
<wz-search-bar flex="60" class="wz-margin-top-17 wz-padding-right-17" height="'height-40'" data="agents" term="searchTerm" placetext="'Filter agents...'"></wz-search-bar>
<div flex="20" layout="column" class="height-40 wz-margin-top-17 wz-margin-right-15 wz-select-input">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox" ng-model="status" ng-change="agents.addFilter('status', status)" aria-label="Filter by status">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox1" ng-model="status" ng-change="agents.addFilter('status', status)" aria-label="Filter by status">
<option value="all">All states</option>
<option value="active">Active</option>
<option value="disconnected">Disconnected</option>
@ -60,7 +60,7 @@
</div>
<div flex="20" ng-show="isClusterEnabled" layout="column" class="height-40 wz-margin-top-17 wz-margin-right-15 wz-select-input">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox" ng-model="node_name" ng-change="applyFilters('node-' + node_name)" aria-label="Filter by node">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox2" ng-model="node_name" ng-change="applyFilters('node-' + node_name)" aria-label="Filter by node">
<option value="all">All nodes</option>
<option ng-repeat='node in nodes' value="{{node}}">
{{node}}
@ -69,7 +69,7 @@
</div>
<div flex="20" layout="column" class="height-40 wz-margin-top-17 wz-select-input wz-margin-right-15">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox" ng-model="osPlatform" ng-change="applyFilters(osPlatform)" aria-label="Filter by operative system">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox3" ng-model="osPlatform" ng-change="applyFilters(osPlatform)" aria-label="Filter by operative system">
<option value="all">All OS platforms</option>
<option ng-repeat='platform in osPlatforms' value="{{platform.platform}} - {{platform.version}}">
{{platform.name}} {{platform.version}}
@ -77,7 +77,7 @@
</select>
</div>
<div flex="20" layout="column" class="height-40 wz-margin-top-17 wz-select-input">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox" ng-model="version" ng-change="applyFilters('version-' + version)" aria-label="Filter by Wazuh version">
<select flex class="kuiSelect wz-border-none cursor-pointer" id="eventBox4" ng-model="version" ng-change="applyFilters('version-' + version)" aria-label="Filter by Wazuh version">
<option value="all">All versions</option>
<option ng-repeat='version in versions' value="{{version}}">
{{version}}