Metrictank: fix bundled dashboard (#21209)

* update metrictank dashboard

* Restored dashboard datasource variable, and improved error handling in the import api handler

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
This commit is contained in:
Ryan McKinley
2019-12-20 02:42:47 -08:00
committed by Torkel Ödegaard
parent 05d831df29
commit 104c2e3636
3 changed files with 48 additions and 54 deletions

View File

@ -179,7 +179,6 @@ func GetPluginMarkdown(c *m.ReqContext) Response {
}
func ImportDashboard(c *m.ReqContext, apiCmd dtos.ImportDashboardCommand) Response {
cmd := plugins.ImportDashboardCommand{
OrgId: c.OrgId,
User: c.SignedInUser,
@ -192,7 +191,7 @@ func ImportDashboard(c *m.ReqContext, apiCmd dtos.ImportDashboardCommand) Respon
}
if err := bus.Dispatch(&cmd); err != nil {
return Error(500, "Failed to import dashboard", err)
return dashboardSaveErrorToApiResponse(err)
}
return JSON(200, cmd.Result)