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
3fb4eb73
Unverified
Commit
3fb4eb73
authored
Jun 07, 2018
by
Marcus Efraimsson
Committed by
GitHub
Jun 07, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12175 from grafana/davkal/12168-fix-explore-setting
Respect explore settings in config ini
parents
82ae7c6e
3bd58446
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
3 deletions
+17
-3
pkg/api/frontendsettings.go
+1
-0
public/app/core/config.ts
+1
-0
public/app/core/services/keybindingSrv.ts
+2
-1
public/app/features/panel/metrics_panel_ctrl.ts
+1
-1
public/app/features/panel/specs/metrics_panel_ctrl.jest.ts
+12
-1
No files found.
pkg/api/frontendsettings.go
View file @
3fb4eb73
...
@@ -151,6 +151,7 @@ func getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
...
@@ -151,6 +151,7 @@ func getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
"authProxyEnabled"
:
setting
.
AuthProxyEnabled
,
"authProxyEnabled"
:
setting
.
AuthProxyEnabled
,
"ldapEnabled"
:
setting
.
LdapEnabled
,
"ldapEnabled"
:
setting
.
LdapEnabled
,
"alertingEnabled"
:
setting
.
AlertingEnabled
,
"alertingEnabled"
:
setting
.
AlertingEnabled
,
"exploreEnabled"
:
setting
.
ExploreEnabled
,
"googleAnalyticsId"
:
setting
.
GoogleAnalyticsId
,
"googleAnalyticsId"
:
setting
.
GoogleAnalyticsId
,
"disableLoginForm"
:
setting
.
DisableLoginForm
,
"disableLoginForm"
:
setting
.
DisableLoginForm
,
"externalUserMngInfo"
:
setting
.
ExternalUserMngInfo
,
"externalUserMngInfo"
:
setting
.
ExternalUserMngInfo
,
...
...
public/app/core/config.ts
View file @
3fb4eb73
...
@@ -16,6 +16,7 @@ class Settings {
...
@@ -16,6 +16,7 @@ class Settings {
defaultDatasource
:
string
;
defaultDatasource
:
string
;
alertingEnabled
:
boolean
;
alertingEnabled
:
boolean
;
authProxyEnabled
:
boolean
;
authProxyEnabled
:
boolean
;
exploreEnabled
:
boolean
;
ldapEnabled
:
boolean
;
ldapEnabled
:
boolean
;
oauth
:
any
;
oauth
:
any
;
disableUserSignUp
:
boolean
;
disableUserSignUp
:
boolean
;
...
...
public/app/core/services/keybindingSrv.ts
View file @
3fb4eb73
import
$
from
'jquery'
;
import
$
from
'jquery'
;
import
_
from
'lodash'
;
import
_
from
'lodash'
;
import
config
from
'app/core/config'
;
import
coreModule
from
'app/core/core_module'
;
import
coreModule
from
'app/core/core_module'
;
import
appEvents
from
'app/core/app_events'
;
import
appEvents
from
'app/core/app_events'
;
import
{
encodePathComponent
}
from
'app/core/utils/location_util'
;
import
{
encodePathComponent
}
from
'app/core/utils/location_util'
;
...
@@ -178,7 +179,7 @@ export class KeybindingSrv {
...
@@ -178,7 +179,7 @@ export class KeybindingSrv {
});
});
// jump to explore if permissions allow
// jump to explore if permissions allow
if
(
this
.
contextSrv
.
isEditor
)
{
if
(
this
.
contextSrv
.
isEditor
&&
config
.
exploreEnabled
)
{
this
.
bind
(
'x'
,
async
()
=>
{
this
.
bind
(
'x'
,
async
()
=>
{
if
(
dashboard
.
meta
.
focusPanelId
)
{
if
(
dashboard
.
meta
.
focusPanelId
)
{
const
panel
=
dashboard
.
getPanelById
(
dashboard
.
meta
.
focusPanelId
);
const
panel
=
dashboard
.
getPanelById
(
dashboard
.
meta
.
focusPanelId
);
...
...
public/app/features/panel/metrics_panel_ctrl.ts
View file @
3fb4eb73
...
@@ -314,7 +314,7 @@ class MetricsPanelCtrl extends PanelCtrl {
...
@@ -314,7 +314,7 @@ class MetricsPanelCtrl extends PanelCtrl {
getAdditionalMenuItems
()
{
getAdditionalMenuItems
()
{
const
items
=
[];
const
items
=
[];
if
(
this
.
contextSrv
.
isEditor
&&
this
.
datasource
&&
this
.
datasource
.
supportsExplore
)
{
if
(
config
.
exploreEnabled
&&
this
.
contextSrv
.
isEditor
&&
this
.
datasource
&&
this
.
datasource
.
supportsExplore
)
{
items
.
push
({
items
.
push
({
text
:
'Explore'
,
text
:
'Explore'
,
click
:
'ctrl.explore();'
,
click
:
'ctrl.explore();'
,
...
...
public/app/features/panel/specs/metrics_panel_ctrl.jest.ts
View file @
3fb4eb73
jest
.
mock
(
'app/core/core'
,
()
=>
({}));
jest
.
mock
(
'app/core/core'
,
()
=>
({}));
jest
.
mock
(
'app/core/config'
,
()
=>
{
return
{
exploreEnabled
:
true
,
panels
:
{
test
:
{
id
:
'test'
,
name
:
'test'
,
},
},
};
});
import
{
MetricsPanelCtrl
}
from
'../metrics_panel_ctrl'
;
import
q
from
'q'
;
import
q
from
'q'
;
import
{
PanelModel
}
from
'app/features/dashboard/panel_model'
;
import
{
PanelModel
}
from
'app/features/dashboard/panel_model'
;
import
{
MetricsPanelCtrl
}
from
'../metrics_panel_ctrl'
;
describe
(
'MetricsPanelCtrl'
,
()
=>
{
describe
(
'MetricsPanelCtrl'
,
()
=>
{
let
ctrl
;
let
ctrl
;
...
...
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