metrics_tab.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <div class="gf-form-group">
  2. <div class="gf-form-inline">
  3. <div class="gf-form">
  4. <label class="gf-form-label gf-query-ds-label">
  5. <i class="icon-gf icon-gf-datasources"></i>
  6. </label>
  7. <label class="gf-form-label">Data Source</label>
  8. <gf-form-dropdown model="ctrl.panelDsValue" css-class="gf-size-auto"
  9. lookup-text="true"
  10. get-options="ctrl.getOptions(true)"
  11. on-change="ctrl.datasourceChanged($option)">
  12. </gf-form-dropdown>
  13. </div>
  14. <div class="gf-form gf-form--grow">
  15. <label class="gf-form-label gf-form-label--grow"></label>
  16. </div>
  17. <div class="gf-form" ng-if="ctrl.queryOptions">
  18. <a class="gf-form-label" ng-click="ctrl.toggleOptions()">
  19. <i class="fa fa-fw fa-caret-right" ng-hide="ctrl.optionsOpen"></i><i class="fa fa-fw fa-caret-down" ng-show="ctrl.optionsOpen"></i>Options
  20. </a>
  21. </div>
  22. <div class="gf-form" ng-if="ctrl.hasQueryHelp">
  23. <button class="gf-form-label" ng-click="ctrl.toggleHelp()">
  24. <i class="fa fa-fw fa-caret-right" ng-hide="ctrl.helpOpen"></i><i class="fa fa-fw fa-caret-down" ng-show="ctrl.helpOpen"></i>Help
  25. </button>
  26. </div>
  27. <div class="gf-form">
  28. <button class="gf-form-label" ng-click="ctrl.toggleQueryTroubleshooter()" bs-tooltip="'Display query request & response'">
  29. <i class="fa fa-fw fa-caret-right" ng-hide="ctrl.queryTroubleshooterOpen"></i><i class="fa fa-fw fa-caret-down" ng-show="ctrl.queryTroubleshooterOpen"></i>Query Inspector
  30. </button>
  31. </div>
  32. </div>
  33. <div>
  34. <div ng-if="ctrl.optionsOpen">
  35. <div class="gf-form gf-form--flex-end" ng-if="ctrl.queryOptions.minInterval">
  36. <label class="gf-form-label">Min time interval</label>
  37. <input type="text" class="gf-form-input width-6" placeholder="{{ctrl.panelCtrl.interval}}" ng-model="ctrl.panel.interval" spellcheck="false" ng-model-onblur ng-change="ctrl.panelCtrl.refresh()" />
  38. <info-popover mode="right-absolute">
  39. A lower limit for the auto group by time interval. Recommended to be set to write frequency,
  40. for example <code>1m</code> if your data is written every minute. Access auto interval via variable <code>$__interval</code> for time range
  41. string and <code>$__interval_ms</code> for numeric variable that can be used in math expressions.
  42. </info-popover>
  43. </div>
  44. <div class="gf-form gf-form--flex-end" ng-if="ctrl.queryOptions.cacheTimeout">
  45. <label class="gf-form-label width-9">Cache timeout</label>
  46. <input type="text" class="gf-form-input width-6" placeholder="60" ng-model="ctrl.panel.cacheTimeout" ng-model-onblur ng-change="ctrl.panelCtrl.refresh()" spellcheck="false" />
  47. <info-popover mode="right-absolute">
  48. If your time series store has a query cache this option can override the default
  49. cache timeout. Specify a numeric value in seconds.
  50. </info-popover>
  51. </div>
  52. <div class="gf-form gf-form--flex-end" ng-if="ctrl.queryOptions.maxDataPoints">
  53. <label class="gf-form-label width-9">Max data points</label>
  54. <input type="text" class="gf-form-input width-6" placeholder="auto" ng-model-onblur ng-change="ctrl.panelCtrl.refresh()" ng-model="ctrl.panel.maxDataPoints" spellcheck="false" />
  55. <info-popover mode="right-absolute">
  56. The maximum data points the query should return. For graphs this
  57. is automatically set to one data point per pixel.
  58. </info-popover>
  59. </div>
  60. </div>
  61. <div class="grafana-info-box" ng-if="ctrl.helpOpen">
  62. <div class="markdown-html" ng-bind-html="ctrl.helpHtml"></div>
  63. <a class="grafana-info-box__close" ng-click="ctrl.toggleHelp()">
  64. <i class="fa fa-chevron-up"></i>
  65. </a>
  66. </div>
  67. <query-troubleshooter panel-ctrl="ctrl.panelCtrl" is-open="ctrl.queryTroubleshooterOpen"></query-troubleshooter>
  68. </div>
  69. </div>
  70. <div class="query-editor-rows gf-form-group" ng-if="ctrl.datasourceInstance">
  71. <div ng-repeat="target in ctrl.panel.targets" ng-class="{'gf-form-disabled': target.hide}">
  72. <rebuild-on-change property="ctrl.panel.datasource || target.datasource" show-null="true">
  73. <plugin-component type="query-ctrl">
  74. </plugin-component>
  75. </rebuild-on-change>
  76. </div>
  77. <div class="gf-form-query">
  78. <div class="gf-form gf-form-query-letter-cell">
  79. <label class="gf-form-label">
  80. <span class="gf-form-query-letter-cell-carret">
  81. <i class="fa fa-caret-down"></i>
  82. </span>
  83. <span class="gf-form-query-letter-cell-letter">{{ctrl.panelCtrl.nextRefId}}</span>
  84. </label>
  85. <button class="btn btn-secondary gf-form-btn" ng-click="ctrl.addQuery()" ng-hide="ctrl.datasourceInstance.meta.mixed">
  86. Add Query
  87. </button>
  88. <div class="dropdown" ng-if="ctrl.datasourceInstance.meta.mixed">
  89. <gf-form-dropdown model="ctrl.addQueryDropdown" get-options="ctrl.getOptions(false)" on-change="ctrl.addMixedQuery($option)">
  90. </gf-form-dropdown>
  91. </div>
  92. </div>
  93. </div>
  94. </div>