bucket_agg.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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 model="agg.type"
  8. lookup-text="true"
  9. get-options="getBucketAggTypes()"
  10. on-change="onTypeChanged()"
  11. allow-custom="false"
  12. label-mode="true"
  13. css-class="width-10">
  14. </gf-form-dropdown>
  15. <gf-form-dropdown ng-if="agg.field"
  16. model="agg.field"
  17. get-options="getFieldsInternal()"
  18. on-change="onChange()"
  19. allow-custom="false"
  20. label-mode="true"
  21. css-class="width-12">
  22. </gf-form-dropdown>
  23. </div>
  24. <div class="gf-form gf-form--grow">
  25. <label class="gf-form-label gf-form-label--grow">
  26. <a ng-click="toggleOptions()">
  27. <i class="fa fa-caret-down" ng-show="showOptions"></i>
  28. <i class="fa fa-caret-right" ng-hide="showOptions"></i>
  29. {{settingsLinkText}}
  30. </a>
  31. </label>
  32. </div>
  33. <div class="gf-form">
  34. <label class="gf-form-label" ng-if="isFirst">
  35. <a class="pointer" ng-click="addBucketAgg()"><i class="fa fa-plus"></i></a>
  36. </label>
  37. <label class="gf-form-label" ng-if="bucketAggCount > 1">
  38. <a class="pointer" ng-click="removeBucketAgg()"><i class="fa fa-minus"></i></a>
  39. </label>
  40. </div>
  41. </div>
  42. <div class="gf-form-group" ng-if="showOptions">
  43. <div ng-if="agg.type === 'date_histogram'">
  44. <div class="gf-form offset-width-7">
  45. <label class="gf-form-label width-10">Interval</label>
  46. <gf-form-dropdown model="agg.settings.interval"
  47. get-options="getIntervalOptions()"
  48. on-change="onChangeInternal()"
  49. allow-custom="true"
  50. label-mode="true"
  51. css-class="width-12">
  52. </gf-form-dropdown>
  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 class="gf-form offset-width-7">
  59. <label class="gf-form-label width-10">
  60. Trim edges
  61. <info-popover mode="right-normal">
  62. Trim the edges on the timeseries datapoints
  63. </info-popover>
  64. </label>
  65. <input class="gf-form-input max-width-12" type="number" ng-model="agg.settings.trimEdges" ng-change="onChangeInternal()">
  66. </div>
  67. <div class="gf-form offset-width-7">
  68. <label class="gf-form-label width-10">
  69. Offset
  70. <info-popover mode="right-normal">
  71. Change the start value of each bucket by the specified positive (+) or negative offset (-) duration, such as 1h for an hour, or 1d for a day
  72. </info-popover>
  73. </label>
  74. <input class="gf-form-input max-width-12" type="text" ng-model="agg.settings.offset" ng-change="onChangeInternal()">
  75. </div>
  76. </div>
  77. <div ng-if="agg.type === 'histogram'">
  78. <div class="gf-form offset-width-7">
  79. <label class="gf-form-label width-10">Interval</label>
  80. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.interval" ng-blur="onChangeInternal()">
  81. </div>
  82. <div class="gf-form offset-width-7">
  83. <label class="gf-form-label width-10">Min Doc Count</label>
  84. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  85. </div>
  86. </div>
  87. <div ng-if="agg.type === 'terms'">
  88. <div class="gf-form offset-width-7">
  89. <label class="gf-form-label width-10">Order</label>
  90. <gf-form-dropdown model="agg.settings.order"
  91. lookup-text="true"
  92. get-options="getOrderOptions()"
  93. on-change="onChangeInternal()"
  94. label-mode="true"
  95. css-class="width-12">
  96. </gf-form-dropdown>
  97. </div>
  98. <div class="gf-form offset-width-7">
  99. <label class="gf-form-label width-10">Size</label>
  100. <gf-form-dropdown model="agg.settings.size"
  101. lookup-text="true"
  102. get-options="getSizeOptions()"
  103. on-change="onChangeInternal()"
  104. label-mode="true"
  105. allow-custom="true"
  106. css-class="width-12">
  107. </gf-form-dropdown>
  108. </div>
  109. <div class="gf-form offset-width-7">
  110. <label class="gf-form-label width-10">Min Doc Count</label>
  111. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  112. </div>
  113. <div class="gf-form offset-width-7">
  114. <label class="gf-form-label width-10">Order By</label>
  115. <gf-form-dropdown model="agg.settings.orderBy"
  116. lookup-text="true"
  117. get-options="getOrderByOptions()"
  118. on-change="onChangeInternal()"
  119. label-mode="true"
  120. css-class="width-12">
  121. </gf-form-dropdown>
  122. </div>
  123. <div class="gf-form offset-width-7">
  124. <label class="gf-form-label width-10">
  125. Missing
  126. <info-popover mode="right-normal">
  127. 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
  128. </info-popover>
  129. </label>
  130. <input type="text" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  131. </div>
  132. </div>
  133. <div ng-if="agg.type === 'filters'">
  134. <div class="gf-form-inline offset-width-7" ng-repeat="filter in agg.settings.filters">
  135. <div class="gf-form">
  136. <label class="gf-form-label width-10">Query {{$index + 1}}</label>
  137. <input type="text" class="gf-form-input max-width-12" ng-model="filter.query" spellcheck='false' placeholder="Lucene query" ng-blur="onChangeInternal()">
  138. <label class="gf-form-label width-10">Label {{$index + 1}}</label>
  139. <input type="text" class="gf-form-input max-width-12" ng-model="filter.label" spellcheck='false' placeholder="Label" ng-blur="onChangeInternal()">
  140. </div>
  141. <div class="gf-form">
  142. <label class="gf-form-label" ng-if="$first">
  143. <a class="pointer" ng-click="addFiltersQuery()"><i class="fa fa-plus"></i></a>
  144. </label>
  145. <label class="gf-form-label" ng-if="!$first">
  146. <a class="pointer" ng-click="removeFiltersQuery(filter)"><i class="fa fa-minus"></i></a>
  147. </label>
  148. </div>
  149. </div>
  150. </div>
  151. <div ng-if="agg.type === 'geohash_grid'">
  152. <div class="gf-form offset-width-7">
  153. <label class="gf-form-label width-10">Precision</label>
  154. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision" spellcheck='false' placeholder="3" ng-blur="onChangeInternal()">
  155. </div>
  156. </div>
  157. </div>