editor.html 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <div class="editor-row">
  2. <div class="grafana-info-box" ng-if="ctrl.panel.gauge.show">
  3. <h5>Gauge Migration</h5>
  4. <p>
  5. Gauge visualizations within the Singlestat panel are deprecated. Please
  6. migrate this panel to use the Gauge panel
  7. <div class="gf-form-button-row">
  8. <button class="btn btn-primary" ng-click="ctrl.migrateToGaugePanel(true)">
  9. Migrate to Gauge Panel
  10. </button>
  11. <button class="btn btn-inverse" ng-click="ctrl.migrateToGaugePanel(false)">
  12. Show as single stat
  13. </button>
  14. </div>
  15. <br/>
  16. <div ng-if="ctrl.panel.sparkline.show">
  17. <b>NOTE:</b> Sparklines are not supported in the gauge panel
  18. </div>
  19. <div ng-if="ctrl.panel.prefix">
  20. <b>NOTE:</b> Prefix will not be show in the gauge panel
  21. </div>
  22. <div ng-if="ctrl.panel.postfix">
  23. <b>NOTE:</b> Postfix will not be show in the gauge panel
  24. </div>
  25. <div ng-if="ctrl.panel.links && ctrl.panel.links.length">
  26. <b>NOTE:</b> Links will be in the upper left corner, rather than anywhere on the gauge
  27. </div>
  28. </p>
  29. </div>
  30. <div class="section gf-form-group">
  31. <h5 class="section-heading">Value</h5>
  32. <div class="gf-form-inline">
  33. <div class="gf-form" ng-show="ctrl.dataType === 'timeseries'">
  34. <label class="gf-form-label width-6">Stat</label>
  35. <div class="gf-form-select-wrapper width-12">
  36. <select class="gf-form-input" ng-model="ctrl.panel.valueName" ng-options="f.value as f.text for f in ctrl.valueNameOptions" ng-change="ctrl.refresh()"></select>
  37. </div>
  38. </div>
  39. <div class="gf-form" ng-show="ctrl.dataType === 'table'">
  40. <label class="gf-form-label width-6">Column</label>
  41. <div class="gf-form-select-wrapper width-12">
  42. <select class="gf-form-input" ng-model="ctrl.panel.tableColumn" ng-options="f for f in ctrl.tableColumnOptions" ng-change="ctrl.refresh()"></select>
  43. </div>
  44. </div>
  45. <div class="gf-form">
  46. <label class="gf-form-label width-6">Font size</label>
  47. <div class="gf-form-select-wrapper">
  48. <select class="gf-form-input" ng-model="ctrl.panel.valueFontSize" ng-options="f for f in ctrl.fontSizes" ng-change="ctrl.render()"></select>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="gf-form-inline">
  53. <div class="gf-form">
  54. <label class="gf-form-label width-6">Prefix</label>
  55. <input type="text" class="gf-form-input width-12" ng-model="ctrl.panel.prefix" ng-change="ctrl.render()" ng-model-onblur>
  56. <label class="gf-form-label width-6">Font size</label>
  57. <div class="gf-form-select-wrapper">
  58. <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.canModifyText()"></select>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="gf-form">
  63. <label class="gf-form-label width-6">Postfix</label>
  64. <input type="text" class="gf-form-input width-12" ng-model="ctrl.panel.postfix" ng-change="ctrl.render()" ng-model-onblur>
  65. <label class="gf-form-label width-6">Font size</label>
  66. <div class="gf-form-select-wrapper">
  67. <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.canModifyText()"></select>
  68. </div>
  69. </div>
  70. <div class="gf-form">
  71. <label class="gf-form-label width-6">Unit</label>
  72. <div class="gf-form-dropdown-typeahead width-18" ng-model="ctrl.panel.format" dropdown-typeahead2="ctrl.unitFormats" dropdown-typeahead-on-select="ctrl.setUnitFormat($subItem)"></div>
  73. </div>
  74. <div class="gf-form">
  75. <label class="gf-form-label width-6">Decimals</label>
  76. <input type="number" class="gf-form-input width-18" placeholder="auto" data-placement="right" bs-tooltip="'Override automatic decimal precision for legend and tooltips'" ng-model="ctrl.panel.decimals" ng-change="ctrl.refresh()" ng-model-onblur>
  77. </div>
  78. </div>
  79. <div class="section gf-form-group">
  80. <h5 class="section-heading">Coloring</h5>
  81. <div class="gf-form-inline">
  82. <gf-form-switch class="gf-form" label-class="width-8" label="Background" checked="ctrl.panel.colorBackground" on-change="ctrl.render()"></gf-form-switch>
  83. <gf-form-switch class="gf-form" label-class="width-6" label="Value" checked="ctrl.panel.colorValue" on-change="ctrl.render()"></gf-form-switch>
  84. </div>
  85. <div class="gf-form-inline">
  86. <gf-form-switch class="gf-form" label-class="width-8" label="Prefix" checked="ctrl.panel.colorPrefix" on-change="ctrl.render()" ng-disabled="!ctrl.canModifyText()"></gf-form-switch>
  87. <gf-form-switch class="gf-form" label-class="width-6" label="Postfix" checked="ctrl.panel.colorPostfix" on-change="ctrl.render()" ng-disabled="!ctrl.canModifyText()"></gf-form-switch>
  88. </div>
  89. <div class="gf-form-inline">
  90. <div class="gf-form max-width-21">
  91. <label class="gf-form-label width-8">Thresholds
  92. <tip>Define two threshold values&lt;br /&gt; 50,80 will produce: value &lt; 50 = Green, 50 &lt;= value &lt; 80 = Yellow, value &gt;= 80 = Red</tip>
  93. </label>
  94. <input type="text" class="gf-form-input" ng-model="ctrl.panel.thresholds" ng-blur="ctrl.render()" placeholder="50,80"></input>
  95. </div>
  96. </div>
  97. <div class="gf-form">
  98. <label class="gf-form-label width-8">Colors</label>
  99. <span class="gf-form-label" ng-repeat="color in ctrl.panel.colors track by $index">
  100. <color-picker color="color" onChange="ctrl.onColorChange($index)"></color-picker>
  101. </span>
  102. <span class="gf-form-label">
  103. <a ng-click="ctrl.invertColorOrder()">
  104. Invert
  105. </a>
  106. </span>
  107. </div>
  108. </div>
  109. <div class="section gf-form-group">
  110. <h5 class="section-heading">Spark lines</h5>
  111. <gf-form-switch class="gf-form" label-class="width-9" label="Show" checked="ctrl.panel.sparkline.show" on-change="ctrl.render()"></gf-form-switch>
  112. <div ng-if="ctrl.panel.sparkline.show">
  113. <gf-form-switch class="gf-form" label-class="width-9" label="Full height" checked="ctrl.panel.sparkline.full" on-change="ctrl.render()"></gf-form-switch>
  114. <div class="gf-form">
  115. <label class="gf-form-label width-9">Y-Min</label>
  116. <input type="number" class="gf-form-input width-5" placeholder="auto" data-placement="right" ng-model="ctrl.panel.sparkline.ymin" ng-change="ctrl.render()" ng-model-onblur empty-to-null>
  117. </div>
  118. <div class="gf-form">
  119. <label class="gf-form-label width-9">Y-Max</label>
  120. <input type="number" class="gf-form-input width-5" placeholder="auto" data-placement="right" ng-model="ctrl.panel.sparkline.ymax" ng-change="ctrl.render()" ng-model-onblur empty-to-null>
  121. </div>
  122. <div class="gf-form">
  123. <label class="gf-form-label width-9">Line Color</label>
  124. <span class="gf-form-label">
  125. <color-picker color="ctrl.panel.sparkline.lineColor" onChange="ctrl.onSparklineColorChange"></color-picker>
  126. </span>
  127. </div>
  128. <div class="gf-form">
  129. <label class="gf-form-label width-9">Fill Color</label>
  130. <span class="gf-form-label">
  131. <color-picker color="ctrl.panel.sparkline.fillColor" onChange="ctrl.onSparklineFillChange"></color-picker>
  132. </span>
  133. </div>
  134. </div>
  135. </div>
  136. <div class="section gf-form-group">
  137. <h5 class="section-heading">Gauge</h5>
  138. <gf-form-switch class="gf-form" label-class="width-10" switch-class="max-width-6" label="Show" checked="ctrl.panel.gauge.show" on-change="ctrl.render()"></gf-form-switch>
  139. <div ng-if="ctrl.panel.gauge.show">
  140. <div class="gf-form">
  141. <label class="gf-form-label width-10">Min</label>
  142. <input type="number" class="gf-form-input width-6" placeholder="0" data-placement="right" ng-model="ctrl.panel.gauge.minValue" ng-change="ctrl.refresh()" ng-model-onblur>
  143. <label class="gf-form-label alert-state-critical" ng-show="ctrl.invalidGaugeRange">
  144. &nbsp; <i class="fa fa-warning"></i>
  145. Min value is bigger than max.
  146. </label>
  147. </div>
  148. <div class="gf-form">
  149. <label class="gf-form-label width-10">Max</label>
  150. <input type="number" class="gf-form-input width-6" placeholder="0" data-placement="right" ng-model="ctrl.panel.gauge.maxValue" ng-change="ctrl.refresh()" ng-model-onblur>
  151. </div>
  152. <gf-form-switch class="gf-form" label-class="width-10" switch-class="max-width-6" label="Threshold labels" checked="ctrl.panel.gauge.thresholdLabels" on-change="ctrl.render()"></gf-form-switch>
  153. <gf-form-switch class="gf-form" label-class="width-10" switch-class="max-width-6" label="Threshold markers" checked="ctrl.panel.gauge.thresholdMarkers" on-change="ctrl.render()"></gf-form-switch>
  154. </div>
  155. </div>
  156. </div>