ds_http_settings.html 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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-7">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">
  25. <div class="gf-form max-width-30">
  26. <span class="gf-form-label width-7">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="ctrl.showAccessHelp = !ctrl.showAccessHelp">
  33. Help&nbsp;
  34. <i class="fa fa-caret-down" ng-show="ctrl.showAccessHelp"></i>
  35. <i class="fa fa-caret-right" ng-hide="ctrl.showAccessHelp">&nbsp;</i>
  36. </label>
  37. </div>
  38. </div>
  39. <div class="alert alert-info" ng-show="ctrl.showAccessHelp">
  40. <div class="alert-body">
  41. <p>
  42. Access mode controls how requests to the data source will be handled.
  43. <strong><i>Server</i></strong> should be the preferred way if nothing else stated.
  44. </p>
  45. <div class="alert-title">Server access mode (Default):</div>
  46. <p>
  47. All requests will be made from the browser to Grafana backend/server which in turn will forward the requests to the data source
  48. and by that circumvent possible Cross-Origin Resource Sharing (CORS) requirements.
  49. The URL needs to be accessible from the grafana backend/server if you select this access mode.
  50. </p>
  51. <div class="alert-title">Browser access mode:</div>
  52. <p>
  53. All requests will be made from the browser directly to the data source and may be subject to
  54. Cross-Origin Resource Sharing (CORS) requirements. The URL needs to be accessible from the browser if you select this
  55. access mode.
  56. </p>
  57. </div>
  58. </div>
  59. </div>
  60. <h3 class="page-heading">Auth</h3>
  61. <div class="gf-form-group">
  62. <div class="gf-form-inline">
  63. <gf-form-switch class="gf-form" label="Basic Auth" checked="current.basicAuth" label-class="width-8" switch-class="max-width-6"></gf-form-switch>
  64. <gf-form-switch class="gf-form" label="With Credentials" tooltip="Whether credentials such as cookies or auth headers should be sent with cross-site requests." checked="current.withCredentials" label-class="width-11" switch-class="max-width-6"></gf-form-switch>
  65. </div>
  66. <div class="gf-form-inline">
  67. <gf-form-switch class="gf-form" ng-if="current.access=='proxy'" label="TLS Client Auth" label-class="width-8" checked="current.jsonData.tlsAuth" switch-class="max-width-6"></gf-form-switch>
  68. <gf-form-switch class="gf-form" ng-if="current.access=='proxy'" label="With CA Cert" tooltip="Needed for verifing self-signed TLS Certs" checked="current.jsonData.tlsAuthWithCACert" label-class="width-11" switch-class="max-width-6"></gf-form-switch>
  69. </div>
  70. </div>
  71. <div class="gf-form-inline">
  72. <gf-form-switch class="gf-form" ng-if="current.access=='proxy'" label="Skip TLS Verification (Insecure)" label-class="width-16" checked="current.jsonData.tlsSkipVerify" switch-class="max-width-6"></gf-form-switch>
  73. </div>
  74. </div>
  75. <div class="gf-form-group" ng-if="current.basicAuth">
  76. <h6>Basic Auth Details</h6>
  77. <div class="gf-form" ng-if="current.basicAuth">
  78. <span class="gf-form-label width-7">
  79. User
  80. </span>
  81. <input class="gf-form-input max-width-21" type="text" ng-model='current.basicAuthUser' placeholder="user" required></input>
  82. </div>
  83. <div class="gf-form">
  84. <span class="gf-form-label width-7">
  85. Password
  86. </span>
  87. <input class="gf-form-input max-width-21" type="password" ng-model='current.basicAuthPassword' placeholder="password" required></input>
  88. </div>
  89. </div>
  90. <div class="gf-form-group" ng-if="(current.jsonData.tlsAuth || current.jsonData.tlsAuthWithCACert) && current.access=='proxy'">
  91. <div class="gf-form">
  92. <h6>TLS Auth Details</h6>
  93. <info-popover mode="header">TLS Certs are encrypted and stored in the Grafana database.</info-popover>
  94. </div>
  95. <div ng-if="current.jsonData.tlsAuthWithCACert">
  96. <div class="gf-form-inline">
  97. <div class="gf-form gf-form--v-stretch">
  98. <label class="gf-form-label width-7">CA Cert</label>
  99. </div>
  100. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsCACert">
  101. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsCACert" placeholder="Begins with -----BEGIN CERTIFICATE-----"></textarea>
  102. </div>
  103. <div class="gf-form" ng-if="current.secureJsonFields.tlsCACert">
  104. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  105. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsCACert = false">reset</a>
  106. </div>
  107. </div>
  108. </div>
  109. <div ng-if="current.jsonData.tlsAuth">
  110. <div class="gf-form-inline">
  111. <div class="gf-form gf-form--v-stretch">
  112. <label class="gf-form-label width-7">Client Cert</label>
  113. </div>
  114. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientCert">
  115. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientCert" placeholder="Begins with -----BEGIN CERTIFICATE-----" required></textarea>
  116. </div>
  117. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientCert">
  118. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  119. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsClientCert = false">reset</a>
  120. </div>
  121. </div>
  122. <div class="gf-form-inline">
  123. <div class="gf-form gf-form--v-stretch">
  124. <label class="gf-form-label width-7">Client Key</label>
  125. </div>
  126. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientKey">
  127. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientKey" placeholder="Begins with -----BEGIN RSA PRIVATE KEY-----" required></textarea>
  128. </div>
  129. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientKey">
  130. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  131. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsClientKey = false">reset</a>
  132. </div>
  133. </div>
  134. </div>
  135. </div>
  136. <h3 class="page-heading" ng-if="current.access=='proxy'">Advanced HTTP Settings</h3>
  137. <div class="gf-form-group" ng-if="current.access=='proxy'">
  138. <div class="gf-form-inline">
  139. <div class="gf-form">
  140. <span class="gf-form-label width-10">Whitelisted Cookies</span>
  141. <bootstrap-tagsinput ng-model="current.jsonData.keepCookies" tagclass="label label-tag" placeholder="Add Name">
  142. </bootstrap-tagsinput>
  143. <info-popover mode="right-absolute">
  144. Grafana Proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source.
  145. </info-popover>
  146. </div>
  147. </div>
  148. </div>