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
336699c5
Unverified
Commit
336699c5
authored
Sep 25, 2020
by
Ivana Huckova
Committed by
GitHub
Sep 25, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix formating of results from instant queries in Explore (#27767)
parent
204641a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
public/app/plugins/datasource/prometheus/datasource.test.ts
+2
-2
public/app/plugins/datasource/prometheus/datasource.ts
+6
-0
No files found.
public/app/plugins/datasource/prometheus/datasource.test.ts
View file @
336699c5
...
@@ -1868,7 +1868,7 @@ describe('prepareTargets', () => {
...
@@ -1868,7 +1868,7 @@ describe('prepareTargets', () => {
});
});
describe
(
'when query type Instant is selected'
,
()
=>
{
describe
(
'when query type Instant is selected'
,
()
=>
{
it
(
'then it should
just add targets
'
,
()
=>
{
it
(
'then it should
target and modify its format to table
'
,
()
=>
{
const
target
:
PromQuery
=
{
const
target
:
PromQuery
=
{
refId
:
'A'
,
refId
:
'A'
,
expr
:
'up'
,
expr
:
'up'
,
...
@@ -1894,7 +1894,7 @@ describe('prepareTargets', () => {
...
@@ -1894,7 +1894,7 @@ describe('prepareTargets', () => {
start
,
start
,
step
:
1
,
step
:
1
,
});
});
expect
(
activeTargets
[
0
]).
toEqual
(
target
);
expect
(
activeTargets
[
0
]).
toEqual
(
{
...
target
,
format
:
'table'
}
);
});
});
});
});
});
});
...
...
public/app/plugins/datasource/prometheus/datasource.ts
View file @
336699c5
...
@@ -237,6 +237,12 @@ export class PrometheusDatasource extends DataSourceApi<PromQuery, PromOptions>
...
@@ -237,6 +237,12 @@ export class PrometheusDatasource extends DataSourceApi<PromQuery, PromOptions>
this
.
createQuery
(
instantTarget
,
options
,
start
,
end
),
this
.
createQuery
(
instantTarget
,
options
,
start
,
end
),
this
.
createQuery
(
rangeTarget
,
options
,
start
,
end
)
this
.
createQuery
(
rangeTarget
,
options
,
start
,
end
)
);
);
}
else
if
(
target
.
instant
&&
options
.
app
===
CoreApp
.
Explore
)
{
// If running only instant query in Explore, format as table
const
instantTarget
:
any
=
cloneDeep
(
target
);
instantTarget
.
format
=
'table'
;
queries
.
push
(
this
.
createQuery
(
instantTarget
,
options
,
start
,
end
));
activeTargets
.
push
(
instantTarget
);
}
else
{
}
else
{
queries
.
push
(
this
.
createQuery
(
target
,
options
,
start
,
end
));
queries
.
push
(
this
.
createQuery
(
target
,
options
,
start
,
end
));
activeTargets
.
push
(
target
);
activeTargets
.
push
(
target
);
...
...
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