Merge "Additional fields for singlestat panel"

This commit is contained in:
Jenkins 2015-11-13 08:58:17 +00:00 committed by Gerrit Code Review
commit 0235a91b29
2 changed files with 20 additions and 0 deletions

View File

@ -75,11 +75,26 @@ class Panel(object):
v.Required('colorBackground', default=False): v.All(bool),
v.Required('colorValue', default=False): v.All(bool),
v.Required('maxDataPoints', default=100): v.All(int),
v.Required('postfix', default=''): v.All(str),
# Support 0% to 200% by 10
v.Required(
'postfixFontSize', default='50%'): v.All(
v.Match(r'^[1-9]?[0]{1}%$|^1[0-9]?[0]{1}%$|^200%$')),
v.Required('prefix', default=''): v.All(str),
# Support 0% to 200% by 10
v.Required(
'prefixFontSize', default='50%'): v.All(
v.Match(r'^[1-9]?[0]{1}%$|^1[0-9]?[0]{1}%$|^200%$')),
v.Required('sparkline', default=sparkline_defaults): sparkline,
v.Required('targets', default=[]): v.All(list),
v.Required('thresholds', default=''): v.All(str),
# Support 0% to 200% by 10
v.Required(
'valueFontSize', default='80%'): v.All(
v.Match(r'^[1-9]?[0]{1}%$|^1[0-9]?[0]{1}%$|^200%$')),
v.Required('valueName', default='avg'): v.All(
'avg', 'current', 'max', 'min', 'total'),
v.Optional('decimals'): v.All(int, v.Range(min=0, max=12)),
}
self.singlestat.update(self.base)

View File

@ -13,6 +13,10 @@
"editable": true,
"error": false,
"maxDataPoints": 100,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"span": 12,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
@ -24,6 +28,7 @@
"thresholds": "",
"title": "no title (click here)",
"type": "singlestat",
"valueFontSize": "80%",
"valueName": "avg"
}
],