dasheditor.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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']" 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="row-fluid">
  11. <div class="span4">
  12. <label class="small">Title</label><input type="text" class="input-large" ng-model='dashboard.current.title'></input>
  13. </div>
  14. <div class="span1">
  15. <label class="small"> Editable </label><input type="checkbox" ng-model="dashboard.current.editable" ng-checked="dashboard.current.editable" />
  16. </div>
  17. <div class="span1">
  18. <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" />
  19. </div>
  20. <div class="span2">
  21. <label class="small">Hide controls</label>
  22. <input type="checkbox" ng-model="dashboard.current.hideControls" ng-checked="dashboard.current.hideControls">
  23. </div>
  24. <div class="span3">
  25. <label class="small">Style</label><select class="input-small" ng-model="dashboard.current.style" ng-options="f for f in ['dark','light']"></select>
  26. </div>
  27. </div>
  28. </div>
  29. <div ng-show="editor.index == 1">
  30. <div class="row-fluid">
  31. <div class="span12">
  32. <table class="table table-condensed table-striped">
  33. <thead>
  34. <th>Title</th>
  35. <th>Delete</th>
  36. <th>Move</th>
  37. </thead>
  38. <tr ng-repeat="row in dashboard.current.rows">
  39. <td>{{row.title}}</td>
  40. <td><i ng-click="dashboard.current.rows = _.without(dashboard.current.rows,row)" class="pointer icon-remove"></i></td>
  41. <td><i ng-click="_.move(dashboard.current.rows,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td>
  42. <td><i ng-click="_.move(dashboard.current.rows,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td>
  43. </tr>
  44. </table>
  45. </div>
  46. </div>
  47. <div class="row-fluid">
  48. <form>
  49. <div class="span5">
  50. <label class="small">Title</label>
  51. <input type="text" class="input-large" ng-model='row.title' placeholder="New row"></input>
  52. </div>
  53. <div class="span2">
  54. <label class="small">Height</label>
  55. <input type="text" class="input-mini" ng-model='row.height'></input>
  56. </div>
  57. <div class="span1">
  58. <label class="small"> Editable </label>
  59. <input type="checkbox" ng-model="row.editable" ng-checked="row.editable" />
  60. </div>
  61. </form>
  62. </div>
  63. </div>
  64. <div ng-show="editor.index == 2">
  65. <h5>Pulldowns</h5>
  66. <div class="row-fluid">
  67. <div class="span2" ng-repeat="pulldown in dashboard.current.pulldowns">
  68. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  69. </div>
  70. <div class="span2" ng-repeat="pulldown in dashboard.current.nav">
  71. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  72. </div>
  73. </div>
  74. </div>
  75. <div ng-show="editor.index == 2" ng-controller="dashLoader">
  76. <h5>Save to</h5>
  77. <div class="row-fluid">
  78. <div class="span2">
  79. <label class="small">Export</label><input type="checkbox" ng-model="dashboard.current.loader.save_local" ng-checked="dashboard.current.loader.save_local">
  80. </div>
  81. <div class="span2">
  82. <label class="small">Browser</label><input type="checkbox" ng-model="dashboard.current.loader.save_default" ng-checked="dashboard.current.loader.save_default">
  83. </div>
  84. <div class="span2">
  85. <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">
  86. </div>
  87. <div class="span2">
  88. <label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.current.loader.save_elasticsearch" ng-checked="dashboard.current.loader.save_elasticsearch">
  89. </div>
  90. </div>
  91. <h5>Load from</h5>
  92. <div class="row-fluid">
  93. <div class="span2">
  94. <label class="small">Local file</label><input type="checkbox" ng-model="dashboard.current.loader.load_local" ng-checked="dashboard.current.loader.load_local">
  95. </div>
  96. <div class="span2">
  97. <label class="small">Gist</label><input type="checkbox" ng-model="dashboard.current.loader.load_gist" ng-checked="dashboard.current.loader.load_gist">
  98. </div>
  99. <div class="span2">
  100. <label class="small">Elasticsearch</label><input type="checkbox" ng-model="dashboard.current.loader.load_elasticsearch" ng-checked="dashboard.current.loader.load_elasticsearch">
  101. </div>
  102. <div class="span3" ng-show="dashboard.current.loader.load.elasticsearch">
  103. <label class="small">ES list size</label><input class="input-mini" type="number" ng-model="dashboard.current.loader.load_elasticsearch_size">
  104. </div>
  105. </div>
  106. <h5>Sharing</h5>
  107. <div class="row-fluid">
  108. <div class="span2" >
  109. <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">
  110. </div>
  111. <div class="span2" ng-show="dashboard.current.loader.save_temp">
  112. <label class="small">TTL <tip>Expire temp urls</tip></label><input type="checkbox" ng-model="dashboard.current.loader.save_temp_ttl_enable">
  113. </div>
  114. <div class="span5" ng-show="dashboard.current.loader.save_temp &amp;&amp; dashboard.current.loader.save_temp_ttl_enable">
  115. <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">
  116. </div>
  117. </div>
  118. </div>
  119. <div ng-show="editor.index == 3">
  120. <ng-include src="'app/partials/loadmetrics.html'"></ng-include>
  121. </div>
  122. <div ng-repeat="pulldown in dashboard.current.nav" ng-controller="PulldownCtrl" ng-show="editor.index == 4+$index">
  123. <ng-include ng-show="pulldown.enable" src="edit_path(pulldown.type)"></ng-include>
  124. <button ng-hide="pulldown.enable" class="btn" ng-click="pulldown.enable = true">Enable the {{pulldown.type}}</button>
  125. </div>
  126. </div>
  127. <div class="modal-footer">
  128. <button ng-click="add_row(dashboard.current,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
  129. <button type="button" class="btn btn-danger" ng-click="editor.index=0;dismiss();reset_panel();dashboard.refresh()">Close</button>
  130. </div>