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
27831965
Commit
27831965
authored
Oct 07, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated
parent
e84f06b5
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
7 additions
and
4 deletions
+7
-4
data/sessions/5/a/5a7a6d798450f878d373110c50ed07ae3bc99d63
+0
-0
data/sessions/5/e/5e40ff05d87ac75cba0634e7350c263c4c45f202
+0
-0
data/sessions/7/a/7ad60c89b1bc7a310c66e59570df698fc75d28b3
+0
-0
data/sessions/7/b/7b786a2d47bb26f2fce2d9aa874615c6428c55a3
+0
-0
data/sessions/b/7/b724e1a2a6d52de49c11d1d62d6e0d83cba2911a
+0
-0
grafana-pro
+0
-0
pkg/middleware/logger.go
+1
-0
pkg/routes/api/api_render.go
+5
-3
pkg/routes/index.go
+1
-1
No files found.
data/sessions/5/a/5a7a6d798450f878d373110c50ed07ae3bc99d63
deleted
100644 → 0
View file @
e84f06b5
File deleted
data/sessions/5/e/5e40ff05d87ac75cba0634e7350c263c4c45f202
deleted
100644 → 0
View file @
e84f06b5
File deleted
data/sessions/7/a/7ad60c89b1bc7a310c66e59570df698fc75d28b3
deleted
100644 → 0
View file @
e84f06b5
File deleted
data/sessions/7/b/7b786a2d47bb26f2fce2d9aa874615c6428c55a3
deleted
100644 → 0
View file @
e84f06b5
File deleted
data/sessions/b/7/b724e1a2a6d52de49c11d1d62d6e0d83cba2911a
deleted
100644 → 0
View file @
e84f06b5
File deleted
grafana-pro
View file @
27831965
No preview for this file type
pkg/middleware/logger.go
View file @
27831965
...
@@ -44,6 +44,7 @@ func Logger() macaron.Handler {
...
@@ -44,6 +44,7 @@ func Logger() macaron.Handler {
switch
rw
.
Status
()
{
switch
rw
.
Status
()
{
case
200
:
case
200
:
content
=
fmt
.
Sprintf
(
"
\0
33[1;32m%s
\0
33[0m"
,
content
)
content
=
fmt
.
Sprintf
(
"
\0
33[1;32m%s
\0
33[0m"
,
content
)
return
case
304
:
case
304
:
return
return
content
=
fmt
.
Sprintf
(
"
\0
33[1;33m%s
\0
33[0m"
,
content
)
content
=
fmt
.
Sprintf
(
"
\0
33[1;33m%s
\0
33[0m"
,
content
)
...
...
pkg/routes/api/api_render.go
View file @
27831965
package
api
package
api
import
(
import
(
"net/http"
"strconv"
"strconv"
"github.com/torkelo/grafana-pro/pkg/components/renderer"
"github.com/torkelo/grafana-pro/pkg/components/renderer"
...
@@ -14,17 +15,18 @@ func RenderToPng(c *middleware.Context) {
...
@@ -14,17 +15,18 @@ func RenderToPng(c *middleware.Context) {
queryParams
:=
"?render&accountId="
+
strconv
.
Itoa
(
accountId
)
+
"&"
+
c
.
Req
.
URL
.
RawQuery
queryParams
:=
"?render&accountId="
+
strconv
.
Itoa
(
accountId
)
+
"&"
+
c
.
Req
.
URL
.
RawQuery
renderOpts
:=
&
renderer
.
RenderOpts
{
renderOpts
:=
&
renderer
.
RenderOpts
{
Url
:
c
.
Params
(
"
url
"
)
+
queryParams
,
Url
:
c
.
Params
(
"
*
"
)
+
queryParams
,
Width
:
queryReader
.
Get
(
"width"
,
"800"
),
Width
:
queryReader
.
Get
(
"width"
,
"800"
),
Height
:
queryReader
.
Get
(
"height"
,
"400"
),
Height
:
queryReader
.
Get
(
"height"
,
"400"
),
}
}
renderOpts
.
Url
=
"http://localhost:3000"
+
renderOpts
.
Url
renderOpts
.
Url
=
"http://localhost:3000
/
"
+
renderOpts
.
Url
pngPath
,
err
:=
renderer
.
RenderToPng
(
renderOpts
)
pngPath
,
err
:=
renderer
.
RenderToPng
(
renderOpts
)
if
err
!=
nil
{
if
err
!=
nil
{
c
.
HTML
(
500
,
"error.html"
,
nil
)
c
.
HTML
(
500
,
"error.html"
,
nil
)
}
}
c
.
ServeFile
(
pngPath
)
c
.
Resp
.
Header
()
.
Set
(
"Content-Type"
,
"image/png"
)
http
.
ServeFile
(
c
.
Resp
,
c
.
Req
,
pngPath
)
}
}
pkg/routes/index.go
View file @
27831965
...
@@ -27,7 +27,7 @@ func Register(m *macaron.Macaron) {
...
@@ -27,7 +27,7 @@ func Register(m *macaron.Macaron) {
m
.
Delete
(
"/api/dashboard/:slug"
,
auth
,
api
.
DeleteDashboard
)
m
.
Delete
(
"/api/dashboard/:slug"
,
auth
,
api
.
DeleteDashboard
)
// rendering
// rendering
m
.
Get
(
"/render/*
url
"
,
auth
,
api
.
RenderToPng
)
m
.
Get
(
"/render/*"
,
auth
,
api
.
RenderToPng
)
}
}
func
Index
(
ctx
*
middleware
.
Context
)
{
func
Index
(
ctx
*
middleware
.
Context
)
{
...
...
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