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
56d449b2
Commit
56d449b2
authored
Aug 12, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated
parent
24579d86
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
11 deletions
+22
-11
backend/api/api.go
+16
-6
grafana
+1
-1
grafana-pro
+0
-0
views/index.html
+5
-4
No files found.
backend/api/api.go
View file @
56d449b2
...
...
@@ -39,7 +39,10 @@ func (self *HttpServer) ListenAndServe() {
self
.
router
=
gin
.
Default
()
self
.
router
.
Use
(
CacheHeadersMiddleware
())
self
.
router
.
Use
(
self
.
AuthMiddleware
())
self
.
router
.
Static
(
"/public"
,
"./public"
)
self
.
router
.
Static
(
"/app"
,
"./public/app"
)
self
.
router
.
Static
(
"/img"
,
"./public/img"
)
// register & parse templates
templates
:=
template
.
New
(
"templates"
)
...
...
@@ -47,15 +50,14 @@ func (self *HttpServer) ListenAndServe() {
templates
.
ParseFiles
(
"./views/index.html"
)
self
.
router
.
SetHTMLTemplate
(
templates
)
// register default route
self
.
router
.
GET
(
"/"
,
self
.
index
)
for
_
,
fn
:=
range
routeHandlers
{
fn
(
self
)
}
self
.
router
.
Static
(
"/public"
,
"./public"
)
self
.
router
.
Static
(
"/app"
,
"./public/app"
)
self
.
router
.
Static
(
"/img"
,
"./public/img"
)
// register default route
self
.
router
.
GET
(
"/"
,
self
.
AuthMiddleware
(),
self
.
index
)
self
.
router
.
GET
(
"/login/*_"
,
self
.
index
)
self
.
router
.
GET
(
"/dashboard/*_"
,
self
.
index
)
self
.
router
.
Run
(
":"
+
self
.
port
)
}
...
...
@@ -64,9 +66,17 @@ func (self *HttpServer) index(c *gin.Context) {
c
.
HTML
(
200
,
"index.html"
,
&
indexViewModel
{
title
:
"hello from go"
})
}
func
(
self
*
HttpServer
)
login
(
c
*
gin
.
Context
)
{
c
.
HTML
(
200
,
"login.html"
,
&
indexViewModel
{
title
:
"hello from go"
})
}
func
(
self
*
HttpServer
)
AuthMiddleware
()
gin
.
HandlerFunc
{
return
func
(
c
*
gin
.
Context
)
{
session
,
_
:=
sessionStore
.
Get
(
c
.
Request
,
"grafana-session"
)
// if session.Values["login"] == nil {
// c.Writer.Header().Set("Location", "/login/login#login")
// c.Abort(302)
// }
session
.
Values
[
"asd"
]
=
1
session
.
Save
(
c
.
Request
,
c
.
Writer
)
}
...
...
grafana
@
c690d4aa
Subproject commit
8699dec57162ed419da47e7206ea58f8ec3250a3
Subproject commit
c690d4aae84fc39d7c4bf9a0a820a71f69059b78
grafana-pro
View file @
56d449b2
No preview for this file type
views/index.html
View file @
56d449b2
...
...
@@ -7,11 +7,12 @@
<meta
name=
"viewport"
content=
"width=device-width"
>
<title>
Grafana
</title>
<link
rel=
"stylesheet"
href=
"public/css/grafana.dark.min.css"
title=
"Dark"
>
<link
rel=
"stylesheet"
href=
"/public/css/grafana.dark.min.css"
title=
"Dark"
>
<base
href=
"/"
>
<!-- build:js app/app.js -->
<script
src=
"public/vendor/require/require.js"
></script>
<script
src=
"public/app/components/require.config.js"
></script>
<script
src=
"
/
public/vendor/require/require.js"
></script>
<script
src=
"
/
public/app/components/require.config.js"
></script>
<!-- endbuild -->
<script>
require
([
'app'
],
function
(
app
)
{
app
.
boot
();
})
</script>
...
...
@@ -20,7 +21,7 @@
<body
ng-cloak
ng-controller=
"GrafanaCtrl"
>
<link
rel=
"stylesheet"
href=
"public/css/grafana.light.min.css"
ng-if=
"grafana.style === 'light'"
>
<link
rel=
"stylesheet"
href=
"
/
public/css/grafana.light.min.css"
ng-if=
"grafana.style === 'light'"
>
<div
ng-repeat=
'alert in dashAlerts.list'
class=
"alert-{{alert.severity}} dashboard-notice"
ng-show=
"$last"
>
<button
type=
"button"
class=
"close"
ng-click=
"dashAlerts.clear(alert)"
style=
"padding-right:50px"
>
×
</button>
...
...
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