Disable prefix and postfix font size when gauge mode is enabled (#10573)

* Disable prefix and postfix font size when gauge mode is enabled

* Use function to hide prefix/postfix size when using gauge

* Rename disableFontSizes to canChangeFontSizes
This commit is contained in:
Jonathan McCall 2018-01-25 03:27:25 -05:00 committed by Torkel Ödegaard
parent 31a5134a0f
commit 579d2b63f8
2 changed files with 6 additions and 2 deletions

View File

@ -29,7 +29,7 @@
<input type="text" class="gf-form-input width-12" ng-model="ctrl.panel.prefix" ng-change="ctrl.render()" ng-model-onblur>
<label class="gf-form-label width-6">Font size</label>
<div class="gf-form-select-wrapper">
<select class="gf-form-input" ng-model="ctrl.panel.prefixFontSize" ng-options="f for f in ctrl.fontSizes" ng-change="ctrl.render()"></select>
<select class="gf-form-input" ng-model="ctrl.panel.prefixFontSize" ng-options="f for f in ctrl.fontSizes" ng-change="ctrl.render()" ng-disabled="ctrl.canChangeFontSize()"></select>
</div>
</div>
</div>
@ -39,7 +39,7 @@
<input type="text" class="gf-form-input width-12" ng-model="ctrl.panel.postfix" ng-change="ctrl.render()" ng-model-onblur>
<label class="gf-form-label width-6">Font size</label>
<div class="gf-form-select-wrapper">
<select class="input-small gf-form-input" ng-model="ctrl.panel.postfixFontSize" ng-options="f for f in ctrl.fontSizes" ng-change="ctrl.render()"></select>
<select class="input-small gf-form-input" ng-model="ctrl.panel.postfixFontSize" ng-options="f for f in ctrl.fontSizes" ng-change="ctrl.render()" ng-disabled="ctrl.canChangeFontSize()"></select>
</div>
</div>
<div class="gf-form">

View File

@ -198,6 +198,10 @@ class SingleStatCtrl extends MetricsPanelCtrl {
this.setValueMapping(data);
}
canChangeFontSize() {
return this.panel.gauge.show;
}
setColoring(options) {
if (options.background) {
this.panel.colorValue = false;