From ad4cf373a6054520124b956b612ef64a7e7c36f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 31 Dec 2014 19:02:00 +0100 Subject: [PATCH] Work on unifying backend grafnaa and standalone grafana, and being able to build both from the same branch --- grafana | 2 +- main.go | 4 ++-- pkg/cmd/web.go | 4 +++- pkg/setting/setting.go | 2 -- templates/404.html | 18 -------------- templates/index.html | 53 ------------------------------------------ 6 files changed, 6 insertions(+), 77 deletions(-) delete mode 100644 templates/404.html delete mode 100644 templates/index.html diff --git a/grafana b/grafana index 47f226be3b4..33e3fc70b28 160000 --- a/grafana +++ b/grafana @@ -1 +1 @@ -Subproject commit 47f226be3b480e037692f30a320c6fcff2b9e01c +Subproject commit 33e3fc70b286e0a1ebee901006e8f70b63b69198 diff --git a/main.go b/main.go index 95929a39f79..716ce1ab0ef 100644 --- a/main.go +++ b/main.go @@ -17,8 +17,8 @@ func init() { func main() { app := cli.NewApp() - app.Name = "Grafana Pro" - app.Usage = "Grafana Pro Service" + app.Name = "Grafana Backend" + app.Usage = "grafana web" app.Version = APP_VER app.Commands = []cli.Command{cmd.CmdWeb} app.Flags = append(app.Flags, []cli.Flag{}...) diff --git a/pkg/cmd/web.go b/pkg/cmd/web.go index b96834c600e..5e85d0387c4 100644 --- a/pkg/cmd/web.go +++ b/pkg/cmd/web.go @@ -35,12 +35,14 @@ func newMacaron() *macaron.Macaron { mapStatic(m, "", "public") mapStatic(m, "app", "app") + mapStatic(m, "css", "css") mapStatic(m, "img", "img") + mapStatic(m, "font", "font") m.Use(session.Sessioner(setting.SessionOptions)) m.Use(macaron.Renderer(macaron.RenderOptions{ - Directory: setting.TemplatesRootPath, + Directory: path.Join(setting.StaticRootPath, "views"), IndentJSON: macaron.Env != macaron.PROD, Delims: macaron.Delims{Left: "[[", Right: "]]"}, })) diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index f000d2b4bde..2285e9c5046 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -52,7 +52,6 @@ var ( CertFile, KeyFile string RouterLogging bool StaticRootPath string - TemplatesRootPath string // Session settings. SessionOptions session.Options @@ -139,7 +138,6 @@ func NewConfigContext() { } 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) // PhantomJS rendering diff --git a/templates/404.html b/templates/404.html deleted file mode 100644 index 7f975a35e3b..00000000000 --- a/templates/404.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - Grafana - - - - - - -

404

- - - diff --git a/templates/index.html b/templates/index.html deleted file mode 100644 index 4c5d61bd69f..00000000000 --- a/templates/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - Grafana - - - - - - - - - - - - - - - - -
- - - -
-
- -
{{alert.title}}
-
-
-
- -
- -
- - - - -