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
f16bf361
Unverified
Commit
f16bf361
authored
Jun 23, 2020
by
Ryan McKinley
Committed by
GitHub
Jun 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InfluxDB: improve test response (#25785)
parent
57f99471
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
public/app/plugins/datasource/influxdb/datasource.ts
+10
-6
No files found.
public/app/plugins/datasource/influxdb/datasource.ts
View file @
f16bf361
...
@@ -309,16 +309,20 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
...
@@ -309,16 +309,20 @@ export default class InfluxDatasource extends DataSourceWithBackend<InfluxQuery,
return
super
return
super
.
query
(
request
)
.
query
(
request
)
.
toPromise
()
.
toPromise
()
.
then
((
res
:
any
)
=>
{
.
then
((
res
:
DataQueryResponse
)
=>
{
const
data
:
DataQueryResponse
=
res
.
data
;
if
(
!
res
||
!
res
.
data
||
res
.
state
!==
LoadingState
.
Done
)
{
if
(
data
&&
data
.
state
===
LoadingState
.
Done
)
{
console
.
log
(
'InfluxDB Error'
,
res
);
const
buckets
=
data
.
data
[
0
].
length
;
return
{
status
:
'error'
,
message
:
'Error reading InfluxDB'
};
return
{
status
:
'success'
,
message
:
`Data source is working (
${
buckets
}
buckets)`
};
}
const
first
=
res
.
data
[
0
];
if
(
first
&&
first
.
length
)
{
return
{
status
:
'success'
,
message
:
`
${
first
.
length
}
buckets found`
};
}
}
console
.
log
(
'InfluxDB Error'
,
data
);
console
.
log
(
'InfluxDB Error'
,
res
);
return
{
status
:
'error'
,
message
:
'Error reading buckets'
};
return
{
status
:
'error'
,
message
:
'Error reading buckets'
};
})
})
.
catch
((
err
:
any
)
=>
{
.
catch
((
err
:
any
)
=>
{
console
.
log
(
'InfluxDB Error'
,
err
);
return
{
status
:
'error'
,
message
:
err
.
message
};
return
{
status
:
'error'
,
message
:
err
.
message
};
});
});
}
}
...
...
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