Browse Source

Single analytic unit in webhook image #799 (#800)

pull/1/head
rozetko 5 years ago committed by GitHub
parent
commit
517f5b5309
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      server/src/services/alert_service.ts

9
server/src/services/alert_service.ts

@ -50,8 +50,15 @@ export class Alert {
const dashboardApiURL = `${this.analyticUnit.grafanaUrl}/api/dashboards/uid/${dashdoardId}`;
const dashboardInfo: any = await axios.get(dashboardApiURL, { headers });
const dashboardName = _.last(dashboardInfo.data.meta.url.split('/'));
const renderUrl = `${this.analyticUnit.grafanaUrl}/render/d-solo/${dashdoardId}/${dashboardName}?panelId=${panelId}&ordId=${ORG_ID}&api-rendering`;
const renderUrl = `${this.analyticUnit.grafanaUrl}/render/d-solo/${dashdoardId}/${dashboardName}`;
const params = {
panelId,
ordId: ORG_ID,
apiRendering: true,
analyticUnitId: this.analyticUnit.id
};
const response = await axios.get(renderUrl, {
params,
headers,
responseType: 'arraybuffer'
});

Loading…
Cancel
Save