mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
NotificationChannels: Add delete button to edit page (#19103)
* Add delete button to edit notification channel page * Simplified code
This commit is contained in:
committed by
Torkel Ödegaard
parent
3d3bbb7159
commit
3827913105
@@ -100,6 +100,13 @@ export class AlertNotificationEditCtrl {
|
||||
}
|
||||
}
|
||||
|
||||
deleteNotification() {
|
||||
this.backendSrv.delete(`/api/alert-notifications/${this.model.id}`).then((res: any) => {
|
||||
this.model = res;
|
||||
this.$location.path('alerting/notifications');
|
||||
});
|
||||
}
|
||||
|
||||
getNotifierTemplateId(type: string) {
|
||||
return `notifier-options-${type}`;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
<div class="gf-form-group gf-form-button-row">
|
||||
<button type="submit" ng-click="ctrl.save()" class="btn btn-primary width-7">Save</button>
|
||||
<button type="submit" ng-click="ctrl.testNotification()" class="btn btn-secondary width-7">Send Test</button>
|
||||
<button type="delete" ng-if="!ctrl.isNew" ng-click="ctrl.deleteNotification()" class="btn btn-danger width-7">Delete</button>
|
||||
<a href="alerting/notifications" class="btn btn-inverse">Back</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user