ds_http_settings.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <div class="gf-form-group">
  2. <h3 class="page-heading">HTTP</h3>
  3. <div class="gf-form-group">
  4. <div class="gf-form-inline">
  5. <div class="gf-form max-width-30">
  6. <span class="gf-form-label width-10">URL</span>
  7. <input class="gf-form-input" type="text"
  8. ng-model='current.url' placeholder="{{suggestUrl}}"
  9. bs-typeahead="getSuggestUrls" min-length="0"
  10. ng-pattern="/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/" required></input>
  11. <info-popover mode="right-absolute">
  12. <p>Specify a complete HTTP URL (for example http://your_server:8080)</p>
  13. <span ng-show="current.access === 'direct'">
  14. Your access method is <em>Browser</em>, this means the URL
  15. needs to be accessible from the browser.
  16. </span>
  17. <span ng-show="current.access === 'proxy'">
  18. Your access method is <em>Server</em>, this means the URL
  19. needs to be accessible from the grafana backend/server.
  20. </span>
  21. </info-popover>
  22. </div>
  23. </div>
  24. <div class="gf-form-inline" ng-if="showAccessOption">
  25. <div class="gf-form max-width-30">
  26. <span class="gf-form-label width-10">Access</span>
  27. <div class="gf-form-select-wrapper max-width-24">
  28. <select class="gf-form-input" ng-model="current.access" ng-options="f.key as f.value for f in [{key: 'proxy', value: 'Server (Default)'}, { key: 'direct', value: 'Browser'}]"></select>
  29. </div>
  30. </div>
  31. <div class="gf-form">
  32. <label class="gf-form-label query-keyword pointer" ng-click="toggleAccessHelp()">
  33. Help&nbsp;
  34. <i class="fa fa-caret-down" ng-show="showAccessHelp"></i>
  35. <i class="fa fa-caret-right" ng-hide="showAccessHelp">&nbsp;</i>
  36. </label>
  37. </div>
  38. </div>
  39. <div class="grafana-info-box m-t-2" ng-show="showAccessHelp">
  40. <p>
  41. Access mode controls how requests to the data source will be handled.
  42. <strong><i>Server</i></strong> should be the preferred way if nothing else stated.
  43. </p>
  44. <div class="alert-title">Server access mode (Default):</div>
  45. <p>
  46. All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source
  47. and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements.
  48. The URL needs to be accessible from the grafana backend/server if you select this access mode.
  49. </p>
  50. <div class="alert-title">Browser access mode:</div>
  51. <p>
  52. All requests will be made from the browser directly to the data source and may be subject to
  53. Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this
  54. access mode.
  55. </div>
  56. <div class="gf-form-inline" ng-if="current.access=='proxy'">
  57. <div class="gf-form">
  58. <span class="gf-form-label width-10">Whitelisted Cookies</span>
  59. <bootstrap-tagsinput ng-model="current.jsonData.keepCookies" width-class="width-20" tagclass="label label-tag" placeholder="Add Name">
  60. </bootstrap-tagsinput>
  61. <info-popover mode="right-absolute">
  62. Grafana Proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source.
  63. </info-popover>
  64. </div>
  65. </div>
  66. </div>
  67. <h3 class="page-heading">Auth</h3>
  68. <div class="gf-form-group">
  69. <div class="gf-form-inline">
  70. <gf-form-checkbox class="gf-form" label="Basic Auth" checked="current.basicAuth" label-class="width-10" switch-class="max-width-6"></gf-form-checkbox>
  71. <gf-form-checkbox class="gf-form" label="With Credentials" tooltip="Whether credentials such as cookies or auth
  72. headers should be sent with cross-site requests." checked="current.withCredentials" label-class="width-11"
  73. switch-class="max-width-6"></gf-form-checkbox>
  74. </div>
  75. <div class="gf-form-inline">
  76. <gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="TLS Client Auth" label-class="width-10"
  77. checked="current.jsonData.tlsAuth" switch-class="max-width-6"></gf-form-checkbox>
  78. <gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="With CA Cert" tooltip="Needed for
  79. verifing self-signed TLS Certs" checked="current.jsonData.tlsAuthWithCACert" label-class="width-11"
  80. switch-class="max-width-6"></gf-form-checkbox>
  81. </div>
  82. <div class="gf-form-inline">
  83. <gf-form-checkbox class="gf-form" ng-if="current.access=='proxy'" label="Skip TLS Verify" label-class="width-10"
  84. checked="current.jsonData.tlsSkipVerify" switch-class="max-width-6"></gf-form-checkbox>
  85. </div>
  86. </div>
  87. <div class="gf-form-group" ng-if="current.basicAuth">
  88. <h6>Basic Auth Details</h6>
  89. <div class="gf-form" ng-if="current.basicAuth">
  90. <span class="gf-form-label width-10">User</span>
  91. <input class="gf-form-input max-width-21" type="text" ng-model='current.basicAuthUser' placeholder="user" required></input>
  92. </div>
  93. <div class="gf-form">
  94. <span class="gf-form-label width-10">Password</span>
  95. <input class="gf-form-input max-width-21" type="password" ng-model='current.basicAuthPassword' placeholder="password" required></input>
  96. </div>
  97. </div>
  98. <div class="gf-form-group" ng-if="(current.jsonData.tlsAuth || current.jsonData.tlsAuthWithCACert) && current.access=='proxy'">
  99. <div class="gf-form">
  100. <h6>TLS Auth Details</h6>
  101. <info-popover mode="header">TLS Certs are encrypted and stored in the Grafana database.</info-popover>
  102. </div>
  103. <div ng-if="current.jsonData.tlsAuthWithCACert">
  104. <div class="gf-form-inline">
  105. <div class="gf-form gf-form--v-stretch">
  106. <label class="gf-form-label width-7">CA Cert</label>
  107. </div>
  108. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsCACert">
  109. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsCACert" placeholder="Begins with -----BEGIN CERTIFICATE-----"></textarea>
  110. </div>
  111. <div class="gf-form" ng-if="current.secureJsonFields.tlsCACert">
  112. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  113. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsCACert = false">reset</a>
  114. </div>
  115. </div>
  116. </div>
  117. <div ng-if="current.jsonData.tlsAuth">
  118. <div class="gf-form-inline">
  119. <div class="gf-form gf-form--v-stretch">
  120. <label class="gf-form-label width-7">Client Cert</label>
  121. </div>
  122. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientCert">
  123. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientCert" placeholder="Begins with -----BEGIN CERTIFICATE-----" required></textarea>
  124. </div>
  125. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientCert">
  126. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  127. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsClientCert = false">reset</a>
  128. </div>
  129. </div>
  130. <div class="gf-form-inline">
  131. <div class="gf-form gf-form--v-stretch">
  132. <label class="gf-form-label width-7">Client Key</label>
  133. </div>
  134. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientKey">
  135. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientKey" placeholder="Begins with -----BEGIN RSA PRIVATE KEY-----" required></textarea>
  136. </div>
  137. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientKey">
  138. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  139. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsClientKey = false">reset</a>
  140. </div>
  141. </div>
  142. </div>
  143. </div>