Merge "Add gauge caps for singlestat panel."

This commit is contained in:
Zuul 2018-03-15 02:56:39 +00:00 committed by Gerrit Code Review
commit 8f729842b3
3 changed files with 22 additions and 0 deletions

View File

@ -39,6 +39,14 @@ class Singlestat(Base):
v.Required('show', default=False): v.All(bool),
}
gauge = {
v.Required('maxValue'): v.All(int),
v.Required('minValue'): v.Any(int),
v.Required('show', default=False): v.All(bool),
v.Required('thresholdLabels', default=False): v.All(bool),
v.Required('thresholdMarkers', default=False): v.All(bool),
}
singlestat = {
v.Required('colorBackground', default=False): v.All(bool),
v.Required('colorValue', default=False): v.All(bool),
@ -64,6 +72,7 @@ class Singlestat(Base):
'avg', 'current', 'max', 'min', 'total'),
v.Optional('datasource'): v.All(str),
v.Optional('decimals'): v.All(int, v.Range(min=0, max=12)),
v.Optional('gauge'): gauge,
v.Optional('hideTimeOverride'): v.All(bool),
v.Optional('timeFrom'): v.All(v.Match(r'[1-9]+[0-9]*[smhdw]')),
v.Optional('timeShift'): v.All(v.Match(r'[1-9]+[0-9]*[smhdw]')),

View File

@ -12,6 +12,13 @@
"colorValue": false,
"editable": true,
"error": false,
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": true,
"thresholdLabels": false,
"thresholdMarkers": true
},
"hideTimeOverride": true,
"maxDataPoints": 100,
"postfix": "",

View File

@ -9,3 +9,9 @@ dashboard:
timeFrom: 10d
timeShift: 1h
hideTimeOverride: true
gauge:
maxValue: 100
minValue: 0
show: true
thresholdLabels: false
thresholdMarkers: true