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
e21a140f
Commit
e21a140f
authored
Nov 16, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor fixes
parent
c4ae05c5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
public/app/core/components/Tooltip/withPopper.tsx
+2
-1
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx
+5
-10
No files found.
public/app/core/components/Tooltip/withPopper.tsx
View file @
e21a140f
import
React
from
'react'
;
import
React
from
'react'
;
export
interface
UsingPopperProps
{
export
interface
UsingPopperProps
{
showPopper
:
(
prevState
:
object
)
=>
void
;
showPopper
:
(
prevState
:
object
)
=>
void
;
...
@@ -60,6 +60,7 @@ export default function withPopper(WrappedComponent) {
...
@@ -60,6 +60,7 @@ export default function withPopper(WrappedComponent) {
};
};
renderContent
(
content
)
{
renderContent
(
content
)
{
console
.
log
(
'render content'
);
if
(
typeof
content
===
'function'
)
{
if
(
typeof
content
===
'function'
)
{
// If it's a function we assume it's a React component
// If it's a function we assume it's a React component
const
ReactComponent
=
content
;
const
ReactComponent
=
content
;
...
...
public/app/features/dashboard/dashgrid/PanelHeader/PanelHeaderCorner.tsx
View file @
e21a140f
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
PanelModel
}
from
'app/features/dashboard/panel_model'
;
import
{
PanelModel
}
from
'app/features/dashboard/panel_model'
;
import
Tooltip
from
'app/core/components/Tooltip/Tooltip'
;
import
Tooltip
from
'app/core/components/Tooltip/Tooltip'
;
import
templateSrv
from
'app/features/templating/template_srv'
;
import
templateSrv
from
'app/features/templating/template_srv'
;
...
@@ -21,10 +21,6 @@ export class PanelHeaderCorner extends PureComponent<Props> {
...
@@ -21,10 +21,6 @@ export class PanelHeaderCorner extends PureComponent<Props> {
getInfoMode
=
()
=>
{
getInfoMode
=
()
=>
{
const
{
panel
}
=
this
.
props
;
const
{
panel
}
=
this
.
props
;
// TODO
// if (error) {
// return InfoModes.Error;
// }
if
(
!!
panel
.
description
)
{
if
(
!!
panel
.
description
)
{
return
InfoModes
.
Info
;
return
InfoModes
.
Info
;
}
}
...
@@ -35,11 +31,10 @@ export class PanelHeaderCorner extends PureComponent<Props> {
...
@@ -35,11 +31,10 @@ export class PanelHeaderCorner extends PureComponent<Props> {
return
undefined
;
return
undefined
;
};
};
getInfoContent
=
()
=>
{
getInfoContent
=
()
:
JSX
.
Element
=>
{
const
{
panel
}
=
this
.
props
;
const
{
panel
}
=
this
.
props
;
const
markdown
=
panel
.
description
;
const
markdown
=
panel
.
description
;
const
linkSrv
=
new
LinkSrv
(
templateSrv
,
this
.
timeSrv
);
const
linkSrv
=
new
LinkSrv
(
templateSrv
,
this
.
timeSrv
);
const
sanitize
=
str
=>
str
;
// TODO
const
interpolatedMarkdown
=
templateSrv
.
replace
(
markdown
,
panel
.
scopedVars
);
const
interpolatedMarkdown
=
templateSrv
.
replace
(
markdown
,
panel
.
scopedVars
);
const
remarkableInterpolatedMarkdown
=
new
Remarkable
().
render
(
interpolatedMarkdown
);
const
remarkableInterpolatedMarkdown
=
new
Remarkable
().
render
(
interpolatedMarkdown
);
...
@@ -63,7 +58,8 @@ export class PanelHeaderCorner extends PureComponent<Props> {
...
@@ -63,7 +58,8 @@ export class PanelHeaderCorner extends PureComponent<Props> {
)
}
)
}
</
div
>
</
div
>
);
);
return
sanitize
(
html
);
return
html
;
};
};
render
()
{
render
()
{
...
@@ -72,13 +68,12 @@ export class PanelHeaderCorner extends PureComponent<Props> {
...
@@ -72,13 +68,12 @@ export class PanelHeaderCorner extends PureComponent<Props> {
if
(
!
infoMode
)
{
if
(
!
infoMode
)
{
return
null
;
return
null
;
}
}
const
infoContent
=
this
.
getInfoContent
();
return
(
return
(
<>
<>
{
infoMode
===
InfoModes
.
Info
||
infoMode
===
InfoModes
.
Links
?
(
{
infoMode
===
InfoModes
.
Info
||
infoMode
===
InfoModes
.
Links
?
(
<
Tooltip
<
Tooltip
content=
{
i
nfoContent
}
content=
{
this
.
getI
nfoContent
}
className=
"absolute"
className=
"absolute"
refClassName=
{
`panel-info-corner panel-info-corner--${infoMode.toLowerCase()}`
}
refClassName=
{
`panel-info-corner panel-info-corner--${infoMode.toLowerCase()}`
}
>
>
...
...
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