Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f25a415a
Commit
f25a415a
authored
Jan 04, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Work on making grafana work in sub url
parent
9ba34aab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
5 deletions
+11
-5
grafana
+1
-1
pkg/api/api.go
+6
-3
pkg/middleware/auth.go
+2
-1
pkg/setting/setting.go
+2
-0
No files found.
grafana
@
5feed234
Subproject commit 5
a3d3f5098c3dfe42d4fbe63f3c43d0d1a154d8a
Subproject commit 5
feed2344ab8a5eb65ffeda9ccae8b768e9b8764
pkg/api/api.go
View file @
f25a415a
...
...
@@ -4,6 +4,7 @@ import (
"github.com/Unknwon/macaron"
"github.com/torkelo/grafana-pro/pkg/api/dtos"
"github.com/torkelo/grafana-pro/pkg/middleware"
"github.com/torkelo/grafana-pro/pkg/setting"
)
func
Register
(
m
*
macaron
.
Macaron
)
{
...
...
@@ -36,7 +37,7 @@ func Register(m *macaron.Macaron) {
m
.
Any
(
"/api/datasources/proxy/:id/*"
,
auth
,
ProxyDataSourceRequest
)
// user register
m
.
Get
(
"/register
/*_
"
,
Index
)
m
.
Get
(
"/register"
,
Index
)
m
.
Post
(
"/api/account"
,
CreateAccount
)
// dashboards
...
...
@@ -57,8 +58,10 @@ func Index(ctx *middleware.Context) {
return
}
ctx
.
Data
[
"user"
]
=
dtos
.
NewCurrentUser
(
ctx
.
UserAccount
)
ctx
.
Data
[
"settings"
]
=
settings
ctx
.
Data
[
"User"
]
=
dtos
.
NewCurrentUser
(
ctx
.
UserAccount
)
ctx
.
Data
[
"Settings"
]
=
settings
ctx
.
Data
[
"AppUrl"
]
=
setting
.
AppUrl
ctx
.
Data
[
"AppSubUrl"
]
=
setting
.
AppSubUrl
ctx
.
HTML
(
200
,
"index"
)
}
...
...
pkg/middleware/auth.go
View file @
f25a415a
...
...
@@ -9,6 +9,7 @@ import (
"github.com/torkelo/grafana-pro/pkg/bus"
m
"github.com/torkelo/grafana-pro/pkg/models"
"github.com/torkelo/grafana-pro/pkg/setting"
)
func
authGetRequestAccountId
(
c
*
Context
,
sess
session
.
Store
)
(
int64
,
error
)
{
...
...
@@ -29,7 +30,7 @@ func authGetRequestAccountId(c *Context, sess session.Store) (int64, error) {
}
func
authDenied
(
c
*
Context
)
{
c
.
Redirect
(
"/login"
)
c
.
Redirect
(
setting
.
AppSubUrl
+
"/login"
)
}
func
Auth
()
macaron
.
Handler
{
...
...
pkg/setting/setting.go
View file @
f25a415a
...
...
@@ -126,7 +126,9 @@ func NewConfigContext() {
if
err
!=
nil
{
log
.
Fatal
(
4
,
"Invalid root_url(%s): %s"
,
AppUrl
,
err
)
}
AppSubUrl
=
strings
.
TrimSuffix
(
url
.
Path
,
"/"
)
log
.
Info
(
"AppSubUrl: %v"
,
AppSubUrl
)
Protocol
=
HTTP
if
Cfg
.
MustValue
(
"server"
,
"protocol"
)
==
"https"
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment