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
f7cb5a1f
Commit
f7cb5a1f
authored
Dec 11, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changing type and started on Gauge
parent
0ba75a88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
public/app/plugins/panel/gauge/MappingRow.tsx
+1
-1
public/app/viz/Gauge.tsx
+12
-8
No files found.
public/app/plugins/panel/gauge/MappingRow.tsx
View file @
f7cb5a1f
...
@@ -159,7 +159,7 @@ export default class MappingRow extends PureComponent<Props, State> {
...
@@ -159,7 +159,7 @@ export default class MappingRow extends PureComponent<Props, State> {
value=
{
mappingOptions
.
find
(
o
=>
o
.
value
===
mapping
.
type
)
}
value=
{
mappingOptions
.
find
(
o
=>
o
.
value
===
mapping
.
type
)
}
getOptionLabel=
{
i
=>
i
.
label
}
getOptionLabel=
{
i
=>
i
.
label
}
getOptionValue=
{
i
=>
i
.
value
}
getOptionValue=
{
i
=>
i
.
value
}
onSelected=
{
type
=>
this
.
onMappingTypeChange
(
type
)
}
onSelected=
{
type
=>
this
.
onMappingTypeChange
(
type
.
value
)
}
width=
{
7
}
width=
{
7
}
/>
/>
</
div
>
</
div
>
...
...
public/app/viz/Gauge.tsx
View file @
f7cb5a1f
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
$
from
'jquery'
;
import
$
from
'jquery'
;
import
{
Threshold
,
TimeSeriesVMs
}
from
'app/types'
;
import
{
RangeMap
,
Threshold
,
TimeSeriesVMs
,
ValueMap
}
from
'app/types'
;
import
config
from
'../core/config'
;
import
config
from
'../core/config'
;
import
kbn
from
'../core/utils/kbn'
;
import
kbn
from
'../core/utils/kbn'
;
interface
Props
{
interface
Props
{
decimals
:
number
;
decimals
:
number
;
height
:
number
;
mappings
:
Array
<
RangeMap
|
ValueMap
>
;
maxValue
:
number
;
minValue
:
number
;
prefix
:
string
;
timeSeries
:
TimeSeriesVMs
;
timeSeries
:
TimeSeriesVMs
;
showThresholdMarkers
:
boolean
;
thresholds
:
Threshold
[];
thresholds
:
Threshold
[];
showThresholdMarkers
:
boolean
;
showThresholdLabels
:
boolean
;
showThresholdLabels
:
boolean
;
unit
:
string
;
width
:
number
;
height
:
number
;
stat
:
string
;
stat
:
string
;
prefix
:
string
;
suffix
:
string
;
suffix
:
string
;
unit
:
string
;
width
:
number
;
}
}
export
class
Gauge
extends
PureComponent
<
Props
>
{
export
class
Gauge
extends
PureComponent
<
Props
>
{
canvasElement
:
any
;
canvasElement
:
any
;
static
defaultProps
=
{
static
defaultProps
=
{
minValue
:
0
,
maxValue
:
100
,
maxValue
:
100
,
mappings
:
[],
minValue
:
0
,
prefix
:
''
,
prefix
:
''
,
showThresholdMarkers
:
true
,
showThresholdMarkers
:
true
,
showThresholdLabels
:
false
,
showThresholdLabels
:
false
,
suffix
:
''
,
suffix
:
''
,
unit
:
'none'
,
thresholds
:
[
thresholds
:
[
{
label
:
'Min'
,
value
:
0
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
label
:
'Min'
,
value
:
0
,
color
:
'rgba(50, 172, 45, 0.97)'
},
{
label
:
'Max'
,
value
:
100
,
color
:
'rgba(245, 54, 54, 0.9)'
},
{
label
:
'Max'
,
value
:
100
,
color
:
'rgba(245, 54, 54, 0.9)'
},
],
],
unit
:
'none'
,
};
};
componentDidMount
()
{
componentDidMount
()
{
...
...
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