Skip to content

Commit

Permalink
dashboards: should be possible to browse dashboard using only uid
Browse files Browse the repository at this point in the history
That is, the slug part of url should be optional.
Closes grafana#11231

(cherry picked from commit 5fbfd67)
  • Loading branch information
marefr authored and bergquist committed Mar 14, 2018
1 parent a747ec3 commit e1b554c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func (hs *HttpServer) registerRoutes() {
r.Get("/plugins/:id/page/:page", reqSignedIn, Index)

r.Get("/d/:uid/:slug", reqSignedIn, Index)
r.Get("/d/:uid", reqSignedIn, Index)
r.Get("/dashboard/db/:slug", reqSignedIn, redirectFromLegacyDashboardUrl, Index)
r.Get("/dashboard/script/*", reqSignedIn, Index)
r.Get("/dashboard-solo/snapshot/*", Index)
Expand Down
6 changes: 6 additions & 0 deletions public/app/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export function setupAngularRoutes($routeProvider, $locationProvider) {
reloadOnSearch: false,
pageClass: 'page-dashboard',
})
.when('/d/:uid', {
templateUrl: 'public/app/partials/dashboard.html',
controller: 'LoadDashboardCtrl',
reloadOnSearch: false,
pageClass: 'page-dashboard',
})
.when('/dashboard/:type/:slug', {
templateUrl: 'public/app/partials/dashboard.html',
controller: 'LoadDashboardCtrl',
Expand Down

0 comments on commit e1b554c

Please sign in to comment.