mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix: annotations fix for snapshots, fixes #7659
This commit is contained in:
parent
87c978ebc9
commit
c3bad4701a
@ -144,6 +144,13 @@ export class AnnotationsSrv {
|
||||
}
|
||||
|
||||
translateQueryResult(annotation, results) {
|
||||
// if annotation has snapshotData
|
||||
// make clone and remove it
|
||||
if (annotation.snapshotData) {
|
||||
annotation = angular.copy(annotation);
|
||||
delete annotation.snapshotData;
|
||||
}
|
||||
|
||||
for (var item of results) {
|
||||
item.source = annotation;
|
||||
item.min = item.time;
|
||||
|
@ -58,7 +58,7 @@ export class EventManager {
|
||||
}
|
||||
|
||||
addFlotEvents(annotations, flotOptions) {
|
||||
if (!this.event || annotations.length === 0) {
|
||||
if (!this.event && annotations.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@
|
||||
<h5 class="section-heading">Options</h5>
|
||||
<div class="gf-form-inline">
|
||||
<div class="gf-form">
|
||||
<span class="gf-form-label width-7">Name</span>
|
||||
<span class="gf-form-label width-9">Name</span>
|
||||
<input type="text" class="gf-form-input width-12" ng-model='ctrl.currentAnnotation.name' placeholder="name"></input>
|
||||
</div>
|
||||
<div class="gf-form">
|
||||
@ -87,11 +87,11 @@
|
||||
label="Hide toggle"
|
||||
tooltip="Hides the annotation query toggle from showing at the top of the dashboard"
|
||||
checked="ctrl.currentAnnotation.hide"
|
||||
label-class="width-7">
|
||||
label-class="width-9">
|
||||
</gf-form-switch>
|
||||
</div>
|
||||
<div class="gf-form">
|
||||
<label class="gf-form-label width-7">Color</label>
|
||||
<label class="gf-form-label width-9">Color</label>
|
||||
<spectrum-picker class="gf-form-input width-3" ng-model="ctrl.currentAnnotation.iconColor"></spectrum-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -116,6 +116,7 @@ function (angular, _) {
|
||||
return {
|
||||
name: annotation.name,
|
||||
enable: annotation.enable,
|
||||
iconColor: annotation.iconColor,
|
||||
snapshotData: annotation.snapshotData
|
||||
};
|
||||
}).value();
|
||||
|
Loading…
Reference in New Issue
Block a user