dasboard_history: big refactoring of how the compare api looked, now a POST with a model for new & base version, refactored a simplified UI code as well, this was done to lay foundation to make it possible to do diff against current in browser unsaved version

This commit is contained in:
Torkel Ödegaard
2017-06-07 11:50:09 +02:00
parent 948e5ae74d
commit ef1dfed0d8
11 changed files with 235 additions and 302 deletions

View File

@ -226,11 +226,10 @@ func (hs *HttpServer) registerRoutes() {
r.Get("/id/:dashboardId/versions", wrap(GetDashboardVersions))
r.Get("/id/:dashboardId/versions/:id", wrap(GetDashboardVersion))
r.Get("/id/:dashboardId/compare/:versions", wrap(CompareDashboardVersions))
r.Get("/id/:dashboardId/compare/:versions/html", wrap(CompareDashboardVersionsJSON))
r.Get("/id/:dashboardId/compare/:versions/basic", wrap(CompareDashboardVersionsBasic))
r.Post("/id/:dashboardId/restore", reqEditorRole, bind(dtos.RestoreDashboardVersionCommand{}), wrap(RestoreDashboardVersion))
r.Post("/calculate-diff", bind(dtos.CalculateDiffOptions{}), wrap(CalculateDashboardDiff))
r.Post("/db", reqEditorRole, bind(m.SaveDashboardCommand{}), wrap(PostDashboard))
r.Get("/file/:file", GetDashboardFromJsonFile)
r.Get("/home", wrap(GetHomeDashboard))