Alerting: Handle image renderer unavailable when edit notifiers (#23711)

If no image renderer available/installed when adding a new  alert notification 
channel will set Include image to false per default, otherwise true as before.
If no image renderer available/installed when adding/edit alert notification 
channel will show an informational message that you need to install the 
Grafana Image Renderer plugin for Grafana to be able to render an image. 

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Marcus Efraimsson
2020-04-24 10:42:13 +02:00
committed by GitHub
parent 52154b465b
commit 98df2ec745
2 changed files with 15 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import { getBackendSrv } from '@grafana/runtime';
import { AppEvents } from '@grafana/data';
import { IScope } from 'angular';
import { promiseToDigest } from '../../core/utils/promiseToDigest';
import config from 'app/core/config';
export class AlertNotificationEditCtrl {
theForm: any;
@@ -27,6 +28,7 @@ export class AlertNotificationEditCtrl {
isDefault: false,
};
getFrequencySuggestion: any;
rendererAvailable: boolean;
/** @ngInject */
constructor(
@@ -43,6 +45,9 @@ export class AlertNotificationEditCtrl {
return ['1m', '5m', '10m', '15m', '30m', '1h'];
};
this.defaults.settings.uploadImage = config.rendererAvailable;
this.rendererAvailable = config.rendererAvailable;
promiseToDigest(this.$scope)(
getBackendSrv()
.get(`/api/alert-notifiers`)