mirror of
https://github.com/grafana/grafana.git
synced 2024-11-21 16:38:03 -06:00
removed the need for symbolic link to grafana/src
This commit is contained in:
parent
b2f70c12b9
commit
e738a67e06
@ -1,9 +1,12 @@
|
|||||||
[run]
|
[run]
|
||||||
init_cmds = [["./bin/grafana", "web"]]
|
init_cmds = [
|
||||||
|
["make", "build"],
|
||||||
|
["./bin/grafana", "web"]
|
||||||
|
]
|
||||||
watch_all = true
|
watch_all = true
|
||||||
watch_dirs = [
|
watch_dirs = [
|
||||||
"$WORKDIR/pkg",
|
"$WORKDIR/pkg",
|
||||||
"$WORKDIR/views",
|
"$WORKDIR/templates",
|
||||||
"$WORKDIR/conf",
|
"$WORKDIR/conf",
|
||||||
]
|
]
|
||||||
watch_exts = [".go", ".ini"]
|
watch_exts = [".go", ".ini"]
|
||||||
|
BIN
grafana-pro
BIN
grafana-pro
Binary file not shown.
@ -22,8 +22,8 @@ import (
|
|||||||
|
|
||||||
var CmdWeb = cli.Command{
|
var CmdWeb = cli.Command{
|
||||||
Name: "web",
|
Name: "web",
|
||||||
Usage: "Start Grafana Pro web server",
|
Usage: "grafana web",
|
||||||
Description: `Start Grafana Pro server`,
|
Description: "Starts Grafana backend & web server",
|
||||||
Action: runWeb,
|
Action: runWeb,
|
||||||
Flags: []cli.Flag{},
|
Flags: []cli.Flag{},
|
||||||
}
|
}
|
||||||
@ -33,14 +33,14 @@ func newMacaron() *macaron.Macaron {
|
|||||||
m.Use(middleware.Logger())
|
m.Use(middleware.Logger())
|
||||||
m.Use(macaron.Recovery())
|
m.Use(macaron.Recovery())
|
||||||
|
|
||||||
mapStatic(m, "public", "public")
|
mapStatic(m, "", "public")
|
||||||
mapStatic(m, "public/app", "app")
|
mapStatic(m, "app", "app")
|
||||||
mapStatic(m, "public/img", "img")
|
mapStatic(m, "img", "img")
|
||||||
|
|
||||||
m.Use(session.Sessioner(setting.SessionOptions))
|
m.Use(session.Sessioner(setting.SessionOptions))
|
||||||
|
|
||||||
m.Use(macaron.Renderer(macaron.RenderOptions{
|
m.Use(macaron.Renderer(macaron.RenderOptions{
|
||||||
Directory: path.Join(setting.StaticRootPath, "views"),
|
Directory: setting.TemplatesRootPath,
|
||||||
IndentJSON: macaron.Env != macaron.PROD,
|
IndentJSON: macaron.Env != macaron.PROD,
|
||||||
Delims: macaron.Delims{Left: "[[", Right: "]]"},
|
Delims: macaron.Delims{Left: "[[", Right: "]]"},
|
||||||
}))
|
}))
|
||||||
|
@ -52,6 +52,7 @@ var (
|
|||||||
CertFile, KeyFile string
|
CertFile, KeyFile string
|
||||||
RouterLogging bool
|
RouterLogging bool
|
||||||
StaticRootPath string
|
StaticRootPath string
|
||||||
|
TemplatesRootPath string
|
||||||
|
|
||||||
// Session settings.
|
// Session settings.
|
||||||
SessionOptions session.Options
|
SessionOptions session.Options
|
||||||
@ -137,7 +138,8 @@ func NewConfigContext() {
|
|||||||
HttpPort = port
|
HttpPort = port
|
||||||
}
|
}
|
||||||
|
|
||||||
StaticRootPath = Cfg.MustValue("server", "static_root_path", workDir)
|
StaticRootPath = Cfg.MustValue("server", "static_root_path", path.Join(workDir, "grafana/src"))
|
||||||
|
TemplatesRootPath = Cfg.MustValue("server", "templates_path", path.Join(workDir, "templates"))
|
||||||
RouterLogging = Cfg.MustBool("server", "router_logging", false)
|
RouterLogging = Cfg.MustBool("server", "router_logging", false)
|
||||||
|
|
||||||
// PhantomJS rendering
|
// PhantomJS rendering
|
||||||
|
Loading…
Reference in New Issue
Block a user