Showing query instead of JSON in Discover search bar

This commit is contained in:
malbarral 2017-10-10 13:32:37 +02:00
parent 010a66d846
commit 269d8fd044
2 changed files with 5 additions and 4 deletions

View File

@ -97,7 +97,7 @@ var app = require('ui/modules').get('app/wazuh', [])
require('ui/modules').get('app/wazuh', []).controller('discoverW', function($scope, config, courier, $route, $window, Notifier,
AppState, timefilter, Promise, Private, kbnUrl, $timeout, $location, savedSearches, appState, $rootScope, getAppState) {
const FieldList = Private(IndexPatternsFieldListProvider);
const FieldList = Private(IndexPatternsFieldListProvider);
$scope.cluster_info = appState.getClusterInfo();
$scope.cluster_filter = "cluster.name: " + $scope.cluster_info.cluster;
@ -113,6 +113,7 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
$scope.global_filter = $scope.disFilter + " AND " + $scope.global_filter;
$scope.stateQuery = $scope.global_filter;
$scope.chrome = {};
$scope.removeColumn = function removeColumn(columnName) {
$scope.indexPattern.popularizeField(columnName, 1);
@ -234,7 +235,7 @@ require('ui/modules').get('app/wazuh', []).controller('discoverW', function($sco
$scope.uiState = $state.makeStateful('uiState');
$scope.uiState.set('vis.legendOpen', false);
$state.query = ($scope.stateQuery ? $scope.stateQuery : '');
console.log($scope.disFilter);
function getStateDefaults() {
return {
query: $scope.disFilter ? $scope.disFilter : '',

View File

@ -32,7 +32,7 @@
parse-query
input-focus
kbn-typeahead-input
ng-model="state.query"
ng-model="state.query.query"
placeholder="Search... (e.g. status:200 AND extension:PHP)"
aria-label="Search input"
type="text"
@ -275,7 +275,7 @@
</header>
<visualization
ng-if="vis && rows.length != 0"
ng-if="vis && rows.length != 0 && resultState === 'ready'"
vis="vis"
ui-state="uiState"
vis-data="visData"