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
ea56288f
Unverified
Commit
ea56288f
authored
Apr 17, 2018
by
Carl Bergquist
Committed by
GitHub
Apr 17, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11611 from mjtrangoni/fix-unconvert-issues
fix unconvert issues
parents
0976a46c
ce941a00
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
14 additions
and
14 deletions
+14
-14
pkg/cmd/grafana-cli/services/services.go
+1
-1
pkg/components/apikeygen/apikeygen.go
+2
-2
pkg/components/imguploader/azureblobuploader.go
+1
-1
pkg/components/null/float.go
+1
-1
pkg/metrics/metrics.go
+1
-1
pkg/models/datasource_cache.go
+1
-1
pkg/plugins/models.go
+1
-1
pkg/plugins/update_checker.go
+1
-1
pkg/services/alerting/notifiers/line.go
+1
-1
pkg/tsdb/cloudwatch/annotation_query.go
+2
-2
pkg/tsdb/prometheus/prometheus.go
+2
-2
No files found.
pkg/cmd/grafana-cli/services/services.go
View file @
ea56288f
...
@@ -42,7 +42,7 @@ func Init(version string, skipTLSVerify bool) {
...
@@ -42,7 +42,7 @@ func Init(version string, skipTLSVerify bool) {
}
}
HttpClient
=
http
.
Client
{
HttpClient
=
http
.
Client
{
Timeout
:
time
.
Duration
(
10
*
time
.
Second
)
,
Timeout
:
10
*
time
.
Second
,
Transport
:
tr
,
Transport
:
tr
,
}
}
}
}
...
...
pkg/components/apikeygen/apikeygen.go
View file @
ea56288f
...
@@ -33,7 +33,7 @@ func New(orgId int64, name string) KeyGenResult {
...
@@ -33,7 +33,7 @@ func New(orgId int64, name string) KeyGenResult {
jsonString
,
_
:=
json
.
Marshal
(
jsonKey
)
jsonString
,
_
:=
json
.
Marshal
(
jsonKey
)
result
.
ClientSecret
=
base64
.
StdEncoding
.
EncodeToString
(
[]
byte
(
jsonString
)
)
result
.
ClientSecret
=
base64
.
StdEncoding
.
EncodeToString
(
jsonString
)
return
result
return
result
}
}
...
@@ -44,7 +44,7 @@ func Decode(keyString string) (*ApiKeyJson, error) {
...
@@ -44,7 +44,7 @@ func Decode(keyString string) (*ApiKeyJson, error) {
}
}
var
keyObj
ApiKeyJson
var
keyObj
ApiKeyJson
err
=
json
.
Unmarshal
(
[]
byte
(
jsonString
)
,
&
keyObj
)
err
=
json
.
Unmarshal
(
jsonString
,
&
keyObj
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
ErrInvalidApiKey
return
nil
,
ErrInvalidApiKey
}
}
...
...
pkg/components/imguploader/azureblobuploader.go
View file @
ea56288f
...
@@ -225,7 +225,7 @@ func (a *Auth) SignRequest(req *http.Request) {
...
@@ -225,7 +225,7 @@ func (a *Auth) SignRequest(req *http.Request) {
)
)
decodedKey
,
_
:=
base64
.
StdEncoding
.
DecodeString
(
a
.
Key
)
decodedKey
,
_
:=
base64
.
StdEncoding
.
DecodeString
(
a
.
Key
)
sha256
:=
hmac
.
New
(
sha256
.
New
,
[]
byte
(
decodedKey
)
)
sha256
:=
hmac
.
New
(
sha256
.
New
,
decodedKey
)
sha256
.
Write
([]
byte
(
strToSign
))
sha256
.
Write
([]
byte
(
strToSign
))
signature
:=
base64
.
StdEncoding
.
EncodeToString
(
sha256
.
Sum
(
nil
))
signature
:=
base64
.
StdEncoding
.
EncodeToString
(
sha256
.
Sum
(
nil
))
...
...
pkg/components/null/float.go
View file @
ea56288f
...
@@ -50,7 +50,7 @@ func (f *Float) UnmarshalJSON(data []byte) error {
...
@@ -50,7 +50,7 @@ func (f *Float) UnmarshalJSON(data []byte) error {
}
}
switch
x
:=
v
.
(
type
)
{
switch
x
:=
v
.
(
type
)
{
case
float64
:
case
float64
:
f
.
Float64
=
float64
(
x
)
f
.
Float64
=
x
case
map
[
string
]
interface
{}
:
case
map
[
string
]
interface
{}
:
err
=
json
.
Unmarshal
(
data
,
&
f
.
NullFloat64
)
err
=
json
.
Unmarshal
(
data
,
&
f
.
NullFloat64
)
case
nil
:
case
nil
:
...
...
pkg/metrics/metrics.go
View file @
ea56288f
...
@@ -403,6 +403,6 @@ func sendUsageStats() {
...
@@ -403,6 +403,6 @@ func sendUsageStats() {
out
,
_
:=
json
.
MarshalIndent
(
report
,
""
,
" "
)
out
,
_
:=
json
.
MarshalIndent
(
report
,
""
,
" "
)
data
:=
bytes
.
NewBuffer
(
out
)
data
:=
bytes
.
NewBuffer
(
out
)
client
:=
http
.
Client
{
Timeout
:
time
.
Duration
(
5
*
time
.
Second
)
}
client
:=
http
.
Client
{
Timeout
:
5
*
time
.
Second
}
go
client
.
Post
(
"https://stats.grafana.org/grafana-usage-report"
,
"application/json"
,
data
)
go
client
.
Post
(
"https://stats.grafana.org/grafana-usage-report"
,
"application/json"
,
data
)
}
}
pkg/models/datasource_cache.go
View file @
ea56288f
...
@@ -33,7 +33,7 @@ func (ds *DataSource) GetHttpClient() (*http.Client, error) {
...
@@ -33,7 +33,7 @@ func (ds *DataSource) GetHttpClient() (*http.Client, error) {
}
}
return
&
http
.
Client
{
return
&
http
.
Client
{
Timeout
:
time
.
Duration
(
30
*
time
.
Second
)
,
Timeout
:
30
*
time
.
Second
,
Transport
:
transport
,
Transport
:
transport
,
},
nil
},
nil
}
}
...
...
pkg/plugins/models.go
View file @
ea56288f
...
@@ -69,7 +69,7 @@ func (pb *PluginBase) registerPlugin(pluginDir string) error {
...
@@ -69,7 +69,7 @@ func (pb *PluginBase) registerPlugin(pluginDir string) error {
for
_
,
include
:=
range
pb
.
Includes
{
for
_
,
include
:=
range
pb
.
Includes
{
if
include
.
Role
==
""
{
if
include
.
Role
==
""
{
include
.
Role
=
m
.
R
oleType
(
m
.
ROLE_VIEWER
)
include
.
Role
=
m
.
R
OLE_VIEWER
}
}
}
}
...
...
pkg/plugins/update_checker.go
View file @
ea56288f
...
@@ -13,7 +13,7 @@ import (
...
@@ -13,7 +13,7 @@ import (
)
)
var
(
var
(
httpClient
http
.
Client
=
http
.
Client
{
Timeout
:
time
.
Duration
(
10
*
time
.
Second
)
}
httpClient
http
.
Client
=
http
.
Client
{
Timeout
:
10
*
time
.
Second
}
)
)
type
GrafanaNetPlugin
struct
{
type
GrafanaNetPlugin
struct
{
...
...
pkg/services/alerting/notifiers/line.go
View file @
ea56288f
...
@@ -90,7 +90,7 @@ func (this *LineNotifier) createAlert(evalContext *alerting.EvalContext) error {
...
@@ -90,7 +90,7 @@ func (this *LineNotifier) createAlert(evalContext *alerting.EvalContext) error {
}
}
if
err
:=
bus
.
DispatchCtx
(
evalContext
.
Ctx
,
cmd
);
err
!=
nil
{
if
err
:=
bus
.
DispatchCtx
(
evalContext
.
Ctx
,
cmd
);
err
!=
nil
{
this
.
log
.
Error
(
"Failed to send notification to LINE"
,
"error"
,
err
,
"body"
,
string
(
body
)
)
this
.
log
.
Error
(
"Failed to send notification to LINE"
,
"error"
,
err
,
"body"
,
body
)
return
err
return
err
}
}
...
...
pkg/tsdb/cloudwatch/annotation_query.go
View file @
ea56288f
...
@@ -72,7 +72,7 @@ func (e *CloudWatchExecutor) executeAnnotationQuery(ctx context.Context, queryCo
...
@@ -72,7 +72,7 @@ func (e *CloudWatchExecutor) executeAnnotationQuery(ctx context.Context, queryCo
MetricName
:
aws
.
String
(
metricName
),
MetricName
:
aws
.
String
(
metricName
),
Dimensions
:
qd
,
Dimensions
:
qd
,
Statistic
:
aws
.
String
(
s
),
Statistic
:
aws
.
String
(
s
),
Period
:
aws
.
Int64
(
int64
(
period
)
),
Period
:
aws
.
Int64
(
period
),
}
}
resp
,
err
:=
svc
.
DescribeAlarmsForMetric
(
params
)
resp
,
err
:=
svc
.
DescribeAlarmsForMetric
(
params
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -88,7 +88,7 @@ func (e *CloudWatchExecutor) executeAnnotationQuery(ctx context.Context, queryCo
...
@@ -88,7 +88,7 @@ func (e *CloudWatchExecutor) executeAnnotationQuery(ctx context.Context, queryCo
MetricName
:
aws
.
String
(
metricName
),
MetricName
:
aws
.
String
(
metricName
),
Dimensions
:
qd
,
Dimensions
:
qd
,
ExtendedStatistic
:
aws
.
String
(
s
),
ExtendedStatistic
:
aws
.
String
(
s
),
Period
:
aws
.
Int64
(
int64
(
period
)
),
Period
:
aws
.
Int64
(
period
),
}
}
resp
,
err
:=
svc
.
DescribeAlarmsForMetric
(
params
)
resp
,
err
:=
svc
.
DescribeAlarmsForMetric
(
params
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
pkg/tsdb/prometheus/prometheus.go
View file @
ea56288f
...
@@ -108,8 +108,8 @@ func (e *PrometheusExecutor) Query(ctx context.Context, dsInfo *models.DataSourc
...
@@ -108,8 +108,8 @@ func (e *PrometheusExecutor) Query(ctx context.Context, dsInfo *models.DataSourc
span
,
ctx
:=
opentracing
.
StartSpanFromContext
(
ctx
,
"alerting.prometheus"
)
span
,
ctx
:=
opentracing
.
StartSpanFromContext
(
ctx
,
"alerting.prometheus"
)
span
.
SetTag
(
"expr"
,
query
.
Expr
)
span
.
SetTag
(
"expr"
,
query
.
Expr
)
span
.
SetTag
(
"start_unixnano"
,
int64
(
query
.
Start
.
UnixNano
()
))
span
.
SetTag
(
"start_unixnano"
,
query
.
Start
.
UnixNano
(
))
span
.
SetTag
(
"stop_unixnano"
,
int64
(
query
.
End
.
UnixNano
()
))
span
.
SetTag
(
"stop_unixnano"
,
query
.
End
.
UnixNano
(
))
defer
span
.
Finish
()
defer
span
.
Finish
()
value
,
err
:=
client
.
QueryRange
(
ctx
,
query
.
Expr
,
timeRange
)
value
,
err
:=
client
.
QueryRange
(
ctx
,
query
.
Expr
,
timeRange
)
...
...
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