mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
parent
52154b465b
commit
98df2ec745
@ -4,6 +4,7 @@ import { getBackendSrv } from '@grafana/runtime';
|
|||||||
import { AppEvents } from '@grafana/data';
|
import { AppEvents } from '@grafana/data';
|
||||||
import { IScope } from 'angular';
|
import { IScope } from 'angular';
|
||||||
import { promiseToDigest } from '../../core/utils/promiseToDigest';
|
import { promiseToDigest } from '../../core/utils/promiseToDigest';
|
||||||
|
import config from 'app/core/config';
|
||||||
|
|
||||||
export class AlertNotificationEditCtrl {
|
export class AlertNotificationEditCtrl {
|
||||||
theForm: any;
|
theForm: any;
|
||||||
@ -27,6 +28,7 @@ export class AlertNotificationEditCtrl {
|
|||||||
isDefault: false,
|
isDefault: false,
|
||||||
};
|
};
|
||||||
getFrequencySuggestion: any;
|
getFrequencySuggestion: any;
|
||||||
|
rendererAvailable: boolean;
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor(
|
constructor(
|
||||||
@ -43,6 +45,9 @@ export class AlertNotificationEditCtrl {
|
|||||||
return ['1m', '5m', '10m', '15m', '30m', '1h'];
|
return ['1m', '5m', '10m', '15m', '30m', '1h'];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.defaults.settings.uploadImage = config.rendererAvailable;
|
||||||
|
this.rendererAvailable = config.rendererAvailable;
|
||||||
|
|
||||||
promiseToDigest(this.$scope)(
|
promiseToDigest(this.$scope)(
|
||||||
getBackendSrv()
|
getBackendSrv()
|
||||||
.get(`/api/alert-notifiers`)
|
.get(`/api/alert-notifiers`)
|
||||||
|
@ -32,6 +32,16 @@
|
|||||||
checked="ctrl.model.settings.uploadImage"
|
checked="ctrl.model.settings.uploadImage"
|
||||||
tooltip="Captures an image and include it in the notification">
|
tooltip="Captures an image and include it in the notification">
|
||||||
</gf-form-switch>
|
</gf-form-switch>
|
||||||
|
<div class="grafana-info-box m-t-2" ng-show="ctrl.model.settings.uploadImage && !ctrl.rendererAvailable">
|
||||||
|
<h5>No image renderer available/installed</h5>
|
||||||
|
<p>
|
||||||
|
Grafana cannot find an image renderer to capture an image for the notification.
|
||||||
|
Please make sure the <a href="https://grafana.com/grafana/plugins/grafana-image-renderer" target="_blank" rel="noreferrer">Grafana Image Renderer plugin</a> is installed.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Please contact your Grafana administrator to install the plugin.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
<gf-form-switch
|
<gf-form-switch
|
||||||
class="gf-form"
|
class="gf-form"
|
||||||
label="Disable Resolve Message"
|
label="Disable Resolve Message"
|
||||||
|
Loading…
Reference in New Issue
Block a user