dasheditor.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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.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.title'></input>
  14. </div>
  15. <div class="editor-option">
  16. <label class="small">Theme</label><select class="input-small" ng-model="dashboard.style" ng-options="f for f in ['dark','light']" ng-change="styleUpdated()"></select>
  17. </div>
  18. <div class="editor-option">
  19. <label class="small">Time correction</label>
  20. <select ng-model="dashboard.timezone" class='input-small' ng-options="f for f in ['browser','utc']"></select>
  21. </div>
  22. <div class="editor-option">
  23. <label class="small">Hide controls (CTRL+H)</label>
  24. <input type="checkbox" ng-model="dashboard.hideControls" ng-checked="dashboard.hideControls">
  25. </div>
  26. </div>
  27. </div>
  28. <div class="editor-row">
  29. <div class="section">
  30. <div class="editor-option">
  31. <label class="small">Tags</label>
  32. <bootstrap-tagsinput ng-model="dashboard.tags" tagclass="label label-tag" placeholder="add tags">
  33. </bootstrap-tagsinput>
  34. <tip>Press enter to a add tag</tip>
  35. </div>
  36. </div>
  37. </div>
  38. </div>
  39. <div ng-if="editor.index == 1">
  40. <div class="editor-row">
  41. <div class="span8">
  42. <h4>Rows</h4>
  43. <table class="table table-striped">
  44. <thead>
  45. <th width="1%"></th>
  46. <th width="1%"></th>
  47. <th width="1%"></th>
  48. <th width="97%">Title</th>
  49. </thead>
  50. <tr ng-repeat="row in dashboard.rows">
  51. <td><i ng-click="_.move(dashboard.rows,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td>
  52. <td><i ng-click="_.move(dashboard.rows,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td>
  53. <td><i ng-click="dashboard.rows = _.without(dashboard.rows,row)" class="pointer icon-remove"></i></td>
  54. <td>{{row.title}}</td>
  55. </tr>
  56. </table>
  57. </div>
  58. <div class="span4">
  59. <h4>Add Row</h4>
  60. <label class="small">Title</label>
  61. <input type="text" class="input-normal" ng-model='row.title' placeholder="New row"></input>
  62. <label class="small">Height</label>
  63. <input type="text" class="input-mini" ng-model='row.height'></input>
  64. </div>
  65. </div>
  66. </div>
  67. <div ng-if="editor.index == 2" ng-controller="dashLoader">
  68. <div class="editor-row">
  69. <div class="section">
  70. <h5>Save to</h5>
  71. <div class="editor-option">
  72. <label class="small">Gist <tip>Requires your domain to be OAUTH registered with Github<tip></label><input type="checkbox" ng-model="dashboard.loader.save_gist" ng-checked="dashboard.loader.save_gist">
  73. </div>
  74. <div class="editor-option">
  75. <label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.loader.save_elasticsearch" ng-checked="dashboard.loader.save_elasticsearch">
  76. </div>
  77. </div>
  78. <div class="section">
  79. <h5>Load from</h5>
  80. <div class="editor-option">
  81. <label class="small">Gist</label><input type="checkbox" ng-model="dashboard.loader.load_gist" ng-checked="dashboard.loader.load_gist">
  82. </div>
  83. <div class="editor-option">
  84. <label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.loader.load_elasticsearch" ng-checked="dashboard.loader.load_elasticsearch">
  85. </div>
  86. </div>
  87. <div class="section">
  88. <h5>Sharing</h5>
  89. <div class="editor-option" >
  90. <label class="small">Allow Sharing <tip>Allow generating adhoc links to dashboards</tip></label><input type="checkbox" ng-model="dashboard.loader.save_temp" ng-checked="dashboard.loader.save_temp">
  91. </div>
  92. <div class="editor-option" ng-show="dashboard.loader.save_temp">
  93. <label class="small">TTL <tip>Expire temp urls</tip></label><input type="checkbox" ng-model="dashboard.loader.save_temp_ttl_enable">
  94. </div>
  95. <div class="editor-option" ng-show="dashboard.loader.save_temp &amp;&amp; dashboard.loader.save_temp_ttl_enable">
  96. <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.loader.save_temp_ttl">
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. <div ng-if="editor.index == 2">
  102. <div class="editor-row">
  103. <div class="section">
  104. <h5>Feature toggles</h5>
  105. <div class="editor-option" ng-repeat="pulldown in dashboard.pulldowns">
  106. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  107. </div>
  108. <div class="editor-option" ng-repeat="pulldown in dashboard.nav">
  109. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. <div ng-if="editor.index == 3">
  115. <ng-include src="'app/partials/loadmetrics.html'"></ng-include>
  116. </div>
  117. <div ng-if="editor.index == 4">
  118. <ng-include src="'app/partials/import.html'"></ng-include>
  119. </div>
  120. <div ng-repeat="pulldown in dashboard.nav" ng-controller="SubmenuCtrl" ng-show="editor.index == 5+$index">
  121. <ng-include ng-show="pulldown.enable" src="edit_path(pulldown.type)"></ng-include>
  122. <button ng-hide="pulldown.enable" class="btn" ng-click="pulldown.enable = true">Enable the {{pulldown.type}}</button>
  123. </div>
  124. </div>
  125. <div class="modal-footer">
  126. <div class="pull-left grafana-version-footer" ng-if="editor.index == 0">
  127. <span class="editor-option small">
  128. Grafana version: {{grafanaVersion}}
  129. </span>
  130. <div class="small" grafana-version-check>
  131. </div>
  132. </div>
  133. <button ng-click="add_row(dashboard,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
  134. <button type="button" class="btn btn-info" ng-click="editor.index=0;dismiss();reset_panel();dashboard.emit_refresh()">Close</button>
  135. </div>