feat(import): save gnetId for dashbards imported from grafana.net

This commit is contained in:
Torkel Ödegaard
2016-05-27 16:42:32 +02:00
parent c3708b3096
commit 0d4c76a029
4 changed files with 14 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ function (angular, $, _, moment) {
this.schemaVersion = data.schemaVersion || 0;
this.version = data.version || 0;
this.links = data.links || [];
this.gnetId = data.gnetId || null;
this._updateSchema(data);
this._initMeta(meta);
}

View File

@@ -147,10 +147,11 @@ export class DashImportCtrl {
return this.backendSrv.get('api/gnet/dashboards/' + dashboardId).then(res => {
this.gnetInfo = res;
// store reference to grafana.net
res.json.gnetId = dashboardId;
res.json.gnetId = res.id;
this.onUpload(res.json);
}).catch(err => {
this.gnetError = err.message || err;
err.isHandled = true;
this.gnetError = err.data.message || err;
});
}