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
531176b5
Unverified
Commit
531176b5
authored
Mar 19, 2019
by
Torkel Ödegaard
Committed by
GitHub
Mar 19, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #16077 from grafana/gauge-change-options-render
Re-render gauge / singlestat panels when changing options
parents
c19a47d3
d5972718
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
12 deletions
+12
-12
public/app/plugins/panel/bargauge/BarGaugePanel.tsx
+3
-3
public/app/plugins/panel/gauge/GaugePanel.tsx
+3
-3
public/app/plugins/panel/singlestat2/ProcessedValuesRepeater.tsx
+3
-3
public/app/plugins/panel/singlestat2/SingleStatPanel.tsx
+3
-3
No files found.
public/app/plugins/panel/bargauge/BarGaugePanel.tsx
View file @
531176b5
...
...
@@ -32,8 +32,7 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> {
};
render
()
{
const
{
height
,
width
,
options
,
panelData
}
=
this
.
props
;
const
{
orientation
}
=
options
;
const
{
height
,
width
,
options
,
panelData
,
renderCounter
}
=
this
.
props
;
return
(
<
ProcessedValuesRepeater
getProcessedValues=
{
this
.
getProcessedValues
}
...
...
@@ -41,7 +40,8 @@ export class BarGaugePanel extends PureComponent<PanelProps<BarGaugeOptions>> {
width=
{
width
}
height=
{
height
}
source=
{
panelData
}
orientation=
{
orientation
}
renderCounter=
{
renderCounter
}
orientation=
{
options
.
orientation
}
/>
);
}
...
...
public/app/plugins/panel/gauge/GaugePanel.tsx
View file @
531176b5
...
...
@@ -37,8 +37,7 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
};
render
()
{
const
{
height
,
width
,
options
,
panelData
}
=
this
.
props
;
const
{
orientation
}
=
options
;
const
{
height
,
width
,
options
,
panelData
,
renderCounter
}
=
this
.
props
;
return
(
<
ProcessedValuesRepeater
getProcessedValues=
{
this
.
getProcessedValues
}
...
...
@@ -46,7 +45,8 @@ export class GaugePanel extends PureComponent<PanelProps<GaugeOptions>> {
width=
{
width
}
height=
{
height
}
source=
{
panelData
}
orientation=
{
orientation
}
renderCounter=
{
renderCounter
}
orientation=
{
options
.
orientation
}
/>
);
}
...
...
public/app/plugins/panel/singlestat2/ProcessedValuesRepeater.tsx
View file @
531176b5
...
...
@@ -7,7 +7,7 @@ export interface Props<T> {
height
:
number
;
orientation
:
VizOrientation
;
source
:
any
;
// If this changes, the values will be processed
processFlag
?:
boolean
;
// change to force processing
renderCounter
:
number
;
// change to force processing
getProcessedValues
:
()
=>
T
[];
renderValue
:
(
value
:
T
,
width
:
number
,
height
:
number
)
=>
JSX
.
Element
;
...
...
@@ -30,8 +30,8 @@ export class ProcessedValuesRepeater<T> extends PureComponent<Props<T>, State<T>
}
componentDidUpdate
(
prevProps
:
Props
<
T
>
)
{
const
{
processFlag
,
source
}
=
this
.
props
;
if
(
processFlag
!==
prevProps
.
processFlag
||
source
!==
prevProps
.
source
)
{
const
{
renderCounter
,
source
}
=
this
.
props
;
if
(
renderCounter
!==
prevProps
.
renderCounter
||
source
!==
prevProps
.
source
)
{
this
.
setState
({
values
:
this
.
props
.
getProcessedValues
()
});
}
}
...
...
public/app/plugins/panel/singlestat2/SingleStatPanel.tsx
View file @
531176b5
...
...
@@ -50,8 +50,7 @@ export class SingleStatPanel extends PureComponent<PanelProps<SingleStatOptions>
};
render
()
{
const
{
height
,
width
,
options
,
panelData
}
=
this
.
props
;
const
{
orientation
}
=
options
;
const
{
height
,
width
,
options
,
panelData
,
renderCounter
}
=
this
.
props
;
return
(
<
ProcessedValuesRepeater
getProcessedValues=
{
this
.
getProcessedValues
}
...
...
@@ -59,7 +58,8 @@ export class SingleStatPanel extends PureComponent<PanelProps<SingleStatOptions>
width=
{
width
}
height=
{
height
}
source=
{
panelData
}
orientation=
{
orientation
}
renderCounter=
{
renderCounter
}
orientation=
{
options
.
orientation
}
/>
);
}
...
...
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