metric_agg.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 && !aggDef.supportsMultipleBucketPaths" 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" ng-if="aggDef.isPipelineAgg && aggDef.supportsMultipleBucketPaths">
  18. <label class="gf-form-label gf-form-label--grow">
  19. <a ng-click="toggleVariables()">
  20. <i class="fa fa-caret-down" ng-show="showVariables"></i>
  21. <i class="fa fa-caret-right" ng-hide="showVariables"></i>
  22. {{variablesLinkText}}
  23. </a>
  24. </label>
  25. </div>
  26. <div class="gf-form gf-form--grow">
  27. <label class="gf-form-label gf-form-label--grow">
  28. <a ng-click="toggleOptions()" ng-if="settingsLinkText">
  29. <i class="fa fa-caret-down" ng-show="showOptions"></i>
  30. <i class="fa fa-caret-right" ng-hide="showOptions"></i>
  31. {{settingsLinkText}}
  32. </a>
  33. </label>
  34. </div>
  35. <div class="gf-form">
  36. <label class="gf-form-label" ng-if="isFirst">
  37. <a class="pointer" ng-click="addMetricAgg()"><i class="fa fa-plus"></i></a>
  38. </label>
  39. <label class="gf-form-label" ng-if="!isSingle">
  40. <a class="pointer" ng-click="removeMetricAgg()"><i class="fa fa-minus"></i></a>
  41. </label>
  42. </div>
  43. </div>
  44. <div class="gf-form-group" ng-if="showVariables">
  45. <elastic-pipeline-variables variables="agg.pipelineVariables" options="pipelineAggOptions" on-change="onChangeInternal()" />
  46. <div class="gf-form offset-width-7">
  47. <label class="gf-form-label width-10">
  48. Script
  49. <info-popover mode="right-normal">
  50. Elasticsearch v5.0 and above: Scripting language is Painless. Use <i>params.&lt;var&gt;</i> to reference a variable.<br/><br/>
  51. Elasticsearch pre-v5.0: Scripting language is per default Groovy if not changed. For Groovy use <i>&lt;var&gt;</i> to reference a variable.
  52. </info-popover>
  53. </label>
  54. <input type="text" class="gf-form-input max-width-24" empty-to-null ng-model="agg.settings.script" ng-blur="onChangeInternal()" spellcheck='false' placeholder="params.var1 / params.var2">
  55. </div>
  56. </div>
  57. <div class="gf-form-group" ng-if="showOptions">
  58. <div class="gf-form offset-width-7" ng-if="agg.type === 'derivative'">
  59. <label class="gf-form-label width-10">Unit</label>
  60. <input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.unit" ng-blur="onChangeInternal()" spellcheck='false'>
  61. </div>
  62. <div ng-if="agg.type === 'moving_avg'">
  63. <div class="gf-form offset-width-7">
  64. <label class="gf-form-label width-10">Model</label>
  65. <metric-segment-model property="agg.settings.model" options="movingAvgModelTypes" on-change="onChangeClearInternal()" custom="false" css-class="width-12"></metric-segment-model>
  66. </div>
  67. <div class="gf-form offset-width-7">
  68. <label class="gf-form-label width-10">Window</label>
  69. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.window" ng-blur="onChangeInternal()" spellcheck='false'>
  70. </div>
  71. <div class="gf-form offset-width-7">
  72. <label class="gf-form-label width-10">Predict</label>
  73. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.predict" ng-blur="onChangeInternal()" spellcheck='false'>
  74. </div>
  75. <div class="gf-form offset-width-7" ng-repeat="setting in modelSettings">
  76. <label class="gf-form-label width-10">{{setting.text}}</label>
  77. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.settings[setting.value]" ng-blur="onChangeInternal()" spellcheck='false'>
  78. </div>
  79. <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>
  80. <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>
  81. </div>
  82. <div class="gf-form offset-width-7" ng-if="agg.type === 'percentiles'">
  83. <label class="gf-form-label width-10">Percentiles</label>
  84. <input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.percents" array-join ng-blur="onChange()"></input>
  85. </div>
  86. <div class="gf-form offset-width-7" ng-if="agg.type === 'raw_document'">
  87. <label class="gf-form-label width-10">Size</label>
  88. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.size" ng-blur="onChange()"></input>
  89. </div>
  90. <div class="gf-form offset-width-7" ng-if="agg.type === 'cardinality'">
  91. <label class="gf-form-label width-10">Precision threshold</label>
  92. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision_threshold" ng-blur="onChange()"></input>
  93. </div>
  94. <div ng-if="agg.type === 'extended_stats'">
  95. <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>
  96. <div class="gf-form offset-width-7">
  97. <label class="gf-form-label width-10">Sigma</label>
  98. <input type="number" class="gf-form-input max-width-12" placeholder="3" ng-model="agg.settings.sigma" ng-blur="onChange()"></input>
  99. </div>
  100. </div>
  101. <div class="gf-form offset-width-7" ng-if="aggDef.supportsInlineScript">
  102. <label class="gf-form-label width-10">Script</label>
  103. <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">
  104. </div>
  105. <div class="gf-form offset-width-7" ng-if="aggDef.supportsMissing">
  106. <label class="gf-form-label width-10">
  107. Missing
  108. <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>
  109. </label>
  110. <input type="number" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  111. </div>
  112. </div>