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
3f95180c
Commit
3f95180c
authored
Nov 28, 2017
by
jomenxiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix render http[get] params error
parent
c0e08764
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 @
3f95180c
...
...
@@ -10,7 +10,11 @@ import (
)
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
)
renderOpts
:=
&
renderer
.
RenderOpts
{
...
...
pkg/util/url.go
View file @
3f95180c
...
...
@@ -9,10 +9,15 @@ type UrlQueryReader struct {
values
url
.
Values
}
func
NewUrlQueryReader
(
url
*
url
.
URL
)
*
UrlQueryReader
{
return
&
UrlQueryReader
{
values
:
url
.
Query
(),
func
NewUrlQueryReader
(
urlInfo
*
url
.
URL
)
(
*
UrlQueryReader
,
error
)
{
u
,
err
:=
url
.
ParseQuery
(
urlInfo
.
String
())
if
err
!=
nil
{
return
nil
,
err
}
return
&
UrlQueryReader
{
values
:
u
,
},
nil
}
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