|
|
@@ -1,67 +1,72 @@
|
|
|
<div ng-controller="AnnotationsEditorCtrl" ng-init="init()">
|
|
|
- <div class="modal-body">
|
|
|
- <div class="pull-right editor-title">Annotations</div>
|
|
|
|
|
|
- <div class="editor-row">
|
|
|
- <table class="table table-striped annotation-editor-table" style="width: 700px">
|
|
|
- <thead>
|
|
|
- <th width="90%">Name</th>
|
|
|
- <th width="1%"></th>
|
|
|
- <th width="1%"></th>
|
|
|
- <th width="1%"></th>
|
|
|
- </thead>
|
|
|
- <tr ng-repeat="annotation in annotations">
|
|
|
- <td>
|
|
|
- <a ng-click="edit(annotation)" bs-tooltip="'Click to edit'">
|
|
|
- <i class="icon-cog"></i>
|
|
|
- {{annotation.name}}
|
|
|
- </a>
|
|
|
- </td>
|
|
|
- <td><i ng-click="_.move(annotations,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td>
|
|
|
- <td><i ng-click="_.move(annotations,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td>
|
|
|
- <td><i ng-click="removeAnnotation(annotation)" class="pointer icon-remove"></i></td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
- </div>
|
|
|
+ <div class="dashboard-editor-header">
|
|
|
+ <div class="dashboard-editor-title">
|
|
|
+ <i class="icon icon-bolt"></i>
|
|
|
+ Annotations
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="editor-row">
|
|
|
- <h4 ng-show="currentIsNew">Add Annotation</h4>
|
|
|
- <h4 ng-show="!currentIsNew">Edit Annotation</h4>
|
|
|
+ <div ng-model="editor.index" bs-tabs style="text-transform:capitalize;">
|
|
|
+ <div ng-repeat="tab in ['Overview', 'Add', 'Edit']" data-title="{{tab}}">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Name</label>
|
|
|
- <input type="text" class="input-medium" ng-model='currentAnnotation.name' placeholder="name"></input>
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Datasource</label>
|
|
|
- <select ng-model="currentDatasource" ng-options="f.name for f in datasources" ng-change="setDatasource()"></select>
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Icon color</label>
|
|
|
- <spectrum-picker ng-model="currentAnnotation.iconColor"></spectrum-picker>
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Icon size</label>
|
|
|
- <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>
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Grid line</label>
|
|
|
- <input type="checkbox" ng-model="currentAnnotation.showLine" ng-checked="currentAnnotation.showLine">
|
|
|
- </div>
|
|
|
- <div class="editor-option">
|
|
|
- <label class="small">Line color</label>
|
|
|
- <spectrum-picker ng-model="currentAnnotation.lineColor"></spectrum-picker>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div ng-include src="currentDatasource.editorSrc">
|
|
|
- </div>
|
|
|
+ <div class="dashboard-editor-body">
|
|
|
|
|
|
-</div>
|
|
|
+ <div class="editor-row" ng-if="editor.index == 0">
|
|
|
+ <table class="table table-striped annotation-editor-table" style="width: 700px">
|
|
|
+ <tr ng-repeat="annotation in annotations">
|
|
|
+ <td style="width:90%">
|
|
|
+ <a ng-click="edit(annotation)" bs-tooltip="'Click to edit'" data-placement="right">
|
|
|
+ <i class="icon-bolt"></i>
|
|
|
+ {{annotation.name}}
|
|
|
+ </a>
|
|
|
+ </td>
|
|
|
+ <td><i ng-click="_.move(annotations,$index,$index-1)" ng-hide="$first" class="pointer icon-arrow-up"></i></td>
|
|
|
+ <td><i ng-click="_.move(annotations,$index,$index+1)" ng-hide="$last" class="pointer icon-arrow-down"></i></td>
|
|
|
+ <td><i ng-click="removeAnnotation(annotation)" class="pointer icon-remove"></i></td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
|
|
|
-<div class="modal-footer">
|
|
|
- <button ng-show="currentIsNew" type="button" class="btn btn-success" ng-click="add()">Add annotation</button>
|
|
|
- <button ng-show="!currentIsNew" type="button" class="btn btn-success" ng-click="update()">Update</button>
|
|
|
- <button type="button" class="btn btn-danger" ng-click="close_edit();dismiss();dashboard.refresh();">Close</button>
|
|
|
-</div>
|
|
|
+ <div ng-if="editor.index == 1 || (editor.index == 2 && !currentIsNew)">
|
|
|
+ <div class="editor-row">
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Name</label>
|
|
|
+ <input type="text" class="input-medium" ng-model='currentAnnotation.name' placeholder="name"></input>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Datasource</label>
|
|
|
+ <select ng-model="currentDatasource" ng-options="f.name for f in datasources" ng-change="setDatasource()"></select>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Icon color</label>
|
|
|
+ <spectrum-picker ng-model="currentAnnotation.iconColor"></spectrum-picker>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Icon size</label>
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Grid line</label>
|
|
|
+ <input type="checkbox" ng-model="currentAnnotation.showLine" ng-checked="currentAnnotation.showLine">
|
|
|
+ </div>
|
|
|
+ <div class="editor-option">
|
|
|
+ <label class="small">Line color</label>
|
|
|
+ <spectrum-picker ng-model="currentAnnotation.lineColor"></spectrum-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div ng-include src="currentDatasource.editorSrc">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button ng-show="currentIsNew" type="button" class="btn btn-success" ng-click="add()">Add annotation</button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="dashboard-editor-footer">
|
|
|
+ <button type="button" class="btn btn-success pull-right" ng-click="close_edit();dismiss();dashboard.refresh();">Close</button>
|
|
|
+ </div>
|
|
|
</div>
|