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
8615de81
Commit
8615de81
authored
Dec 13, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moving min/max to gauge options
parent
1f533ddf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
14 deletions
+25
-14
public/app/plugins/panel/gauge/GaugeOptions.tsx
+17
-4
public/app/plugins/panel/gauge/Thresholds.tsx
+8
-10
No files found.
public/app/plugins/panel/gauge/GaugeOptions.tsx
View file @
8615de81
import
React
,
{
PureComponent
}
from
'react'
;
import
{
Switch
}
from
'app/core/components/Switch/Switch'
;
import
{
OptionModuleProps
}
from
'./module'
;
import
{
Label
}
from
'../../../core/components/Label/Label'
;
export
default
class
GaugeOptions
extends
PureComponent
<
OptionModuleProps
>
{
t
oggleThresholdLabels
=
()
=>
onT
oggleThresholdLabels
=
()
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showThresholdLabels
:
!
this
.
props
.
options
.
showThresholdLabels
});
t
oggleThresholdMarkers
=
()
=>
onT
oggleThresholdMarkers
=
()
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
showThresholdMarkers
:
!
this
.
props
.
options
.
showThresholdMarkers
});
onMinValueChange
=
({
target
})
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
minValue
:
target
.
value
});
onMaxValueChange
=
({
target
})
=>
this
.
props
.
onChange
({
...
this
.
props
.
options
,
maxValue
:
target
.
value
});
render
()
{
const
{
showThresholdLabels
,
showThresholdMarkers
}
=
this
.
props
.
options
;
...
...
@@ -20,7 +25,7 @@ export default class GaugeOptions extends PureComponent<OptionModuleProps> {
label=
"Threshold labels"
labelClass=
"width-10"
checked=
{
showThresholdLabels
}
onChange=
{
this
.
t
oggleThresholdLabels
}
onChange=
{
this
.
onT
oggleThresholdLabels
}
/>
</
div
>
<
div
className=
"gf-form-inline"
>
...
...
@@ -28,9 +33,17 @@ export default class GaugeOptions extends PureComponent<OptionModuleProps> {
label=
"Threshold markers"
labelClass=
"width-10"
checked=
{
showThresholdMarkers
}
onChange=
{
this
.
t
oggleThresholdMarkers
}
onChange=
{
this
.
onT
oggleThresholdMarkers
}
/>
</
div
>
<
div
className=
"gf-form-inline"
>
<
Label
width=
{
6
}
>
Min value
</
Label
>
<
input
type=
"text"
className=
"gf-form-input width-12"
onChange=
{
this
.
onMinValueChange
}
/>
</
div
>
<
div
className=
"gf-form-inline"
>
<
Label
width=
{
6
}
>
Max value
</
Label
>
<
input
type=
"text"
className=
"gf-form-input width-12"
onChange=
{
this
.
onMaxValueChange
}
/>
</
div
>
</
div
>
);
}
...
...
public/app/plugins/panel/gauge/Thresholds.tsx
View file @
8615de81
...
...
@@ -169,22 +169,20 @@ export default class Thresholds extends PureComponent<OptionModuleProps, State>
const
rowStyle
=
classNames
({
'threshold-row'
:
true
,
'threshold-row-min'
:
index
===
0
,
'threshold-row-max'
:
index
===
thresholds
.
length
-
1
,
});
return
(
<
div
className=
{
rowStyle
}
key=
{
`${threshold.index}-${index}`
}
>
<
div
className=
"threshold-row-inner"
>
<
div
className=
"threshold-row-color"
>
{
threshold
.
color
&&
index
!==
thresholds
.
length
-
1
&&
(
<
div
className=
"threshold-row-color-inner"
>
<
ColorPicker
color=
{
threshold
.
color
}
onChange=
{
color
=>
this
.
onChangeThresholdColor
(
threshold
,
color
)
}
/>
</
div
>
)
}
{
threshold
.
color
&&
(
<
div
className=
"threshold-row-color-inner"
>
<
ColorPicker
color=
{
threshold
.
color
}
onChange=
{
color
=>
this
.
onChangeThresholdColor
(
threshold
,
color
)
}
/>
</
div
>
)
}
</
div
>
<
input
className=
"threshold-row-input"
...
...
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