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
0016ad2c
Unverified
Commit
0016ad2c
authored
Mar 05, 2019
by
Torkel Ödegaard
Committed by
GitHub
Mar 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15774 from ryantxu/set-options
Rename PanelEditorProps.onChange to onOptionsChange
parents
57810ea5
3d165284
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
14 deletions
+17
-14
packages/grafana-ui/src/types/panel.ts
+1
-1
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
+1
-1
public/app/plugins/panel/gauge/GaugeOptionsBox.tsx
+7
-4
public/app/plugins/panel/gauge/GaugePanelEditor.tsx
+5
-5
public/app/plugins/panel/graph2/GraphPanelEditor.tsx
+3
-3
No files found.
packages/grafana-ui/src/types/panel.ts
View file @
0016ad2c
...
...
@@ -22,7 +22,7 @@ export interface PanelData {
export
interface
PanelEditorProps
<
T
=
any
>
{
options
:
T
;
onChange
:
(
options
:
T
)
=>
void
;
on
Options
Change
:
(
options
:
T
)
=>
void
;
}
export
class
ReactPanelPlugin
<
TOptions
=
any
>
{
...
...
public/app/features/dashboard/panel_editor/VisualizationTab.tsx
View file @
0016ad2c
...
...
@@ -66,7 +66,7 @@ export class VisualizationTab extends PureComponent<Props, State> {
const
PanelEditor
=
plugin
.
exports
.
reactPanel
.
editor
;
if
(
PanelEditor
)
{
return
<
PanelEditor
options=
{
this
.
getReactPanelOptions
()
}
onChange=
{
this
.
onPanelOptionsChanged
}
/>;
return
<
PanelEditor
options=
{
this
.
getReactPanelOptions
()
}
on
Options
Change=
{
this
.
onPanelOptionsChanged
}
/>;
}
}
...
...
public/app/plugins/panel/gauge/GaugeOptionsBox.tsx
View file @
0016ad2c
...
...
@@ -10,14 +10,17 @@ import { GaugeOptions } from './types';
export
class
GaugeOptionsBox
extends
PureComponent
<
PanelEditorProps
<
GaugeOptions
>>
{
onToggleThresholdLabels
=
()
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showThresholdLabels
:
!
this
.
props
.
options
.
showThresholdLabels
});
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
showThresholdLabels
:
!
this
.
props
.
options
.
showThresholdLabels
});
onToggleThresholdMarkers
=
()
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showThresholdMarkers
:
!
this
.
props
.
options
.
showThresholdMarkers
});
this
.
props
.
onOptionsChange
({
...
this
.
props
.
options
,
showThresholdMarkers
:
!
this
.
props
.
options
.
showThresholdMarkers
,
});
onMinValueChange
=
({
target
})
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
minValue
:
target
.
value
});
onMinValueChange
=
({
target
})
=>
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
minValue
:
target
.
value
});
onMaxValueChange
=
({
target
})
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
maxValue
:
target
.
value
});
onMaxValueChange
=
({
target
})
=>
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
maxValue
:
target
.
value
});
render
()
{
const
{
options
}
=
this
.
props
;
...
...
public/app/plugins/panel/gauge/GaugePanelEditor.tsx
View file @
0016ad2c
...
...
@@ -14,31 +14,31 @@ import { GaugeOptions, SingleStatValueOptions } from './types';
export
class
GaugePanelEditor
extends
PureComponent
<
PanelEditorProps
<
GaugeOptions
>>
{
onThresholdsChanged
=
(
thresholds
:
Threshold
[])
=>
this
.
props
.
onChange
({
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
thresholds
,
});
onValueMappingsChanged
=
(
valueMappings
:
ValueMapping
[])
=>
this
.
props
.
onChange
({
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
valueMappings
,
});
onValueOptionsChanged
=
(
valueOptions
:
SingleStatValueOptions
)
=>
this
.
props
.
onChange
({
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
valueOptions
,
});
render
()
{
const
{
onChange
,
options
}
=
this
.
props
;
const
{
on
Options
Change
,
options
}
=
this
.
props
;
return
(
<>
<
PanelOptionsGrid
>
<
SingleStatValueEditor
onChange=
{
this
.
onValueOptionsChanged
}
options=
{
options
.
valueOptions
}
/>
<
GaugeOptionsBox
on
Change=
{
on
Change
}
options=
{
options
}
/>
<
GaugeOptionsBox
on
OptionsChange=
{
onOptions
Change
}
options=
{
options
}
/>
<
ThresholdsEditor
onChange=
{
this
.
onThresholdsChanged
}
thresholds=
{
options
.
thresholds
}
/>
</
PanelOptionsGrid
>
...
...
public/app/plugins/panel/graph2/GraphPanelEditor.tsx
View file @
0016ad2c
...
...
@@ -8,15 +8,15 @@ import { Options } from './types';
export
class
GraphPanelEditor
extends
PureComponent
<
PanelEditorProps
<
Options
>>
{
onToggleLines
=
()
=>
{
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showLines
:
!
this
.
props
.
options
.
showLines
});
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
showLines
:
!
this
.
props
.
options
.
showLines
});
};
onToggleBars
=
()
=>
{
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showBars
:
!
this
.
props
.
options
.
showBars
});
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
showBars
:
!
this
.
props
.
options
.
showBars
});
};
onTogglePoints
=
()
=>
{
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showPoints
:
!
this
.
props
.
options
.
showPoints
});
this
.
props
.
on
Options
Change
({
...
this
.
props
.
options
,
showPoints
:
!
this
.
props
.
options
.
showPoints
});
};
render
()
{
...
...
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