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
89fb60a9
Unverified
Commit
89fb60a9
authored
Dec 01, 2017
by
Carl Bergquist
Committed by
GitHub
Dec 01, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10020 from jomenxiao/master
fix render http[get] params error
parents
92821828
3f95180c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
pkg/api/render.go
+5
-1
pkg/util/url.go
+8
-3
No files found.
pkg/api/render.go
View file @
89fb60a9
...
@@ -10,7 +10,11 @@ import (
...
@@ -10,7 +10,11 @@ import (
)
)
func
RenderToPng
(
c
*
middleware
.
Context
)
{
func
RenderToPng
(
c
*
middleware
.
Context
)
{
queryReader
:=
util
.
NewUrlQueryReader
(
c
.
Req
.
URL
)
queryReader
,
err
:=
util
.
NewUrlQueryReader
(
c
.
Req
.
URL
)
if
err
!=
nil
{
c
.
Handle
(
400
,
"Rander parameters error"
,
err
)
return
}
queryParams
:=
fmt
.
Sprintf
(
"?%s"
,
c
.
Req
.
URL
.
RawQuery
)
queryParams
:=
fmt
.
Sprintf
(
"?%s"
,
c
.
Req
.
URL
.
RawQuery
)
renderOpts
:=
&
renderer
.
RenderOpts
{
renderOpts
:=
&
renderer
.
RenderOpts
{
...
...
pkg/util/url.go
View file @
89fb60a9
...
@@ -9,10 +9,15 @@ type UrlQueryReader struct {
...
@@ -9,10 +9,15 @@ type UrlQueryReader struct {
values
url
.
Values
values
url
.
Values
}
}
func
NewUrlQueryReader
(
url
*
url
.
URL
)
*
UrlQueryReader
{
func
NewUrlQueryReader
(
urlInfo
*
url
.
URL
)
(
*
UrlQueryReader
,
error
)
{
return
&
UrlQueryReader
{
u
,
err
:=
url
.
ParseQuery
(
urlInfo
.
String
())
values
:
url
.
Query
(),
if
err
!=
nil
{
return
nil
,
err
}
}
return
&
UrlQueryReader
{
values
:
u
,
},
nil
}
}
func
(
r
*
UrlQueryReader
)
Get
(
name
string
,
def
string
)
string
{
func
(
r
*
UrlQueryReader
)
Get
(
name
string
,
def
string
)
string
{
...
...
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