diff --git a/public/app/features/plugins/ds_edit_ctrl.ts b/public/app/features/plugins/ds_edit_ctrl.ts index d2ca7a82dc4..57e43983b8c 100644 --- a/public/app/features/plugins/ds_edit_ctrl.ts +++ b/public/app/features/plugins/ds_edit_ctrl.ts @@ -134,6 +134,24 @@ export class DataSourceEditCtrl { }); } }; + + confirmDelete() { + this.backendSrv.delete('/api/datasources/' + this.current.id).then(() => { + this.$location.path('datasources'); + }); + } + + delete(s) { + this.$scope.appEvent('confirm-modal', { + title: 'Delete', + text: 'Are you sure you want to delete this datasource?', + yesText: "Delete", + icon: "fa-trash", + onConfirm: () => { + this.confirmDelete(); + } + }); + } } coreModule.controller('DataSourceEditCtrl', DataSourceEditCtrl); diff --git a/public/app/features/plugins/partials/ds_edit.html b/public/app/features/plugins/partials/ds_edit.html index 3305bfd67af..1470a312bb0 100644 --- a/public/app/features/plugins/partials/ds_edit.html +++ b/public/app/features/plugins/partials/ds_edit.html @@ -66,6 +66,9 @@ + Cancel diff --git a/public/app/features/plugins/partials/ds_list.html b/public/app/features/plugins/partials/ds_list.html index 314c165a3ac..c5ca9f514a4 100644 --- a/public/app/features/plugins/partials/ds_list.html +++ b/public/app/features/plugins/partials/ds_list.html @@ -18,23 +18,28 @@
| name | -type | -url | -- | - | - |
|---|---|---|---|---|---|
| - - {{ds.name}} - - | -- {{ds.type}} - | -- {{ds.url}} - | -- - default - - | -- - - Edit - - | -- - - - | -