editor.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <div ng-controller="AnnotationsEditorCtrl" ng-init="init()">
  2. <div class="gf-box-header">
  3. <div class="gf-box-title">
  4. <i class="fa fa-bolt"></i>
  5. Annotations
  6. </div>
  7. <div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
  8. <div ng-repeat="tab in ['Overview', 'Add', 'Edit']" data-title="{{tab}}">
  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">
  16. <div class="editor-row row" ng-if="editor.index == 0">
  17. <div class="span6">
  18. <div ng-if="annotations.length === 0">
  19. <em>No annotations defined</em>
  20. </div>
  21. <table class="grafana-options-table">
  22. <tr ng-repeat="annotation in annotations">
  23. <td style="width:90%">
  24. <i class="fa fa-bolt"></i> &nbsp;
  25. {{annotation.name}}
  26. </td>
  27. <td style="width: 1%"><i ng-click="_.move(annotations,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
  28. <td style="width: 1%"><i ng-click="_.move(annotations,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
  29. <td style="width: 1%" class="nobg">
  30. <a ng-click="edit(annotation)" class="btn btn-inverse btn-mini">
  31. <i class="fa fa-edit"></i>
  32. Edit
  33. </a>
  34. </td>
  35. <td style="width: 1%" class="nobg">
  36. <a ng-click="removeAnnotation(annotation)" class="btn btn-danger btn-mini">
  37. <i class="fa fa-remove"></i>
  38. </a>
  39. </td>
  40. </tr>
  41. </table>
  42. </div>
  43. </div>
  44. <div ng-if="editor.index == 1 || (editor.index == 2 && !currentIsNew)">
  45. <div class="editor-row">
  46. <div class="editor-option">
  47. <label class="small">Name</label>
  48. <input type="text" class="input-medium" ng-model='currentAnnotation.name' placeholder="name"></input>
  49. </div>
  50. <div class="editor-option">
  51. <label class="small">Datasource</label>
  52. <select ng-model="currentAnnotation.datasource" ng-options="f.name as f.name for f in datasources" ng-change="datasourceChanged()"></select>
  53. </div>
  54. <div class="editor-option text-center">
  55. <label class="small">Icon color</label>
  56. <spectrum-picker ng-model="currentAnnotation.iconColor"></spectrum-picker>
  57. </div>
  58. <div class="editor-option">
  59. <label class="small">Icon size</label>
  60. <select class="input-mini" ng-model="currentAnnotation.iconSize" ng-options="f for f in [7,8,9,10,13,15,17,20,25,30]"></select>
  61. </div>
  62. <editor-opt-bool text="Grid line" model="currentAnnotation.showLine"></editor-opt-bool>
  63. <div class="editor-option text-center">
  64. <label class="small">Line color</label>
  65. <spectrum-picker ng-model="currentAnnotation.lineColor"></spectrum-picker>
  66. </div>
  67. </div>
  68. <datasource-editor-view datasource="currentAnnotation.datasource" name="annotations-query-editor"></datasource-editor-view>
  69. <br>
  70. <button ng-show="editor.index === 1" type="button" class="btn btn-success" ng-click="add()">Add</button>
  71. <button ng-show="editor.index === 2" type="button" class="btn btn-success pull-left" ng-click="update();">Update</button>
  72. <br>
  73. <br>
  74. </div>
  75. </div>
  76. </div>