bucket_agg.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <div class="gf-form-inline">
  2. <div class="gf-form">
  3. <label class="gf-form-label query-keyword width-7">
  4. <span ng-show="isFirst">Group by</span>
  5. <span ng-hide="isFirst">Then by</span>
  6. </label>
  7. <gf-form-dropdown value="agg.type" options="bucketAggTypes" on-change="onTypeChanged()" custom="false" css-class="width-10"></gf-form-dropdown>
  8. <!-- <metric&#45;segment&#45;model property="agg.type" options="bucketAggTypes" on&#45;change="onTypeChanged()" custom="false" css&#45;class="width&#45;10"></metric&#45;segment&#45;model> -->
  9. <metric-segment-model ng-if="agg.field" property="agg.field" get-options="getFieldsInternal()" on-change="onChange()" css-class="width-12"></metric-segment-model>
  10. </div>
  11. <div class="gf-form gf-form--grow">
  12. <label class="gf-form-label gf-form-label--grow">
  13. <a ng-click="toggleOptions()">
  14. <i class="fa fa-caret-down" ng-show="showOptions"></i>
  15. <i class="fa fa-caret-right" ng-hide="showOptions"></i>
  16. {{settingsLinkText}}
  17. </a>
  18. </label>
  19. </div>
  20. <div class="gf-form">
  21. <label class="gf-form-label" ng-if="isFirst">
  22. <a class="pointer" ng-click="addBucketAgg()"><i class="fa fa-plus"></i></a>
  23. </label>
  24. <label class="gf-form-label" ng-if="bucketAggCount > 1">
  25. <a class="pointer" ng-click="removeBucketAgg()"><i class="fa fa-minus"></i></a>
  26. </label>
  27. </div>
  28. </div>
  29. <div class="gf-form-group" ng-if="showOptions">
  30. <div ng-if="agg.type === 'date_histogram'">
  31. <div class="gf-form offset-width-7">
  32. <label class="gf-form-label width-10">Interval</label>
  33. <metric-segment-model property="agg.settings.interval" get-options="getIntervalOptions()" on-change="onChangeInternal()" css-class="width-12" custom="true"></metric-segment-model>
  34. </div>
  35. <div class="gf-form offset-width-7">
  36. <label class="gf-form-label width-10">Min Doc Count</label>
  37. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  38. </div>
  39. <div class="gf-form offset-width-7">
  40. <label class="gf-form-label width-10">
  41. Trim edges
  42. <info-popover mode="right-normal">
  43. Trim the edges on the timeseries datapoints
  44. </info-popover>
  45. </label>
  46. <input class="gf-form-input max-width-12" type="number" ng-model="agg.settings.trimEdges" ng-change="onChangeInternal()">
  47. </div>
  48. </div>
  49. <div ng-if="agg.type === 'histogram'">
  50. <div class="gf-form offset-width-7">
  51. <label class="gf-form-label width-10">Interval</label>
  52. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.interval" ng-blur="onChangeInternal()">
  53. </div>
  54. <div class="gf-form offset-width-7">
  55. <label class="gf-form-label width-10">Min Doc Count</label>
  56. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  57. </div>
  58. </div>
  59. <div ng-if="agg.type === 'terms'">
  60. <div class="gf-form offset-width-7">
  61. <label class="gf-form-label width-10">Order</label>
  62. <metric-segment-model property="agg.settings.order" options="orderOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
  63. </div>
  64. <div class="gf-form offset-width-7">
  65. <label class="gf-form-label width-10">Size</label>
  66. <metric-segment-model property="agg.settings.size" options="sizeOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
  67. </div>
  68. <div class="gf-form offset-width-7">
  69. <label class="gf-form-label width-10">Min Doc Count</label>
  70. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  71. </div>
  72. <div class="gf-form offset-width-7">
  73. <label class="gf-form-label width-10">Order By</label>
  74. <metric-segment-model property="agg.settings.orderBy" options="orderByOptions" on-change="onChangeInternal()" css-class="width-12"></metric-segment-model>
  75. </div>
  76. <div class="gf-form offset-width-7">
  77. <label class="gf-form-label width-10">
  78. Missing
  79. <info-popover mode="right-normal">
  80. 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
  81. </info-popover>
  82. </label>
  83. <input type="text" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  84. </div>
  85. </div>
  86. <div ng-if="agg.type === 'filters'">
  87. <div class="gf-form-inline offset-width-7" ng-repeat="filter in agg.settings.filters">
  88. <div class="gf-form">
  89. <label class="gf-form-label width-10">Query {{$index + 1}}</label>
  90. <input type="text" class="gf-form-input max-width-12" ng-model="filter.query" spellcheck='false' placeholder="Lucene query" ng-blur="onChangeInternal()">
  91. <label class="gf-form-label width-10">Label {{$index + 1}}</label>
  92. <input type="text" class="gf-form-input max-width-12" ng-model="filter.label" spellcheck='false' placeholder="Label" ng-blur="onChangeInternal()">
  93. </div>
  94. <div class="gf-form">
  95. <label class="gf-form-label" ng-if="$first">
  96. <a class="pointer" ng-click="addFiltersQuery()"><i class="fa fa-plus"></i></a>
  97. </label>
  98. <label class="gf-form-label" ng-if="!$first">
  99. <a class="pointer" ng-click="removeFiltersQuery(filter)"><i class="fa fa-minus"></i></a>
  100. </label>
  101. </div>
  102. </div>
  103. </div>
  104. <div ng-if="agg.type === 'geohash_grid'">
  105. <div class="gf-form offset-width-7">
  106. <label class="gf-form-label width-10">Precision</label>
  107. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision" spellcheck='false' placeholder="3" ng-blur="onChangeInternal()">
  108. </div>
  109. </div>
  110. </div>