metric_agg.html 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 === 'moving_avg'">
  49. <label class="gf-form-label width-10">Predict</label>
  50. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.predict" ng-blur="onChangeInternal()" spellcheck='false'>
  51. </div>
  52. <div class="gf-form offset-width-7" ng-if="agg.type === 'percentiles'">
  53. <label class="gf-form-label width-10">Percentiles</label>
  54. <input type="text" class="gf-form-input max-width-12" ng-model="agg.settings.percents" array-join ng-blur="onChange()"></input>
  55. </div>
  56. <div class="gf-form offset-width-7" ng-if="agg.type === 'cardinality'">
  57. <label class="gf-form-label width-10">Precision threshold</label>
  58. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision_threshold" ng-blur="onChange()"></input>
  59. </div>
  60. <div ng-if="agg.type === 'extended_stats'">
  61. <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>
  62. <div class="gf-form offset-width-7">
  63. <label class="gf-form-label width-10">Sigma</label>
  64. <input type="number" class="gf-form-input max-width-12" placeholder="3" ng-model="agg.settings.sigma" ng-blur="onChange()"></input>
  65. </div>
  66. </div>
  67. <div class="gf-form offset-width-7" ng-if="aggDef.supportsInlineScript">
  68. <label class="gf-form-label width-10">Script</label>
  69. <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">
  70. </div>
  71. <div class="gf-form offset-width-7" ng-if="aggDef.supportsMissing">
  72. <label class="gf-form-label width-10">
  73. Missing
  74. <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>
  75. </label>
  76. <input type="number" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  77. </div>
  78. </div>