Commit 0108b5eb by bergquist Committed by David Keijser

fix(singlestat): adds support for lighttheme

parent 0c6841bd
...@@ -7,6 +7,7 @@ import 'jquery.flot'; ...@@ -7,6 +7,7 @@ import 'jquery.flot';
import 'jquery.flot.gauge'; import 'jquery.flot.gauge';
import kbn from 'app/core/utils/kbn'; import kbn from 'app/core/utils/kbn';
import config from 'app/core/config';
import TimeSeries from 'app/core/time_series2'; import TimeSeries from 'app/core/time_series2';
import {MetricsPanelCtrl} from 'app/plugins/sdk'; import {MetricsPanelCtrl} from 'app/plugins/sdk';
...@@ -283,7 +284,7 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -283,7 +284,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
top: '10px', top: '10px',
margin: 'auto', margin: 'auto',
position: 'relative', position: 'relative',
height: elem.height() + 'px', height: (elem.height() * 0.9) + 'px',
width: elem.width() + 'px' width: elem.width() + 'px'
}; };
...@@ -301,13 +302,17 @@ class SingleStatCtrl extends MetricsPanelCtrl { ...@@ -301,13 +302,17 @@ class SingleStatCtrl extends MetricsPanelCtrl {
color: data.colorMap[data.colorMap.length - 1] color: data.colorMap[data.colorMap.length - 1]
}); });
var bgColor = config.bootData.user.lightTheme
? 'rgb(230,230,230)'
: 'rgb(38,38,38)';
var options = { var options = {
series: { series: {
gauges: { gauges: {
gauge: { gauge: {
min: panel.gauge.minValue, min: panel.gauge.minValue,
max: panel.gauge.maxValue, max: panel.gauge.maxValue,
background: { color: 'rgb(38,38,38)'}, background: { color: bgColor },
border: { color: null }, border: { color: null },
shadow: { show: false }, shadow: { show: false },
width: 38 width: 38
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment