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
57810ea5
Unverified
Commit
57810ea5
authored
Mar 05, 2019
by
Torkel Ödegaard
Committed by
GitHub
Mar 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15775 from ryantxu/rename-interpolate
use replaceVariables rather than onInterpolate
parents
cee5f030
251008f5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
packages/grafana-ui/src/types/panel.ts
+1
-1
public/app/features/dashboard/dashgrid/PanelChrome.tsx
+2
-2
public/app/plugins/panel/gauge/GaugePanel.tsx
+3
-3
No files found.
packages/grafana-ui/src/types/panel.ts
View file @
57810ea5
...
...
@@ -12,7 +12,7 @@ export interface PanelProps<T = any> {
renderCounter
:
number
;
width
:
number
;
height
:
number
;
onInterpolate
:
InterpolateFunction
;
replaceVariables
:
InterpolateFunction
;
}
export
interface
PanelData
{
...
...
public/app/features/dashboard/dashgrid/PanelChrome.tsx
View file @
57810ea5
...
...
@@ -85,7 +85,7 @@ export class PanelChrome extends PureComponent<Props, State> {
});
};
onInterpolate
=
(
value
:
string
,
format
?:
string
)
=>
{
replaceVariables
=
(
value
:
string
,
format
?:
string
)
=>
{
return
templateSrv
.
replace
(
value
,
this
.
props
.
panel
.
scopedVars
,
format
);
};
...
...
@@ -158,7 +158,7 @@ export class PanelChrome extends PureComponent<Props, State> {
width=
{
width
-
2
*
variables
.
panelhorizontalpadding
}
height=
{
height
-
PANEL_HEADER_HEIGHT
-
variables
.
panelverticalpadding
}
renderCounter=
{
renderCounter
}
onInterpolate=
{
this
.
onInterpolate
}
replaceVariables=
{
this
.
replaceVariables
}
/>
</
div
>
);
...
...
public/app/plugins/panel/gauge/GaugePanel.tsx
View file @
57810ea5
...
...
@@ -15,11 +15,11 @@ interface Props extends PanelProps<GaugeOptions> {}
export
class
GaugePanel
extends
PureComponent
<
Props
>
{
render
()
{
const
{
panelData
,
width
,
height
,
onInterpolate
,
options
}
=
this
.
props
;
const
{
panelData
,
width
,
height
,
replaceVariables
,
options
}
=
this
.
props
;
const
{
valueOptions
}
=
options
;
const
prefix
=
onInterpolate
(
valueOptions
.
prefix
);
const
suffix
=
onInterpolate
(
valueOptions
.
suffix
);
const
prefix
=
replaceVariables
(
valueOptions
.
prefix
);
const
suffix
=
replaceVariables
(
valueOptions
.
suffix
);
let
value
:
TimeSeriesValue
;
if
(
panelData
.
timeSeries
)
{
...
...
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