fix scripted dashboard loader, #10350 (#10351)

This commit is contained in:
Alexander Zobnin
2017-12-27 11:36:25 +03:00
committed by Torkel Ödegaard
parent 2559259763
commit d4ff603eb0

View File

@@ -20,7 +20,7 @@ export class DashboardLoaderSrv {
private $rootScope private $rootScope
) {} ) {}
_dashboardLoadFailed(title, snapshot) { _dashboardLoadFailed(title, snapshot?) {
snapshot = snapshot || false; snapshot = snapshot || false;
return { return {
meta: { meta: {
@@ -74,9 +74,9 @@ export class DashboardLoaderSrv {
var url = 'public/dashboards/' + file.replace(/\.(?!js)/, '/') + '?' + new Date().getTime(); var url = 'public/dashboards/' + file.replace(/\.(?!js)/, '/') + '?' + new Date().getTime();
return this.$http({ url: url, method: 'GET' }) return this.$http({ url: url, method: 'GET' })
.then(this._executeScript) .then(this._executeScript.bind(this))
.then( .then(
function(result) { result => {
return { return {
meta: { meta: {
fromScript: true, fromScript: true,
@@ -87,7 +87,7 @@ export class DashboardLoaderSrv {
dashboard: result.data, dashboard: result.data,
}; };
}, },
function(err) { err => {
console.log('Script dashboard error ' + err); console.log('Script dashboard error ' + err);
this.$rootScope.appEvent('alert-error', [ this.$rootScope.appEvent('alert-error', [
'Script Error', 'Script Error',