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
aad558ce
Commit
aad558ce
authored
Feb 13, 2019
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using error callback from datapanel instead
parent
56f7cd96
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
packages/grafana-ui/src/components/Tooltip/Popper.tsx
+10
-2
public/app/features/dashboard/dashgrid/DataPanel.tsx
+5
-2
public/app/features/dashboard/dashgrid/PanelChrome.tsx
+3
-2
No files found.
packages/grafana-ui/src/components/Tooltip/Popper.tsx
View file @
aad558ce
...
...
@@ -35,8 +35,16 @@ interface Props extends React.HTMLAttributes<HTMLDivElement> {
class
Popper
extends
PureComponent
<
Props
>
{
render
()
{
const
{
show
,
placement
,
onMouseEnter
,
onMouseLeave
,
className
,
wrapperClassName
,
renderArrow
}
=
this
.
props
;
const
{
content
}
=
this
.
props
;
const
{
content
,
show
,
placement
,
onMouseEnter
,
onMouseLeave
,
className
,
wrapperClassName
,
renderArrow
,
}
=
this
.
props
;
return
(
<
Manager
>
...
...
public/app/features/dashboard/dashgrid/DataPanel.tsx
View file @
aad558ce
...
...
@@ -34,6 +34,7 @@ export interface Props {
maxDataPoints
?:
number
;
children
:
(
r
:
RenderProps
)
=>
JSX
.
Element
;
onDataResponse
?:
(
data
:
DataQueryResponse
)
=>
void
;
onError
:
(
errorMessage
:
string
)
=>
void
;
}
export
interface
State
{
...
...
@@ -94,6 +95,7 @@ export class DataPanel extends Component<Props, State> {
widthPixels
,
maxDataPoints
,
onDataResponse
,
onError
,
}
=
this
.
props
;
if
(
!
isVisible
)
{
...
...
@@ -146,7 +148,9 @@ export class DataPanel extends Component<Props, State> {
}
catch
(
err
)
{
console
.
log
(
'Loading error'
,
err
);
this
.
setState
({
isFirstLoad
:
false
});
throw
new
Error
(
'Request Error'
);
onError
(
`Query error
status:
${
err
.
status
}
message:
${
err
.
statusText
}
`
);
}
};
...
...
@@ -169,7 +173,6 @@ export class DataPanel extends Component<Props, State> {
render
()
{
const
{
queries
}
=
this
.
props
;
const
{
loading
,
isFirstLoad
}
=
this
.
state
;
const
panelData
=
this
.
getPanelData
();
if
(
isFirstLoad
&&
loading
===
LoadingState
.
Loading
)
{
...
...
public/app/features/dashboard/dashgrid/PanelChrome.tsx
View file @
aad558ce
...
...
@@ -171,6 +171,7 @@ export class PanelChrome extends PureComponent<Props, State> {
widthPixels=
{
width
}
refreshCounter=
{
refreshCounter
}
onDataResponse=
{
this
.
onDataResponse
}
onError=
{
this
.
onError
}
>
{
({
loading
,
panelData
})
=>
{
return
this
.
renderPanelPlugin
(
loading
,
panelData
,
width
,
height
);
...
...
@@ -185,7 +186,7 @@ export class PanelChrome extends PureComponent<Props, State> {
render
()
{
const
{
dashboard
,
panel
}
=
this
.
props
;
const
{
timeInfo
}
=
this
.
state
;
const
{
errorMessage
,
timeInfo
}
=
this
.
state
;
const
{
transparent
}
=
panel
;
const
containerClassNames
=
`panel-container panel-container--absolute
${
transparent
?
'panel-transparent'
:
''
}
`
;
...
...
@@ -206,7 +207,7 @@ export class PanelChrome extends PureComponent<Props, State> {
description=
{
panel
.
description
}
scopedVars=
{
panel
.
scopedVars
}
links=
{
panel
.
links
}
error=
{
this
.
state
.
errorMessage
}
error=
{
errorMessage
}
/>
<
ErrorBoundary
>
{
({
error
,
errorInfo
})
=>
{
...
...
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