metric_agg.html 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <div class="gf-form-inline" ng-class="{'gf-form-disabled': agg.hide}">
  2. <div class="gf-form">
  3. <label class="gf-form-label query-keyword width-7">
  4. Metric
  5. &nbsp;
  6. <a ng-click="toggleShowMetric()" bs-tooltip="'Click to toggle show / hide metric'">
  7. <i class="fa fa-eye" ng-hide="agg.hide"></i>
  8. <i class="fa fa-eye-slash" ng-show="agg.hide"></i>
  9. </a>
  10. </label>
  11. </div>
  12. <div class="gf-form">
  13. <metric-segment-model property="agg.type" options="metricAggTypes" on-change="onTypeChange()" custom="false" css-class="width-10"></metric-segment-model>
  14. <metric-segment-model ng-if="aggDef.requiresField" property="agg.field" get-options="getFieldsInternal()" on-change="onChange()" css-class="width-12"></metric-segment-model>
  15. <metric-segment-model ng-if="aggDef.isPipelineAgg" property="agg.pipelineAgg" options="pipelineAggOptions" on-change="onChangeInternal()" custom="false" css-class="width-12"></metric-segment-model>
  16. </div>
  17. <div class="gf-form gf-form--grow">
  18. <label class="gf-form-label gf-form-label--grow">
  19. <a ng-click="toggleOptions()" ng-if="settingsLinkText">
  20. <i class="fa fa-caret-down" ng-show="showOptions"></i>
  21. <i class="fa fa-caret-right" ng-hide="showOptions"></i>
  22. {{settingsLinkText}}
  23. </a>
  24. </label>
  25. </div>
  26. <div class="gf-form">
  27. <label class="gf-form-label" ng-if="isFirst">
  28. <a class="pointer" ng-click="addMetricAgg()"><i class="fa fa-plus"></i></a>
  29. </label>
  30. <label class="gf-form-label" ng-if="!isSingle">
  31. <a class="pointer" ng-click="removeMetricAgg()"><i class="fa fa-minus"></i></a>
  32. </label>
  33. </div>
  34. </div>
  35. <div class="gf-form-group" ng-if="showOptions">
  36. <div class="gf-form offset-width-7" ng-if="agg.type === 'derivative'">
  37. <label class="gf-form-label width-10">Unit</label>
  38. <input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.unit" ng-blur="onChangeInternal()" spellcheck='false'>
  39. </div>
  40. <div class="gf-form offset-width-7" ng-if="agg.type === 'moving_avg'">
  41. <label class="gf-form-label width-10">Window</label>
  42. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.window" ng-blur="onChangeInternal()" spellcheck='false'>
  43. </div>
  44. <div class="gf-form offset-width-7" ng-if="agg.type === 'moving_avg'">
  45. <label class="gf-form-label width-10">Model</label>
  46. <input type="text" class="gf-form-input max-width-12" ng-change="onChangeInternal()" ng-model="agg.settings.model" blur="onChange()" spellcheck='false'>
  47. </div>
  48. <div class="gf-form offset-width-7" ng-if="agg.type === 'percentiles'">
  49. <label class="gf-form-label width-10">Percentiles</label>
  50. <input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.percents" array-join ng-blur="onChange()"></input>
  51. </div>
  52. <div ng-if="agg.type === 'extended_stats'">
  53. <gf-form-switch ng-repeat="stat in extendedStats" class="gf-form offset-width-7" label="{{stat.text}}" label-class="width-10" checked="agg.meta[stat.value]" on-change="onChangeInternal()"></gf-form-switch>
  54. <div class="gf-form offset-width-7">
  55. <label class="gf-form-label width-10">Sigma</label>
  56. <input type="number" class="gf-form-input max-width-12" placeholder="3" ng-model="agg.settings.sigma" ng-blur="onChange()"></input>
  57. </div>
  58. </div>
  59. <div class="gf-form offset-width-7" ng-if="aggDef.supportsInlineScript">
  60. <label class="gf-form-label width-10">Script</label>
  61. <input type="text" class="gf-form-input max-width-12" empty-to-null ng-model="agg.inlineScript" ng-blur="onChangeInternal()" spellcheck='false' placeholder="_value * 1">
  62. </div>
  63. <div class="gf-form offset-width-7" ng-if="aggDef.supportsMissing">
  64. <label class="gf-form-label width-10">
  65. Missing
  66. <tip>The missing parameter defines how documents that are missing a value should be treated. By default they will be ignored but it is also possible to treat them as if they had a value</tip>
  67. </label>
  68. <input type="number" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  69. </div>
  70. </div>