Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f4bc0231
Unverified
Commit
f4bc0231
authored
Nov 23, 2018
by
David
Committed by
GitHub
Nov 23, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14171 from grafana/davkal/explore-fix-empty-suggestion
Explore: make query field suggestions more robust
parents
91d97ab5
f831836f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
public/app/features/explore/Typeahead.tsx
+1
-1
public/app/plugins/datasource/logging/language_provider.ts
+3
-2
public/app/plugins/datasource/prometheus/language_provider.ts
+3
-2
No files found.
public/app/features/explore/Typeahead.tsx
View file @
f4bc0231
...
@@ -42,7 +42,7 @@ class TypeaheadItem extends React.PureComponent<TypeaheadItemProps> {
...
@@ -42,7 +42,7 @@ class TypeaheadItem extends React.PureComponent<TypeaheadItemProps> {
render
()
{
render
()
{
const
{
isSelected
,
item
,
prefix
}
=
this
.
props
;
const
{
isSelected
,
item
,
prefix
}
=
this
.
props
;
const
className
=
isSelected
?
'typeahead-item typeahead-item__selected'
:
'typeahead-item'
;
const
className
=
isSelected
?
'typeahead-item typeahead-item__selected'
:
'typeahead-item'
;
const
{
label
}
=
item
;
const
label
=
item
.
label
||
''
;
return
(
return
(
<
li
ref=
{
this
.
getRef
}
className=
{
className
}
onClick=
{
this
.
onClick
}
>
<
li
ref=
{
this
.
getRef
}
className=
{
className
}
onClick=
{
this
.
onClick
}
>
<
Highlighter
textToHighlight=
{
label
}
searchWords=
{
[
prefix
]
}
highlightClassName=
"typeahead-match"
/>
<
Highlighter
textToHighlight=
{
label
}
searchWords=
{
[
prefix
]
}
highlightClassName=
"typeahead-match"
/>
...
...
public/app/plugins/datasource/logging/language_provider.ts
View file @
f4bc0231
...
@@ -97,9 +97,10 @@ export default class LoggingLanguageProvider extends LanguageProvider {
...
@@ -97,9 +97,10 @@ export default class LoggingLanguageProvider extends LanguageProvider {
if
(
history
&&
history
.
length
>
0
)
{
if
(
history
&&
history
.
length
>
0
)
{
const
historyItems
=
_
.
chain
(
history
)
const
historyItems
=
_
.
chain
(
history
)
.
uniqBy
(
'query.expr'
)
.
take
(
HISTORY_ITEM_COUNT
)
.
map
(
h
=>
h
.
query
.
expr
)
.
map
(
h
=>
h
.
query
.
expr
)
.
filter
()
.
uniq
()
.
take
(
HISTORY_ITEM_COUNT
)
.
map
(
wrapLabel
)
.
map
(
wrapLabel
)
.
map
(
item
=>
addHistoryMetadata
(
item
,
history
))
.
map
(
item
=>
addHistoryMetadata
(
item
,
history
))
.
value
();
.
value
();
...
...
public/app/plugins/datasource/prometheus/language_provider.ts
View file @
f4bc0231
...
@@ -125,9 +125,10 @@ export default class PromQlLanguageProvider extends LanguageProvider {
...
@@ -125,9 +125,10 @@ export default class PromQlLanguageProvider extends LanguageProvider {
if
(
history
&&
history
.
length
>
0
)
{
if
(
history
&&
history
.
length
>
0
)
{
const
historyItems
=
_
.
chain
(
history
)
const
historyItems
=
_
.
chain
(
history
)
.
uniqBy
(
'query.expr'
)
.
take
(
HISTORY_ITEM_COUNT
)
.
map
(
h
=>
h
.
query
.
expr
)
.
map
(
h
=>
h
.
query
.
expr
)
.
filter
()
.
uniq
()
.
take
(
HISTORY_ITEM_COUNT
)
.
map
(
wrapLabel
)
.
map
(
wrapLabel
)
.
map
(
item
=>
addHistoryMetadata
(
item
,
history
))
.
map
(
item
=>
addHistoryMetadata
(
item
,
history
))
.
value
();
.
value
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment