dasheditor.html 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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', '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>Feature toggles</h5>
  71. <div class="editor-option" ng-repeat="pulldown in dashboard.pulldowns">
  72. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  73. </div>
  74. <div class="editor-option" ng-repeat="pulldown in dashboard.nav">
  75. <label class="small" style="text-transform:capitalize;">{{pulldown.type}}</label><input type="checkbox" ng-model="pulldown.enable" ng-checked="pulldown.enable">
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div ng-if="editor.index == 3">
  81. <ng-include src="'app/partials/import.html'"></ng-include>
  82. </div>
  83. <div ng-repeat="pulldown in dashboard.nav" ng-controller="SubmenuCtrl" ng-show="editor.index == 4+$index">
  84. <ng-include ng-show="pulldown.enable" src="edit_path(pulldown.type)"></ng-include>
  85. <button ng-hide="pulldown.enable" class="btn" ng-click="pulldown.enable = true">Enable the {{pulldown.type}}</button>
  86. </div>
  87. </div>
  88. <div class="modal-footer">
  89. <div class="pull-left grafana-version-footer" ng-if="editor.index == 0">
  90. <span class="editor-option small">
  91. Grafana version: {{grafanaVersion}}
  92. </span>
  93. <div class="small" grafana-version-check>
  94. </div>
  95. </div>
  96. <button ng-click="add_row(dashboard,row); reset_row();" class="btn btn-success" ng-show="editor.index == 1">Create Row</button>
  97. <button type="button" class="btn btn-info" ng-click="editor.index=0;dismiss();reset_panel();dashboard.emit_refresh()">Close</button>
  98. </div>