Просмотр исходного кода

Alert tab fails when datasource method targetContainsTemplate doesnt exist #14274

Johannes Schill 7 лет назад
Родитель
Сommit
fe9e4b51f1
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      public/app/features/alerting/AlertTabCtrl.ts

+ 1 - 1
public/app/features/alerting/AlertTabCtrl.ts

@@ -262,7 +262,7 @@ export class AlertTabCtrl {
       this.datasourceSrv.get(datasourceName).then(ds => {
       this.datasourceSrv.get(datasourceName).then(ds => {
         if (!ds.meta.alerting) {
         if (!ds.meta.alerting) {
           this.error = 'The datasource does not support alerting queries';
           this.error = 'The datasource does not support alerting queries';
-        } else if (ds.targetContainsTemplate(foundTarget)) {
+        } else if (ds.targetContainsTemplate && ds.targetContainsTemplate(foundTarget)) {
           this.error = 'Template variables are not supported in alert queries';
           this.error = 'Template variables are not supported in alert queries';
         } else {
         } else {
           this.error = '';
           this.error = '';