metric_agg.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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 ng-if="agg.type === 'moving_avg'">
  41. <div class="gf-form offset-width-7">
  42. <label class="gf-form-label width-10">Model</label>
  43. <metric-segment-model property="agg.settings.model" options="movingAvgModelTypes" on-change="onChangeClearInternal()" custom="false" css-class="width-12"></metric-segment-model>
  44. </div>
  45. <div class="gf-form offset-width-7">
  46. <label class="gf-form-label width-10">Window</label>
  47. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.window" ng-blur="onChangeInternal()" spellcheck='false'>
  48. </div>
  49. <div class="gf-form offset-width-7">
  50. <label class="gf-form-label width-10">Predict</label>
  51. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.predict" ng-blur="onChangeInternal()" spellcheck='false'>
  52. </div>
  53. <div class="gf-form offset-width-7" ng-repeat="setting in modelSettings">
  54. <label class="gf-form-label width-10">{{setting.text}}</label>
  55. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.settings[setting.value]" ng-blur="onChangeInternal()" spellcheck='false'>
  56. </div>
  57. <gf-form-switch ng-if="agg.settings.model == 'holt_winters'" class="gf-form offset-width-7" label="Pad" label-class="width-10" checked="agg.settings.settings.pad" on-change="onChangeInternal()"></gf-form-switch>
  58. <gf-form-switch ng-if="agg.settings.model.match('ewma|holt_winters|holt') !== null" class="gf-form offset-width-7" label="Minimize" label-class="width-10" checked="agg.settings.minimize" on-change="onChangeInternal()"></gf-form-switch>
  59. </div>
  60. <div class="gf-form offset-width-7" ng-if="agg.type === 'percentiles'">
  61. <label class="gf-form-label width-10">Percentiles</label>
  62. <input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.percents" array-join ng-blur="onChange()"></input>
  63. </div>
  64. <div class="gf-form offset-width-7" ng-if="agg.type === 'raw_document'">
  65. <label class="gf-form-label width-10">Size</label>
  66. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.size" ng-blur="onChange()"></input>
  67. </div>
  68. <div class="gf-form offset-width-7" ng-if="agg.type === 'cardinality'">
  69. <label class="gf-form-label width-10">Precision threshold</label>
  70. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision_threshold" ng-blur="onChange()"></input>
  71. </div>
  72. <div ng-if="agg.type === 'extended_stats'">
  73. <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>
  74. <div class="gf-form offset-width-7">
  75. <label class="gf-form-label width-10">Sigma</label>
  76. <input type="number" class="gf-form-input max-width-12" placeholder="3" ng-model="agg.settings.sigma" ng-blur="onChange()"></input>
  77. </div>
  78. </div>
  79. <div class="gf-form offset-width-7" ng-if="aggDef.supportsInlineScript">
  80. <label class="gf-form-label width-10">Script</label>
  81. <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">
  82. </div>
  83. <div class="gf-form offset-width-7" ng-if="aggDef.supportsMissing">
  84. <label class="gf-form-label width-10">
  85. Missing
  86. <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>
  87. </label>
  88. <input type="number" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  89. </div>
  90. </div>