shareModal.html 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <div class="modal-body gf-box gf-box-no-margin" ng-controller="ShareModalCtrl" ng-init="init()">
  2. <div class="gf-box-header">
  3. <div class="gf-box-title">
  4. <i class="fa fa-share"></i>
  5. {{modalTitle}}
  6. </div>
  7. <div ng-model="editor.index" bs-tabs>
  8. <div ng-repeat="tab in tabs" data-title="{{tab.title}}">
  9. </div>
  10. </div>
  11. <button class="gf-box-header-close-btn" ng-click="dismiss();">
  12. <i class="fa fa-remove"></i>
  13. </button>
  14. </div>
  15. <div class="gf-box-body" ng-repeat="tab in tabs" ng-if="editor.index == $index">
  16. <ng-include src="tab.src"></ng-include>
  17. </div>
  18. </div>
  19. <script type="text/ng-template" id="shareEmbed.html">
  20. <h5>IFrame embedding</h5>
  21. <p>
  22. <em>
  23. The html code below can be pasted and included in another web page. Unless anonymous access
  24. is enabled the user viewing that page need to be signed into grafana for the graph to load.
  25. </em>
  26. </p>
  27. <div class="gf-form">
  28. <div class="gf-form-row">
  29. <span class="gf-fluid-input">
  30. <textarea rows="5" data-share-panel-url class="input" ng-model='iframeHtml'></textarea>
  31. </span>
  32. </div>
  33. <button class="btn btn-inverse" data-clipboard-text="{{iframeHtml}}" clipboard-button><i class="fa fa-clipboard"></i> Copy</button>
  34. </div>
  35. </script>
  36. <script type="text/ng-template" id="shareLink.html">
  37. <h5>Link options</h5>
  38. <div class="gf-form">
  39. <div class="gf-form-row">
  40. <editor-checkbox text="Current time range" model="options.forCurrent" change="buildUrl()"></editor-checkbox>
  41. </div>
  42. </div>
  43. <div class="gf-form">
  44. <div class="gf-form-row">
  45. <editor-checkbox text="Include template variables" model="options.includeTemplateVars" change="buildUrl()"></editor-checkbox>
  46. </div>
  47. </div>
  48. <br>
  49. <div class="gf-form">
  50. <div class="gf-form-row">
  51. <button class="btn btn-inverse pull-right" data-clipboard-text="{{shareUrl}}" clipboard-button><i class="fa fa-clipboard"></i> Copy</button>
  52. <span class="gf-fluid-input">
  53. <input type="text" data-share-panel-url class="input" ng-model='shareUrl'></input>
  54. </span>
  55. </div>
  56. <div class="editor-row" style="margin-top: 5px;" ng-show="modeSharePanel">
  57. <a href="{{imageUrl}}" target="_blank"><i class="fa fa-camera"></i> Direct link rendered image</a>
  58. </div>
  59. </div>
  60. </script>
  61. <script type="text/ng-template" id="shareSnapshot.html">
  62. <div class="share-snapshot ng-cloak" ng-cloak ng-controller="ShareSnapshotCtrl">
  63. <div style="margin: 10px 0">
  64. <i ng-if="loading" class="fa fa-spinner fa-spin"></i>
  65. <i ng-if="!loading" class="gf-icon gf-icon-snap-multi"></i>
  66. </div>
  67. <div class="share-snapshot-header" ng-if="step === 1">
  68. <p class="share-snapshot-info-text">
  69. A snapshot is an instant way to share an interactive dashboard publicly.
  70. When created, we <strong>strip sensitive data</strong> like queries (metric, template and annotation) and panel links,
  71. leaving only the visible metric data and series names embedded into your dashboard.
  72. </p>
  73. <p class="share-snapshot-info-text">
  74. Keep in mind, your <strong>snapshot can be viewed by anyone</strong> that has the link and can reach the URL.
  75. Share wisely.
  76. </p>
  77. </div>
  78. <div class="share-snapshot-header" ng-if="step === 3">
  79. <p class="share-snapshot-info-text">
  80. The snapshot has now been deleted. If it you have already accessed it once, It might take up to an hour before it is removed from
  81. browser caches or CDN caches.
  82. </p>
  83. </div>
  84. <div class="editor-row" style="margin: 11px 20px 33px 20px">
  85. <div class="section" ng-if="step === 1">
  86. <div class="tight-form">
  87. <ul class="tight-form-list">
  88. <li class="tight-form-item" style="width: 110px;">
  89. Snapshot name
  90. </li>
  91. <li>
  92. <input type="text" ng-model="snapshot.name" class="input-large tight-form-input last" >
  93. </li>
  94. </ul>
  95. <div class="clearfix"></div>
  96. </div>
  97. <div class="tight-form">
  98. <ul class="tight-form-list">
  99. <li class="tight-form-item" style="width: 110px">
  100. Expire
  101. </li>
  102. <li>
  103. <select class="input-small tight-form-input last" style="width: 211px" ng-model="snapshot.expires" ng-options="f.value as f.text for f in expireOptions"></select>
  104. </li>
  105. </ul>
  106. <div class="clearfix"></div>
  107. </div>
  108. </div>
  109. <div class="gf-form" ng-if="step === 2" style="margin-top: 40px">
  110. <div class="gf-form-row">
  111. <a href="{{snapshotUrl}}" class="large share-snapshot-link" target="_blank">
  112. <i class="fa fa-external-link-square"></i>
  113. {{snapshotUrl}}
  114. </a>
  115. <br>
  116. <button class="btn btn-inverse btn-large" data-clipboard-text="{{snapshotUrl}}" clipboard-button><i class="fa fa-clipboard"></i> Copy Link</button>
  117. </div>
  118. </div>
  119. </div>
  120. <div ng-if="step === 1">
  121. <button class="btn btn-success btn-large" ng-click="createSnapshot()" ng-disabled="loading">
  122. <i class="fa fa-save"></i>
  123. Local Snapshot
  124. </button>
  125. <button class="btn btn-primary btn-large" ng-click="createSnapshot(true)" ng-disabled="loading">
  126. <i class="fa fa-cloud-upload"></i>
  127. Publish to snapshot.raintank.io
  128. </button>
  129. </div>
  130. <div class="pull-right" ng-if="step === 2" style="padding: 5px">
  131. Did you make a mistake? <a class="pointer" ng-click="deleteSnapshot()" target="_blank">delete snapshot.</a>
  132. </div>
  133. </div>
  134. </script>