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
4a8d80a9
Commit
4a8d80a9
authored
Sep 20, 2018
by
David Kaltschmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explore: Fix metric suggestions when first letters have been typed
parent
d8b566a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
+3
-1
public/app/containers/Explore/PromQueryField.tsx
+3
-1
No files found.
public/app/containers/Explore/PromQueryField.tsx
View file @
4a8d80a9
...
...
@@ -255,6 +255,8 @@ class PromQueryField extends React.Component<PromQueryFieldProps, PromQueryField
// Keep this DOM-free for testing
getTypeahead
({
prefix
,
wrapperClasses
,
text
}:
PromTypeaheadInput
):
TypeaheadOutput
{
// Syntax spans have 3 classes by default. More indicate a recognized token
const
tokenRecognized
=
wrapperClasses
.
length
>
3
;
// Determine candidates by CSS context
if
(
_
.
includes
(
wrapperClasses
,
'context-range'
))
{
// Suggestions for metric[|]
...
...
@@ -266,7 +268,7 @@ class PromQueryField extends React.Component<PromQueryFieldProps, PromQueryField
return
this
.
getAggregationTypeahead
.
apply
(
this
,
arguments
);
}
else
if
(
// Non-empty but not inside known token
(
prefix
&&
!
_
.
includes
(
wrapperClasses
,
'token'
)
)
||
(
prefix
&&
!
tokenRecognized
)
||
(
prefix
===
''
&&
!
text
.
match
(
/^
[
)
\s]
+$/
))
||
// Empty context or after ')'
text
.
match
(
/
[
+
\-
*
/
^%
]
/
)
// After binary operator
)
{
...
...
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