mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Working on collaborators
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/torkelo/grafana-pro/pkg/components"
|
||||
"github.com/torkelo/grafana-pro/pkg/models"
|
||||
"github.com/torkelo/grafana-pro/pkg/stores"
|
||||
)
|
||||
|
||||
@@ -61,9 +62,9 @@ func (self *HttpServer) ListenAndServe() {
|
||||
|
||||
func (self *HttpServer) index(c *gin.Context) {
|
||||
viewModel := &IndexDto{}
|
||||
login, _ := c.Get("login")
|
||||
if login != nil {
|
||||
viewModel.User.Login = login.(string)
|
||||
userAccount, _ := c.Get("userAccount")
|
||||
if userAccount != nil {
|
||||
viewModel.User.Login = userAccount.(*models.UserAccount).Login
|
||||
}
|
||||
|
||||
c.HTML(200, "index.html", viewModel)
|
||||
@@ -74,12 +75,3 @@ func CacheHeadersMiddleware() gin.HandlerFunc {
|
||||
c.Writer.Header().Add("Cache-Control", "max-age=0, public, must-revalidate, proxy-revalidate")
|
||||
}
|
||||
}
|
||||
|
||||
// Api Handler Registration
|
||||
var routeHandlers = make([]routeHandlerRegisterFn, 0)
|
||||
|
||||
type routeHandlerRegisterFn func(self *HttpServer)
|
||||
|
||||
func addRoutes(fn routeHandlerRegisterFn) {
|
||||
routeHandlers = append(routeHandlers, fn)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user