ds_http_settings.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <div class="gf-form-group">
  2. <h3 class="page-heading">HTTP settings</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>Direct</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 currently <em>Proxy</em>, this means the URL
  19. needs to be accessible from the grafana backend.
  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 gf-form-select-wrapper--has-help-icon max-width-24">
  28. <select class="gf-form-input" ng-model="current.access" ng-options="f for f in ['direct', 'proxy']"></select>
  29. <info-popover mode="right-absolute">
  30. Direct = URL is used directly from browser<br>
  31. Proxy = Grafana backend will proxy the request
  32. </info-popover>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="gf-form-inline" ng-if="current.access=='proxy'">
  37. <div class="gf-form max-width-30">
  38. <span class="gf-form-label width-7">Cookies</span>
  39. <bootstrap-tagsinput ng-model="current.jsonData.keepCookies" tagclass="label label-tag" placeholder="Add Name">
  40. </bootstrap-tagsinput>
  41. <info-popover mode="right-absolute">
  42. Grafana Proxy deletes forwarded cookies by default. Specify cookies by name that should be forwarded to the data source.
  43. </info-popover>
  44. </div>
  45. </div>
  46. </div>
  47. <h3 class="page-heading">HTTP Auth</h3>
  48. <div class="gf-form-group">
  49. <div class="gf-form-inline">
  50. <gf-form-switch class="gf-form" label="Basic Auth" checked="current.basicAuth" label-class="width-8" switch-class="max-width-6"></gf-form-switch>
  51. <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>
  52. </div>
  53. <div class="gf-form-inline">
  54. <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>
  55. <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>
  56. </div>
  57. </div>
  58. <div class="gf-form-inline">
  59. <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>
  60. </div>
  61. </div>
  62. </div>
  63. <div class="gf-form-group" ng-if="current.basicAuth">
  64. <h6>Basic Auth Details</h6>
  65. <div class="gf-form" ng-if="current.basicAuth">
  66. <span class="gf-form-label width-7">
  67. User
  68. </span>
  69. <input class="gf-form-input max-width-21" type="text" ng-model='current.basicAuthUser' placeholder="user" required></input>
  70. </div>
  71. <div class="gf-form">
  72. <span class="gf-form-label width-7">
  73. Password
  74. </span>
  75. <input class="gf-form-input max-width-21" type="password" ng-model='current.basicAuthPassword' placeholder="password" required></input>
  76. </div>
  77. </div>
  78. <div class="gf-form-group" ng-if="(current.jsonData.tlsAuth || current.jsonData.tlsAuthWithCACert) && current.access=='proxy'">
  79. <div class="gf-form">
  80. <h6>TLS Auth Details</h6>
  81. <info-popover mode="header">TLS Certs are encrypted and stored in the Grafana database.</info-popover>
  82. </div>
  83. <div ng-if="current.jsonData.tlsAuthWithCACert">
  84. <div class="gf-form-inline">
  85. <div class="gf-form gf-form--v-stretch">
  86. <label class="gf-form-label width-7">CA Cert</label>
  87. </div>
  88. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsCACert">
  89. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsCACert" placeholder="Begins with -----BEGIN CERTIFICATE-----"></textarea>
  90. </div>
  91. <div class="gf-form" ng-if="current.secureJsonFields.tlsCACert">
  92. <input type="text" class="gf-form-input max-width-12" disabled="disabled" value="configured">
  93. <a class="btn btn-secondary gf-form-btn" href="#" ng-click="current.secureJsonFields.tlsCACert = false">reset</a>
  94. </div>
  95. </div>
  96. </div>
  97. <div ng-if="current.jsonData.tlsAuth">
  98. <div class="gf-form-inline">
  99. <div class="gf-form gf-form--v-stretch">
  100. <label class="gf-form-label width-7">Client Cert</label>
  101. </div>
  102. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientCert">
  103. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientCert" placeholder="Begins with -----BEGIN CERTIFICATE-----" required></textarea>
  104. </div>
  105. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientCert">
  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.tlsClientCert = false">reset</a>
  108. </div>
  109. </div>
  110. <div class="gf-form-inline">
  111. <div class="gf-form gf-form--v-stretch">
  112. <label class="gf-form-label width-7">Client Key</label>
  113. </div>
  114. <div class="gf-form gf-form--grow" ng-if="!current.secureJsonFields.tlsClientKey">
  115. <textarea rows="7" class="gf-form-input gf-form-textarea" ng-model="current.secureJsonData.tlsClientKey" placeholder="Begins with -----BEGIN RSA PRIVATE KEY-----" required></textarea>
  116. </div>
  117. <div class="gf-form" ng-if="current.secureJsonFields.tlsClientKey">
  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.tlsClientKey = false">reset</a>
  120. </div>
  121. </div>
  122. </div>
  123. </div>