-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add terms filter * First stab at inline filter editors * Cleanup * Move endpoint to server * Add delete button to filter editor * Add sort prefix first utility * Sort ui-select items by prefix first * Add sortPrefixFirst tests * Use small text input instead of styles * More keyboard-driven filter creation * Add custom dsl edit support * Add more actions * Add alias support * Simplify label * Allow freeform entries * Fix visualize * Support for dashboard * Move styles to less and fix visual issues * Rename map_match to map_phrase * Detect scripted filters for filter editors * Simplify range map * Use match_phrase instead of terms * Fix scripted exists * Support scripted phrases * Don't show DSL editor for new filters * Disable save unless valid * Fix error when searching for numbers * Return correct error and dont suggest values for numbers * Only suggest filterable fields * Clear params on field change * Clear suggestions on field change * Cache response * Preserve selected params * Fix multiple selection * Don't overflow on multiselect * Show tooltip on long values * Use different input for different types * Show all actions again * Move dsl editor to directive * Update filter query dsl editor * Clean up code * Move filter field select into own directive * Move filter operator select into own directive * Move utils to separate file * Move field options to field directive * Move operator options to operator directive * Move params under operator type * Move params editor into own directive * Move param editors to own directives * Don't highlight values * Don't use unnecessary onChange * Use text input if no suggestions * Remove unused updateFilter * Enhance params editors Move params editors to separate file and present different editors based on field type * Update save filter api * Update save filter api * Fix a couple tests * Fix more tests * Fix map phrase test * test cleanup * Hide editor on esc key * Use first index pattern if none specified * FilterEditorUtils test and fix range error * fix date phrase * Date format should allow date math values * Only show add filter button if there are index patterns * Look up field from indexPatterns service rather than passed index patterns * Use basepath instead of relative path * Feedback from bargs * Don't show filter bar when ya shouldnt * don't reload panel saved objects * Show date math instead of formatted date * Focus on params even when not ui-select * Hide editor on delete * Update styles to BEM format * Update styles * Add more tests * Don't show pin/disable * Fix bug where saving a filter edit without making changes messed up pinning * Update styles to camelcase * Fix cutoff from top of screen for ui-select * Add accessibility * Align to top * Align inputs and add placeholders * Dynamic input sizing * Fix dashboard panel test
- Loading branch information
Showing
82 changed files
with
1,731 additions
and
368 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
src/core_plugins/kibana/server/routes/api/suggestions/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { registerValueSuggestions } from './register_value_suggestions'; | ||
|
||
export function registerSuggestionsApi(server) { | ||
registerValueSuggestions(server); | ||
} |
31 changes: 31 additions & 0 deletions
31
src/core_plugins/kibana/server/routes/api/suggestions/register_value_suggestions.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import handleESError from '../../../lib/handle_es_error'; | ||
|
||
export function registerValueSuggestions(server) { | ||
server.route({ | ||
path: '/api/kibana/suggestions/values/{index}', | ||
method: ['POST'], | ||
handler: function (req, reply) { | ||
const { index } = req.params; | ||
const { field, query } = req.payload; | ||
|
||
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data'); | ||
const include = query ? `.*${query}.*` : undefined; | ||
const body = getBody({ field, include }); | ||
|
||
return callWithRequest(req, 'search', { index, body }) | ||
.then((res) => { | ||
const suggestions = res.aggregations.suggestions.buckets.map(bucket => bucket.key); | ||
return reply(suggestions); | ||
}) | ||
.catch(error => reply(handleESError(error))); | ||
} | ||
}); | ||
} | ||
|
||
function getBody(terms) { | ||
return { | ||
aggs: { | ||
suggestions: { terms } | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export const existsFilter = { | ||
'meta': { | ||
'index': 'logstash-*', | ||
'negate': false, | ||
'disabled': false, | ||
'type': 'exists', | ||
'key': 'machine.os', | ||
'value': 'exists' | ||
}, | ||
'exists': { | ||
'field': 'machine.os' | ||
}, | ||
'$state': { | ||
'store': 'appState' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export { phraseFilter } from './phrase_filter'; | ||
export { scriptedPhraseFilter } from './scripted_phrase_filter'; | ||
export { phrasesFilter } from './phrases_filter'; | ||
export { rangeFilter } from './range_filter'; | ||
export { existsFilter } from './exists_filter'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export const phraseFilter = { | ||
meta: { | ||
negate: false, | ||
index: 'logstash-*', | ||
type: 'phrase', | ||
key: 'machine.os', | ||
value: 'ios', | ||
disabled: false | ||
}, | ||
query: { | ||
match: { | ||
'machine.os': { | ||
query: 'ios', | ||
type: 'phrase' | ||
} | ||
} | ||
}, | ||
$state: { | ||
store: 'appState' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
export const phrasesFilter = { | ||
meta: { | ||
index: 'logstash-*', | ||
type: 'phrases', | ||
key: 'machine.os.raw', | ||
value: 'win xp, osx', | ||
params: [ | ||
'win xp', | ||
'osx' | ||
], | ||
negate: false, | ||
disabled: false | ||
}, | ||
query: { | ||
bool: { | ||
should: [ | ||
{ | ||
match_phrase: { | ||
'machine.os.raw': 'win xp' | ||
} | ||
}, | ||
{ | ||
match_phrase: { | ||
'machine.os.raw': 'osx' | ||
} | ||
} | ||
], | ||
minimum_should_match: 1 | ||
} | ||
}, | ||
$state: { | ||
store: 'appState' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
export const rangeFilter = { | ||
'meta': { | ||
'index': 'logstash-*', | ||
'negate': false, | ||
'disabled': false, | ||
'alias': null, | ||
'type': 'range', | ||
'key': 'bytes', | ||
'value': '0 to 10' | ||
}, | ||
'range': { | ||
'bytes': { | ||
'gte': 0, | ||
'lt': 10 | ||
} | ||
}, | ||
'$state': { | ||
'store': 'appState' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
export const scriptedPhraseFilter = { | ||
'meta': { | ||
'negate': false, | ||
'index': 'logstash-*', | ||
'field': 'script string', | ||
'type': 'phrase', | ||
'key': 'script string', | ||
'value': 'i am a string', | ||
'disabled': false | ||
}, | ||
'script': { | ||
'script': { | ||
'inline': 'boolean compare(Supplier s, def v) {return s.get() == v;}compare(() -> { \'i am a string\' }, params.value);', | ||
'lang': 'painless', | ||
'params': { | ||
'value': 'i am a string' | ||
} | ||
} | ||
}, | ||
'$state': { | ||
'store': 'appState' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.