|
|
@@ -257,11 +257,11 @@ export class BackendSrv {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- deleteDashboard(slug) {
|
|
|
+ deleteDashboard(uid) {
|
|
|
let deferred = this.$q.defer();
|
|
|
|
|
|
- this.getDashboard('db', slug).then(fullDash => {
|
|
|
- this.delete(`/api/dashboards/db/${slug}`)
|
|
|
+ this.getDashboardByUid(uid).then(fullDash => {
|
|
|
+ this.delete(`/api/dashboards/uid/${uid}`)
|
|
|
.then(() => {
|
|
|
deferred.resolve(fullDash);
|
|
|
})
|
|
|
@@ -273,21 +273,21 @@ export class BackendSrv {
|
|
|
return deferred.promise;
|
|
|
}
|
|
|
|
|
|
- deleteDashboards(dashboardSlugs) {
|
|
|
+ deleteDashboards(dashboardUids) {
|
|
|
const tasks = [];
|
|
|
|
|
|
- for (let slug of dashboardSlugs) {
|
|
|
- tasks.push(this.createTask(this.deleteDashboard.bind(this), true, slug));
|
|
|
+ for (let uid of dashboardUids) {
|
|
|
+ tasks.push(this.createTask(this.deleteDashboard.bind(this), true, uid));
|
|
|
}
|
|
|
|
|
|
return this.executeInOrder(tasks, []);
|
|
|
}
|
|
|
|
|
|
- moveDashboards(dashboardSlugs, toFolder) {
|
|
|
+ moveDashboards(dashboardUids, toFolder) {
|
|
|
const tasks = [];
|
|
|
|
|
|
- for (let slug of dashboardSlugs) {
|
|
|
- tasks.push(this.createTask(this.moveDashboard.bind(this), true, slug, toFolder));
|
|
|
+ for (let uid of dashboardUids) {
|
|
|
+ tasks.push(this.createTask(this.moveDashboard.bind(this), true, uid, toFolder));
|
|
|
}
|
|
|
|
|
|
return this.executeInOrder(tasks, []).then(result => {
|
|
|
@@ -299,10 +299,10 @@ export class BackendSrv {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private moveDashboard(slug, toFolder) {
|
|
|
+ private moveDashboard(uid, toFolder) {
|
|
|
let deferred = this.$q.defer();
|
|
|
|
|
|
- this.getDashboard('db', slug).then(fullDash => {
|
|
|
+ this.getDashboardByUid(uid).then(fullDash => {
|
|
|
const model = new DashboardModel(fullDash.dashboard, fullDash.meta);
|
|
|
|
|
|
if ((!fullDash.meta.folderId && toFolder.id === 0) || fullDash.meta.folderId === toFolder.id) {
|