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
d38de2cc
Commit
d38de2cc
authored
Nov 05, 2016
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux(view/kiosk mode): added view mode and kiosk mode, #6476
parent
0d82fb71
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
95 additions
and
9 deletions
+95
-9
public/app/core/components/grafana_app.ts
+42
-0
public/app/core/services/keybindingSrv.ts
+8
-0
public/app/partials/dashboard.html
+1
-1
public/sass/mixins/_mixins.scss
+11
-0
public/sass/pages/_dashboard.scss
+33
-8
No files found.
public/app/core/components/grafana_app.ts
View file @
d38de2cc
...
...
@@ -109,6 +109,48 @@ export function grafanaAppDirective(playlistSrv, contextSrv) {
$
(
"#tooltip, .tooltip"
).
remove
();
});
// handle kiosk mode
appEvents
.
on
(
'toggle-kiosk-mode'
,
()
=>
{
body
.
toggleClass
(
'page-kiosk-mode'
);
});
// handle in active view state class
var
lastActivity
=
new
Date
().
getTime
();
var
activeUser
=
true
;
var
inActiveTimeLimit
=
2
*
60
*
1000
;
function
checkForInActiveUser
()
{
if
(
!
activeUser
)
{
return
;
}
// only go to activity low mode on dashboard page
if
(
!
body
.
hasClass
(
'page-dashboard'
))
{
return
;
}
if
((
new
Date
().
getTime
()
-
lastActivity
)
>
inActiveTimeLimit
)
{
activeUser
=
false
;
body
.
addClass
(
'user-activity-low'
);
}
}
function
userActivityDetected
()
{
lastActivity
=
new
Date
().
getTime
();
if
(
!
activeUser
)
{
activeUser
=
true
;
body
.
removeClass
(
'user-activity-low'
);
}
}
body
.
mousemove
(
userActivityDetected
);
body
.
keydown
(
userActivityDetected
);
setInterval
(
checkForInActiveUser
,
1000
);
appEvents
.
on
(
'toggle-view-mode'
,
()
=>
{
lastActivity
=
0
;
checkForInActiveUser
();
});
// handle document clicks that should hide things
body
.
click
(
function
(
evt
)
{
var
target
=
$
(
evt
.
target
);
...
...
public/app/core/services/keybindingSrv.ts
View file @
d38de2cc
...
...
@@ -190,6 +190,14 @@ export class KeybindingSrv {
this
.
showDashEditView
(
'settings'
);
});
this
.
bind
(
'd k'
,
()
=>
{
appEvents
.
emit
(
'toggle-kiosk-mode'
);
});
this
.
bind
(
'd v'
,
()
=>
{
appEvents
.
emit
(
'toggle-view-mode'
);
});
this
.
bind
(
'esc'
,
()
=>
{
var
popups
=
$
(
'.popover.in'
);
if
(
popups
.
length
>
0
)
{
...
...
public/app/partials/dashboard.html
View file @
d38de2cc
<div
dash-class
ng-if=
"dashboard"
>
<div
dash-class
ng-if=
"dashboard"
>
<dashnav></dashnav>
<div
class=
"dashboard-container"
>
...
...
public/sass/mixins/_mixins.scss
View file @
d38de2cc
...
...
@@ -351,3 +351,14 @@
border-left
:
0
;
border-bottom
:
1px
solid
transparent
;
}
@mixin
hide-controls
()
{
.add-row-panel-hint
,
.dash-row-menu
{
display
:
none
;
}
.resize-panel-handle
,
.panel-drop-zone
{
visibility
:
hidden
;
}
}
public/sass/pages/_dashboard.scss
View file @
d38de2cc
...
...
@@ -14,11 +14,11 @@
}
.playlist-active
{
.add-row-panel-hint
,
@include
hide-controls
();
.dashnav-refresh-action
,
.dashnav-zoom-out
,
.dashnav-action-icons
,
.dash-row-menu
,
.dashnav-move-timeframe
{
display
:
none
;
}
...
...
@@ -29,15 +29,40 @@
}
.hide-controls
{
.add-row-panel-hint
{
@include
hide-controls
();
}
.page-kiosk-mode
{
@include
hide-controls
();
dashnav
{
display
:
none
;
}
.dash-row-menu
{
display
:
none
;
}
.user-activity-low
{
@include
hide-controls
();
.dashnav-refresh-action
,
.dashnav-zoom-out
,
.dashnav-action-icons
,
.dashnav-move-timeframe
{
opacity
:
0
;
transition
:
opacity
1
.5s
ease-in-out
;
}
// navbar buttons
.navbar-inner
{
background
:
transparent
;
transition
:
background
1
.5s
ease-in-out
;
}
.navbar-brand-btn
,
.navbar-page-btn
{
border
:
none
;
background
:
transparent
;
.fa
,
.icon-gf
{
opacity
:
0
;
transition
:
opacity
1s
ease-in-out
;
transition
:
opacity
1
.5s
ease-in-out
;
}
.resize-panel-handle
,
.panel-drop-zone
{
visibility
:
hidden
;
}
}
...
...
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