mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
create annotations progress
This commit is contained in:
@@ -38,7 +38,12 @@ export class AnnotationsSrv {
|
||||
|
||||
// filter out annotations that do not belong to requesting panel
|
||||
annotations = _.filter(annotations, item => {
|
||||
if (item.panelId && options.panel.id !== item.panelId) {
|
||||
console.log(item);
|
||||
// shownIn === 1 requires annotation matching panel id
|
||||
if (item.source.showIn === 1) {
|
||||
if (item.panelId && options.panel.id === item.panelId) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -18,13 +18,13 @@ export class AnnotationsEditorCtrl {
|
||||
datasource: null,
|
||||
iconColor: 'rgba(255, 96, 96, 1)',
|
||||
enable: true,
|
||||
show: 0,
|
||||
showIn: 0,
|
||||
hide: false,
|
||||
};
|
||||
|
||||
showOptions: any = [
|
||||
{text: 'All Panels', value: 0},
|
||||
{text: 'Specifc Panels', value: 1},
|
||||
{text: 'Specific Panels', value: 1},
|
||||
];
|
||||
|
||||
/** @ngInject */
|
||||
@@ -51,7 +51,7 @@ export class AnnotationsEditorCtrl {
|
||||
|
||||
edit(annotation) {
|
||||
this.currentAnnotation = annotation;
|
||||
this.currentAnnotation.show = this.currentAnnotation.show || 0;
|
||||
this.currentAnnotation.showIn = this.currentAnnotation.showIn || 0;
|
||||
this.currentIsNew = false;
|
||||
this.datasourceChanged();
|
||||
this.mode = 'edit';
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<div class="gf-form">
|
||||
<span class="gf-form-label width-7">Show in</span>
|
||||
<div class="gf-form-select-wrapper width-12">
|
||||
<select class="gf-form-input" ng-model="ctrl.currentAnnotation.show" ng-options="f.value as f.text for f in ctrl.showOptions"></select>
|
||||
<select class="gf-form-input" ng-model="ctrl.currentAnnotation.showIn" ng-options="f.value as f.text for f in ctrl.showOptions"></select>
|
||||
</div>
|
||||
</div>
|
||||
<gf-form-switch class="gf-form"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<h5 class="section-heading text-center">Add annotation</h5>
|
||||
|
||||
<form name="ctrl.form" class="text-center">
|
||||
<div class="gf-form-group" style="display: inline-block">
|
||||
<div style="display: inline-block">
|
||||
<div class="gf-form">
|
||||
<span class="gf-form-label width-7">Title</span>
|
||||
<input type="text" ng-model="ctrl.annotation.title" class="gf-form-input max-width-20" required>
|
||||
|
||||
Reference in New Issue
Block a user