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
86f51520
Commit
86f51520
authored
Jun 01, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When role is viewer and edit URL is loaded view mode will be loaded instead, Closes #2089
parent
83e7c487
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
14 deletions
+7
-14
public/app/features/dashboard/viewStateSrv.js
+4
-3
public/app/features/panel/panelMenu.js
+3
-3
public/app/features/panel/panelSrv.js
+0
-8
No files found.
public/app/features/dashboard/viewStateSrv.js
View file @
86f51520
...
...
@@ -130,10 +130,11 @@ function (angular, _, $) {
var
docHeight
=
$
(
window
).
height
();
var
editHeight
=
Math
.
floor
(
docHeight
*
0.3
);
var
fullscreenHeight
=
Math
.
floor
(
docHeight
*
0.7
);
this
.
oldTimeRange
=
panelScope
.
range
;
panelScope
.
height
=
this
.
state
.
edit
?
editHeight
:
fullscreenHeight
;
panelScope
.
editMode
=
this
.
state
.
edit
;
panelScope
.
editMode
=
this
.
state
.
edit
&&
this
.
$scope
.
dashboardMeta
.
canEdit
;
panelScope
.
height
=
panelScope
.
editMode
?
editHeight
:
fullscreenHeight
;
this
.
oldTimeRange
=
panelScope
.
range
;
this
.
fullscreenPanel
=
panelScope
;
$
(
window
).
scrollTop
(
0
);
...
...
public/app/features/panel/panelMenu.js
View file @
86f51520
...
...
@@ -8,7 +8,7 @@ function (angular, $, _) {
angular
.
module
(
'grafana.directives'
)
.
directive
(
'panelMenu'
,
function
(
$compile
,
linkSrv
,
contextSrv
)
{
.
directive
(
'panelMenu'
,
function
(
$compile
,
linkSrv
)
{
var
linkTemplate
=
'<span class="panel-title drag-handle pointer">'
+
'<span class="panel-title-text drag-handle">{{panel.title | interpolateTemplateVars:this}}</span>'
+
...
...
@@ -19,7 +19,7 @@ function (angular, $, _) {
function
createMenuTemplate
(
$scope
)
{
var
template
=
'<div class="panel-menu small">'
;
if
(
$scope
.
dashboardMeta
.
canEdit
&&
contextSrv
.
isEditor
)
{
if
(
$scope
.
dashboardMeta
.
canEdit
)
{
template
+=
'<div class="panel-menu-inner">'
;
template
+=
'<div class="panel-menu-row">'
;
template
+=
'<a class="panel-menu-icon pull-left" ng-click="updateColumnSpan(-1)"><i class="fa fa-minus"></i></a>'
;
...
...
@@ -34,7 +34,7 @@ function (angular, $, _) {
_
.
each
(
$scope
.
panelMeta
.
menu
,
function
(
item
)
{
// skip edit actions if not editor
if
(
item
.
role
===
'Editor'
&&
(
!
contextSrv
.
isEditor
||
!
$scope
.
dashboardMeta
.
canEdit
)
)
{
if
(
item
.
role
===
'Editor'
&&
!
$scope
.
dashboardMeta
.
canEdit
)
{
return
;
}
...
...
public/app/features/panel/panelSrv.js
View file @
86f51520
...
...
@@ -71,14 +71,6 @@ function (angular, _, config) {
};
$scope
.
toggleFullscreen
=
function
(
edit
)
{
if
(
edit
&&
$scope
.
dashboardMeta
.
canEdit
===
false
)
{
$scope
.
appEvent
(
'alert-warning'
,
[
'Dashboard not editable'
,
'Use Save As.. feature to create an editable copy of this dashboard.'
]);
return
;
}
$scope
.
dashboardViewState
.
update
({
fullscreen
:
true
,
edit
:
edit
,
panelId
:
$scope
.
panel
.
id
});
};
...
...
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