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
be85944d
Commit
be85944d
authored
Nov 30, 2018
by
Erik Sundell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add an error alert component that will be displayed when there was an error loading ds in explore
parent
e55a0cce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
5 deletions
+27
-5
public/app/features/explore/Error.tsx
+21
-0
public/app/features/explore/Explore.tsx
+6
-5
No files found.
public/app/features/explore/Error.tsx
0 → 100644
View file @
be85944d
import
React
,
{
SFC
}
from
'react'
;
interface
Props
{
message
:
any
;
}
export
const
Alert
:
SFC
<
Props
>
=
props
=>
{
const
{
message
}
=
props
;
return
(
<
div
className=
"gf-form-group section"
>
<
div
className=
"alert-error alert"
>
<
div
className=
"alert-icon"
>
<
i
className=
"fa fa-exclamation-triangle"
/>
</
div
>
<
div
className=
"alert-body"
>
<
div
className=
"alert-title"
>
{
message
}
</
div
>
</
div
>
</
div
>
</
div
>
);
};
public/app/features/explore/Explore.tsx
View file @
be85944d
...
...
@@ -40,6 +40,7 @@ import Logs from './Logs';
import
Table
from
'./Table'
;
import
ErrorBoundary
from
'./ErrorBoundary'
;
import
TimePicker
from
'./TimePicker'
;
import
{
Alert
}
from
'./Error'
;
interface
ExploreProps
{
datasourceSrv
:
DatasourceSrv
;
...
...
@@ -851,16 +852,16 @@ export class Explore extends React.PureComponent<ExploreProps, ExploreState> {
</
button
>
</
div
>
</
div
>
{
datasourceLoading
?
<
div
className=
"explore-container"
>
Loading datasource...
</
div
>
:
null
}
{
datasourceMissing
?
(
<
div
className=
"explore-container"
>
Please add a datasource that supports Explore (e.g., Prometheus).
</
div
>
)
:
null
}
{
datasourceError
?
(
<
div
className=
"explore-container"
>
Error connecting to datasource. [
{
datasourceError
}
]
</
div
>
)
:
null
}
{
datasourceError
&&
(
<
div
className=
"explore-container"
>
<
Alert
message=
{
`Error connecting to datasource: ${datasourceError}`
}
/>
</
div
>
)
}
{
datasource
&&
!
datasourceError
?
(
<
div
className=
"explore-container"
>
...
...
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