metrics_tab.html 4.6 KB

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