ds_http_settings.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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-switch class="gf-form" label="Basic Auth" checked="current.basicAuth" label-class="width-10" switch-class="max-width-6"></gf-form-switch>
  71. <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>
  72. </div>
  73. <div class="gf-form-inline">
  74. <gf-form-switch class="gf-form" ng-if="current.access=='proxy'" label="TLS Client Auth" label-class="width-10" checked="current.jsonData.tlsAuth" switch-class="max-width-6"></gf-form-switch>
  75. <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>
  76. </div>
  77. <div class="gf-form-inline">
  78. <gf-form-switch class="gf-form" ng-if="current.access=='proxy'" label="Skip TLS Verify" label-class="width-10" checked="current.jsonData.tlsSkipVerify" switch-class="max-width-6"></gf-form-switch>
  79. </div>
  80. </div>
  81. <div class="gf-form-group" ng-if="current.basicAuth">
  82. <h6>Basic Auth Details</h6>
  83. <div class="gf-form" ng-if="current.basicAuth">
  84. <span class="gf-form-label width-10">User</span>
  85. <input class="gf-form-input max-width-21" type="text" ng-model='current.basicAuthUser' placeholder="user" required></input>
  86. </div>
  87. <div class="gf-form">
  88. <span class="gf-form-label width-10">Password</span>
  89. <input class="gf-form-input max-width-21" type="password" ng-model='current.basicAuthPassword' placeholder="password" required></input>
  90. </div>
  91. </div>
  92. <div class="gf-form-group" ng-if="(current.jsonData.tlsAuth || current.jsonData.tlsAuthWithCACert) && current.access=='proxy'">
  93. <div class="gf-form">
  94. <h6>TLS Auth Details</h6>
  95. <info-popover mode="header">TLS Certs are encrypted and stored in the Grafana database.</info-popover>
  96. </div>
  97. <div ng-if="current.jsonData.tlsAuthWithCACert">
  98. <div class="gf-form-inline">
  99. <div class="gf-form gf-form--v-stretch">
  100. <label class="gf-form-label width-7">CA Cert</label>
  101. </div>
  102. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsCACert">
  103. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsCACert" placeholder="Begins with -----BEGIN CERTIFICATE-----"></textarea>
  104. </div>
  105. <div class="gf-form" ng-if="current.secureJsonFields.tlsCACert">
  106. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  107. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsCACert = false">reset</a>
  108. </div>
  109. </div>
  110. </div>
  111. <div ng-if="current.jsonData.tlsAuth">
  112. <div class="gf-form-inline">
  113. <div class="gf-form gf-form--v-stretch">
  114. <label class="gf-form-label width-7">Client Cert</label>
  115. </div>
  116. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientCert">
  117. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientCert" placeholder="Begins with -----BEGIN CERTIFICATE-----" required></textarea>
  118. </div>
  119. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientCert">
  120. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  121. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsClientCert = false">reset</a>
  122. </div>
  123. </div>
  124. <div class="gf-form-inline">
  125. <div class="gf-form gf-form--v-stretch">
  126. <label class="gf-form-label width-7">Client Key</label>
  127. </div>
  128. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientKey">
  129. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientKey" placeholder="Begins with -----BEGIN RSA PRIVATE KEY-----" required></textarea>
  130. </div>
  131. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientKey">
  132. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  133. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsClientKey = false">reset</a>
  134. </div>
  135. </div>
  136. </div>
  137. </div>