dasheditor.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <div class="modal-body">
  2. <div class="pull-right editor-title">Dashboard settings</div>
  3. <div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
  4. <div ng-repeat="tab in ['General', 'Rows','Controls', 'Metrics', 'Import']" data-title="{{tab}}">
  5. </div>
  6. <div ng-repeat="tab in dashboard.current.nav" data-title="{{tab.type}}">
  7. </div>
  8. </div>
  9. <div ng-if="editor.index == 0">
  10. <div class="editor-row">
  11. <div class="section">
  12. <div class="editor-option">
  13. <label class="small">Title</label><input type="text" class="input-large" ng-model='dashboard.current.title'></input>
  14. </div>
  15. <div class="editor-option">
  16. <label class="small">Style</label><select class="input-small" ng-model="dashboard.current.style" ng-options="f for f in ['dark','light']"></select>
  17. </div>
  18. <div class="editor-option">
  19. <label class="small">Time correction</label>
  20. <select ng-model="dashboard.current.timezone" class='input-small' ng-options="f for f in ['browser','utc']"></select>
  21. </div>
  22. <div class="editor-option">
  23. <label class="small"> Hints <tip>Show 'Add panel' hints in empty spaces</tip></label><input type="checkbox" ng-model="dashboard.current.panel_hints" ng-checked="dashboard.current.panel_hints" />
  24. </div>
  25. <div class="editor-option">
  26. <label class="small">Hide controls</label>
  27. <input type="checkbox" ng-model="dashboard.current.hideControls" ng-checked="dashboard.current.hideControls">
  28. </div>
  29. </div>
  30. </div>
  31. <div class="editor-row">
  32. <div class="section">
  33. <div class="editor-option">
  34. <label class="small">Tags</label>
  35. <bootstrap-tagsinput ng-model="dashboard.current.tags" tagclass="label label-tag" placeholder="add tags">
  36. </bootstrap-tagsinput>
  37. <tip>Press enter to a add tag</tip>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <div ng-if="editor.index == 1">
  43. <div class="editor-row">
  44. <div class="span8">
  45. <h4>Rows</h4>
  46. <table class="table table-striped">
  47. <thead>
  48. <th width="1%"></th>
  49. <th width="1%"></th>
  50. <th width="1%"></th>
  51. <th width="97%">Title</th>
  52. </thead>
  53. <tr ng-repeat="row in dashboard.current.rows">
  54. <td><i ng-click="_.move(dashboard.current.rows,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td>
  55. <td><i ng-click="_.move(dashboard.current.rows,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td>
  56. <td><i ng-click="dashboard.current.rows = _.without(dashboard.current.rows,row)" class="pointer icon-remove"></i></td>
  57. <td>{{row.title}}</td>
  58. </tr>
  59. </table>
  60. </div>
  61. <div class="span4">
  62. <h4>Add Row</h4>
  63. <label class="small">Title</label>
  64. <input type="text" class="input-medium" ng-model='row.title' placeholder="New row"></input>
  65. <label class="small">Height</label>
  66. <input type="text" class="input-mini" ng-model='row.height'></input>
  67. </div>
  68. </div>
  69. </div>
  70. <div ng-if="editor.index == 2" ng-controller="dashLoader">
  71. <div class="editor-row">
  72. <div class="section">
  73. <h5>Save to</h5>
  74. <div class="editor-option">
  75. <label class="small">Export</label><input type="checkbox" ng-model="dashboard.current.loader.save_local" ng-checked="dashboard.current.loader.save_local">
  76. </div>
  77. <div class="editor-option">
  78. <label class="small">Browser</label><input type="checkbox" ng-model="dashboard.current.loader.save_default" ng-checked="dashboard.current.loader.save_default">
  79. </div>
  80. <div class="editor-option">
  81. <label class="small">Gist <tip>Requires your domain to be OAUTH registered with Github<tip></label><input type="checkbox" ng-model="dashboard.current.loader.save_gist" ng-checked="dashboard.current.loader.save_gist">
  82. </div>
  83. <div class="editor-option">
  84. <label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.current.loader.save_elasticsearch" ng-checked="dashboard.current.loader.save_elasticsearch">
  85. </div>
  86. </div>
  87. <div class="section">
  88. <h5>Load from</h5>
  89. <div class="editor-option">
  90. <label class="small">Local file</label><input type="checkbox" ng-model="dashboard.current.loader.load_local" ng-checked="dashboard.current.loader.load_local">
  91. </div>
  92. <div class="editor-option">
  93. <label class="small">Gist</label><input type="checkbox" ng-model="dashboard.current.loader.load_gist" ng-checked="dashboard.current.loader.load_gist">
  94. </div>
  95. <div class="editor-option">
  96. <label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.current.loader.load_elasticsearch" ng-checked="dashboard.current.loader.load_elasticsearch">
  97. </div>
  98. <div class="editor-option" ng-show="dashboard.current.loader.load.elasticsearch">
  99. <label class="small">ES list size</label><input class="input-mini" type="number" ng-model="dashboard.current.loader.load_elasticsearch_size">
  100. </div>
  101. </div>
  102. <div class="section">
  103. <h5>Sharing</h5>
  104. <div class="editor-option" >
  105. <label class="small">Allow Sharing <tip>Allow generating adhoc links to dashboards</tip></label><input type="checkbox" ng-model="dashboard.current.loader.save_temp" ng-checked="dashboard.current.loader.save_temp">
  106. </div>
  107. <div class="editor-option" ng-show="dashboard.current.loader.save_temp">
  108. <label class="small">TTL <tip>Expire temp urls</tip></label><input type="checkbox" ng-model="dashboard.current.loader.save_temp_ttl_enable">
  109. </div>
  110. <div class="editor-option" ng-show="dashboard.current.loader.save_temp &amp;&amp; dashboard.current.loader.save_temp_ttl_enable">
  111. <label class="small">TTL Duration <tip>Elasticsearch date math, eg: 1m,1d,1w,30d </tip></label><input class="input-small" type="text" ng-model="dashboard.current.loader.save_temp_ttl">
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div ng-if="editor.index == 2">
  117. <div class="editor-row">
  118. <div class="section">
  119. <h5>Feature toggles</h5>
  120. <div class="editor-option" ng-repeat="pulldown in dashboard.current.pulldowns">
  121. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  122. </div>
  123. <div class="editor-option" ng-repeat="pulldown in dashboard.current.nav">
  124. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. <div ng-if="editor.index == 3">
  130. <ng-include src="'app/partials/loadmetrics.html'"></ng-include>
  131. </div>
  132. <div ng-if="editor.index == 4">
  133. <ng-include src="'app/partials/import.html'"></ng-include>
  134. </div>
  135. <div ng-repeat="pulldown in dashboard.current.nav" ng-controller="SubmenuCtrl" ng-show="editor.index == 5+$index">
  136. <ng-include ng-show="pulldown.enable" src="edit_path(pulldown.type)"></ng-include>
  137. <button ng-hide="pulldown.enable" class="btn" ng-click="pulldown.enable = true">Enable the {{pulldown.type}}</button>
  138. </div>
  139. </div>
  140. <div class="modal-footer">
  141. <div class="pull-left" style="padding-top: 15px;" ng-if="editor.index == 0">
  142. <span class="editor-option small">
  143. Grafana {{grafanaVersion}}
  144. </span>
  145. (<a class="small" href="https://github.com/torkelo/grafana/releases" target="_blank">check for updates</a>)
  146. </div>
  147. <button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
  148. <button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
  149. </div>