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
f00f3470
Unverified
Commit
f00f3470
authored
Nov 14, 2018
by
David
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14033 from grafana/davkal/explore-slow-ds-load
Explore: Dont set datasource in state if navigated away
parents
aa340b90
9b48338d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
public/app/features/explore/Explore.tsx
+12
-0
No files found.
public/app/features/explore/Explore.tsx
View file @
f00f3470
...
...
@@ -94,6 +94,10 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
* Not kept in component state to prevent edit-render roundtrips.
*/
queryExpressions
:
string
[];
/**
* Local ID cache to compare requested vs selected datasource
*/
requestedDatasourceId
:
string
;
constructor
(
props
)
{
super
(
props
);
...
...
@@ -167,6 +171,9 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
const
datasourceId
=
datasource
.
meta
.
id
;
let
datasourceError
=
null
;
// Keep ID to track selection
this
.
requestedDatasourceId
=
datasourceId
;
try
{
const
testResult
=
await
datasource
.
testDatasource
();
datasourceError
=
testResult
.
status
===
'success'
?
null
:
testResult
.
message
;
...
...
@@ -174,6 +181,11 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
datasourceError
=
(
error
&&
error
.
statusText
)
||
'Network error'
;
}
if
(
datasourceId
!==
this
.
requestedDatasourceId
)
{
// User already changed datasource again, discard results
return
;
}
const
historyKey
=
`grafana.explore.history.
${
datasourceId
}
`
;
const
history
=
store
.
getObject
(
historyKey
,
[]);
...
...
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