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
3defb444
Unverified
Commit
3defb444
authored
Jul 27, 2020
by
Torkel Ödegaard
Committed by
GitHub
Jul 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Settings: Remove global variable (#26613)
parent
ae3c2853
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
12 deletions
+1
-12
pkg/api/metrics.go
+1
-2
pkg/setting/setting.go
+0
-10
No files found.
pkg/api/metrics.go
View file @
3defb444
...
...
@@ -7,7 +7,6 @@ import (
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/api/dtos"
"github.com/grafana/grafana/pkg/bus"
...
...
@@ -77,7 +76,7 @@ func (hs *HTTPServer) QueryMetricsV2(c *models.ReqContext, reqDto dtos.MetricReq
return
Error
(
500
,
"Metric request error"
,
err
)
}
}
else
{
if
!
settin
g
.
IsExpressionsEnabled
()
{
if
!
hs
.
Cf
g
.
IsExpressionsEnabled
()
{
return
Error
(
404
,
"Expressions feature toggle is not enabled"
,
nil
)
}
...
...
pkg/setting/setting.go
View file @
3defb444
...
...
@@ -215,7 +215,6 @@ var (
S3TempImageStoreSecretKey
string
ImageUploadProvider
string
FeatureToggles
map
[
string
]
bool
)
// TODO move all global vars to this struct
...
...
@@ -1023,7 +1022,6 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
for
_
,
feature
:=
range
util
.
SplitString
(
featuresTogglesStr
)
{
cfg
.
FeatureToggles
[
feature
]
=
true
}
FeatureToggles
=
cfg
.
FeatureToggles
// check old location for this option
if
panelsSection
.
Key
(
"enable_alpha"
)
.
MustBool
(
false
)
{
...
...
@@ -1191,11 +1189,3 @@ func (s *DynamicSection) Key(k string) *ini.Key {
func
(
cfg
*
Cfg
)
SectionWithEnvOverrides
(
s
string
)
*
DynamicSection
{
return
&
DynamicSection
{
cfg
.
Raw
.
Section
(
s
),
cfg
.
Logger
}
}
func
IsExpressionsEnabled
()
bool
{
v
,
ok
:=
FeatureToggles
[
"expressions"
]
if
!
ok
{
return
false
}
return
v
}
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