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
2bb46847
Unverified
Commit
2bb46847
authored
Oct 30, 2019
by
Ryan McKinley
Committed by
GitHub
Oct 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataSource: don't filter hidden queries automatically (#20088)
parent
e940edc7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
11 additions
and
22 deletions
+11
-22
packages/grafana-ui/src/types/datasource.ts
+0
-7
pkg/plugins/datasource_plugin.go
+0
-1
public/app/features/dashboard/state/PanelQueryRunner.ts
+0
-4
public/app/plugins/datasource/cloudwatch/plugin.json
+0
-1
public/app/plugins/datasource/graphite/plugin.json
+0
-1
public/app/plugins/datasource/input/InputDatasource.ts
+3
-0
public/app/plugins/datasource/mixed/MixedDataSource.ts
+0
-7
public/app/plugins/datasource/mixed/plugin.json
+0
-1
public/app/plugins/datasource/testdata/datasource.ts
+3
-0
yarn.lock
+5
-0
No files found.
packages/grafana-ui/src/types/datasource.ts
View file @
2bb46847
...
...
@@ -109,13 +109,6 @@ export interface DataSourcePluginMeta extends PluginMeta {
queryOptions
?:
PluginMetaQueryOptions
;
sort
?:
number
;
streaming
?:
boolean
;
/**
* By default, hidden queries are not passed to the datasource
* Set this to true in plugin.json to have hidden queries passed to the
* DataSource query method
*/
hiddenQueries
?:
boolean
;
}
interface
PluginMetaQueryOptions
{
...
...
pkg/plugins/datasource_plugin.go
View file @
2bb46847
...
...
@@ -31,7 +31,6 @@ type DataSourcePlugin struct {
Alerting
bool
`json:"alerting"`
Explore
bool
`json:"explore"`
Table
bool
`json:"tables"`
HiddenQueries
bool
`json:"hiddenQueries"`
Logs
bool
`json:"logs"`
QueryOptions
map
[
string
]
bool
`json:"queryOptions,omitempty"`
BuiltIn
bool
`json:"builtIn,omitempty"`
...
...
public/app/features/dashboard/state/PanelQueryRunner.ts
View file @
2bb46847
...
...
@@ -118,10 +118,6 @@ export class PanelQueryRunner {
try
{
const
ds
=
await
getDataSource
(
datasource
,
request
.
scopedVars
);
if
(
ds
.
meta
&&
!
ds
.
meta
.
hiddenQueries
)
{
request
.
targets
=
request
.
targets
.
filter
(
q
=>
!
q
.
hide
);
}
// Attach the datasource name to each query
request
.
targets
=
request
.
targets
.
map
(
query
=>
{
if
(
!
query
.
datasource
)
{
...
...
public/app/plugins/datasource/cloudwatch/plugin.json
View file @
2bb46847
...
...
@@ -4,7 +4,6 @@
"id"
:
"cloudwatch"
,
"category"
:
"cloud"
,
"hiddenQueries"
:
true
,
"metrics"
:
true
,
"alerting"
:
true
,
"annotations"
:
true
,
...
...
public/app/plugins/datasource/graphite/plugin.json
View file @
2bb46847
...
...
@@ -6,7 +6,6 @@
"includes"
:
[{
"type"
:
"dashboard"
,
"name"
:
"Graphite Carbon Metrics"
,
"path"
:
"dashboards/carbon_metrics.json"
}],
"hiddenQueries"
:
true
,
"metrics"
:
true
,
"alerting"
:
true
,
"annotations"
:
true
,
...
...
public/app/plugins/datasource/input/InputDatasource.ts
View file @
2bb46847
...
...
@@ -49,6 +49,9 @@ export class InputDatasource extends DataSourceApi<InputQuery, InputOptions> {
query
(
options
:
DataQueryRequest
<
InputQuery
>
):
Promise
<
DataQueryResponse
>
{
const
results
:
DataFrame
[]
=
[];
for
(
const
query
of
options
.
targets
)
{
if
(
query
.
hide
)
{
continue
;
}
let
data
=
this
.
data
;
if
(
query
.
data
)
{
data
=
query
.
data
.
map
(
v
=>
toDataFrame
(
v
));
...
...
public/app/plugins/datasource/mixed/MixedDataSource.ts
View file @
2bb46847
...
...
@@ -37,13 +37,6 @@ export class MixedDatasource extends DataSourceApi<DataQuery> {
mergeMap
((
dataSourceApi
:
DataSourceApi
)
=>
{
const
datasourceRequest
=
cloneDeep
(
request
);
// Remove any unused hidden queries
let
newTargets
=
targets
.
slice
();
if
(
!
dataSourceApi
.
meta
.
hiddenQueries
)
{
newTargets
=
newTargets
.
filter
((
t
:
DataQuery
)
=>
!
t
.
hide
);
}
datasourceRequest
.
targets
=
newTargets
;
datasourceRequest
.
requestId
=
`
${
dsName
}${
datasourceRequest
.
requestId
||
''
}
`
;
// all queries hidden return empty result for for this requestId
...
...
public/app/plugins/datasource/mixed/plugin.json
View file @
2bb46847
...
...
@@ -6,7 +6,6 @@
"builtIn"
:
true
,
"mixed"
:
true
,
"metrics"
:
true
,
"hiddenQueries"
:
true
,
"queryOptions"
:
{
"minInterval"
:
true
...
...
public/app/plugins/datasource/testdata/datasource.ts
View file @
2bb46847
...
...
@@ -27,6 +27,9 @@ export class TestDataDataSource extends DataSourceApi<TestDataQuery> {
// Start streams and prepare queries
for
(
const
target
of
options
.
targets
)
{
if
(
target
.
hide
)
{
continue
;
}
if
(
target
.
scenarioId
===
'streaming_client'
)
{
streams
.
push
(
runStream
(
target
,
options
));
}
else
{
...
...
yarn.lock
View file @
2bb46847
...
...
@@ -5821,6 +5821,11 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"
caniuse-db@1.0.30000772:
version "1.0.30000772"
resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000772.tgz#51aae891768286eade4a3d8319ea76d6a01b512b"
integrity sha1-UarokXaChureSj2DGep21qAbUSs=
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000939, caniuse-lite@^1.0.30000947, caniuse-lite@^1.0.30000989, caniuse-lite@^1.0.30000999:
version "1.0.30000999"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000999.tgz#427253a69ad7bea4aa8d8345687b8eec51ca0e43"
...
...
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