bucket_agg.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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>
  68. <div ng-if="agg.type === 'histogram'">
  69. <div class="gf-form offset-width-7">
  70. <label class="gf-form-label width-10">Interval</label>
  71. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.interval" ng-blur="onChangeInternal()">
  72. </div>
  73. <div class="gf-form offset-width-7">
  74. <label class="gf-form-label width-10">Min Doc Count</label>
  75. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  76. </div>
  77. </div>
  78. <div ng-if="agg.type === 'terms'">
  79. <div class="gf-form offset-width-7">
  80. <label class="gf-form-label width-10">Order</label>
  81. <gf-form-dropdown model="agg.settings.order"
  82. lookup-text="true"
  83. get-options="getOrderOptions()"
  84. on-change="onChangeInternal()"
  85. label-mode="true"
  86. css-class="width-12">
  87. </gf-form-dropdown>
  88. </div>
  89. <div class="gf-form offset-width-7">
  90. <label class="gf-form-label width-10">Size</label>
  91. <gf-form-dropdown model="agg.settings.size"
  92. lookup-text="true"
  93. get-options="getSizeOptions()"
  94. on-change="onChangeInternal()"
  95. label-mode="true"
  96. allow-custom="true"
  97. css-class="width-12">
  98. </gf-form-dropdown>
  99. </div>
  100. <div class="gf-form offset-width-7">
  101. <label class="gf-form-label width-10">Min Doc Count</label>
  102. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.min_doc_count" ng-blur="onChangeInternal()">
  103. </div>
  104. <div class="gf-form offset-width-7">
  105. <label class="gf-form-label width-10">Order By</label>
  106. <gf-form-dropdown model="agg.settings.orderBy"
  107. lookup-text="true"
  108. get-options="getOrderByOptions()"
  109. on-change="onChangeInternal()"
  110. label-mode="true"
  111. css-class="width-12">
  112. </gf-form-dropdown>
  113. </div>
  114. <div class="gf-form offset-width-7">
  115. <label class="gf-form-label width-10">
  116. Missing
  117. <info-popover mode="right-normal">
  118. 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
  119. </info-popover>
  120. </label>
  121. <input type="text" class="gf-form-input max-width-12" empty-to-null ng-model="agg.settings.missing" ng-blur="onChangeInternal()" spellcheck='false'>
  122. </div>
  123. </div>
  124. <div ng-if="agg.type === 'filters'">
  125. <div class="gf-form-inline offset-width-7" ng-repeat="filter in agg.settings.filters">
  126. <div class="gf-form">
  127. <label class="gf-form-label width-10">Query {{$index + 1}}</label>
  128. <input type="text" class="gf-form-input max-width-12" ng-model="filter.query" spellcheck='false' placeholder="Lucene query" ng-blur="onChangeInternal()">
  129. <label class="gf-form-label width-10">Label {{$index + 1}}</label>
  130. <input type="text" class="gf-form-input max-width-12" ng-model="filter.label" spellcheck='false' placeholder="Label" ng-blur="onChangeInternal()">
  131. </div>
  132. <div class="gf-form">
  133. <label class="gf-form-label" ng-if="$first">
  134. <a class="pointer" ng-click="addFiltersQuery()"><i class="fa fa-plus"></i></a>
  135. </label>
  136. <label class="gf-form-label" ng-if="!$first">
  137. <a class="pointer" ng-click="removeFiltersQuery(filter)"><i class="fa fa-minus"></i></a>
  138. </label>
  139. </div>
  140. </div>
  141. </div>
  142. <div ng-if="agg.type === 'geohash_grid'">
  143. <div class="gf-form offset-width-7">
  144. <label class="gf-form-label width-10">Precision</label>
  145. <input type="number" class="gf-form-input max-width-12" ng-model="agg.settings.precision" spellcheck='false' placeholder="3" ng-blur="onChangeInternal()">
  146. </div>
  147. </div>
  148. </div>