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
4c64bcfa
Commit
4c64bcfa
authored
Jun 12, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
keyboard binding now work again
parent
99d2f537
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
37 deletions
+36
-37
src/app/controllers/dash.js
+4
-5
src/app/controllers/grafanaCtrl.js
+3
-3
src/app/controllers/search.js
+1
-1
src/app/dashboards/default.json
+0
-1
src/app/partials/dashboard.html
+3
-3
src/app/partials/dasheditor.html
+1
-4
src/app/services/dashboard/dashboardKeyBindings.js
+23
-19
src/index.html
+1
-1
No files found.
src/app/controllers/dash.js
View file @
4c64bcfa
...
...
@@ -31,16 +31,13 @@ function (angular, $, config, _) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'DashCtrl'
,
function
(
$scope
,
$rootScope
,
dashboardKeybindings
,
filterSrv
,
dashboard
,
panelMoveSrv
,
alertSrv
,
timer
)
{
$scope
,
$rootScope
,
dashboardKeybindings
,
filterSrv
,
dashboard
,
panelMoveSrv
,
timer
)
{
$scope
.
editor
=
{
index
:
0
};
$scope
.
init
=
function
()
{
$scope
.
availablePanels
=
config
.
panels
;
dashboardKeybindings
.
shortcuts
();
$scope
.
onAppEvent
(
'setup-dashboard'
,
$scope
.
setupDashboard
,
$scope
);
$scope
.
onAppEvent
(
'setup-dashboard'
,
$scope
.
setupDashboard
);
};
$scope
.
setupDashboard
=
function
(
event
,
dashboardData
)
{
...
...
@@ -62,6 +59,8 @@ function (angular, $, config, _) {
window
.
document
.
title
=
'Grafana - '
+
$scope
.
dashboard
.
title
;
dashboardKeybindings
.
shortcuts
(
$scope
);
$scope
.
emitAppEvent
(
"dashboard-loaded"
,
$scope
.
dashboard
);
};
...
...
src/app/controllers/grafanaCtrl.js
View file @
4c64bcfa
...
...
@@ -17,12 +17,12 @@ function (angular, config, _) {
$scope
.
dashAlerts
=
alertSrv
;
};
$
scope
.
onAppEvent
=
function
(
name
,
callback
,
scope
)
{
$
rootScope
.
onAppEvent
=
function
(
name
,
callback
)
{
var
unbind
=
$rootScope
.
$on
(
name
,
callback
);
scope
.
$on
(
'$destroy'
,
unbind
);
this
.
$on
(
'$destroy'
,
unbind
);
};
$
s
cope
.
emitAppEvent
=
function
(
name
,
payload
)
{
$
rootS
cope
.
emitAppEvent
=
function
(
name
,
payload
)
{
$rootScope
.
$emit
(
name
,
payload
);
};
...
...
src/app/controllers/search.js
View file @
4c64bcfa
...
...
@@ -16,7 +16,7 @@ function (angular, _, config, $) {
$scope
.
selectedIndex
=
-
1
;
$scope
.
results
=
{
dashboards
:
[],
tags
:
[],
metrics
:
[]};
$scope
.
query
=
{
query
:
'title:'
};
$scope
.
onAppEvent
(
'open-search'
,
$scope
.
openSearch
,
$scope
);
$scope
.
onAppEvent
(
'open-search'
,
$scope
.
openSearch
);
};
$scope
.
keyDown
=
function
(
evt
)
{
...
...
src/app/dashboards/default.json
View file @
4c64bcfa
...
...
@@ -92,7 +92,6 @@
],
"editable"
:
true
,
"failover"
:
false
,
"panel_hints"
:
true
,
"style"
:
"dark"
,
"pulldowns"
:
[
{
...
...
src/app/partials/dashboard.html
View file @
4c64bcfa
<div
ng-controller=
"DashCtrl"
>
<div
ng-controller=
"DashCtrl"
body-class
>
<div
class=
"navbar navbar-static-top"
>
<div
class=
"navbar-inner"
>
...
...
@@ -42,7 +42,7 @@
<div
class=
"row-open"
ng-show=
"!row.collapse"
>
<div
ng-show=
"row.collapsable"
class=
'row-tab bgPrimary'
ng-click=
"toggle_row(row)"
>
<span
class=
"row-tab-button"
>
<i
class=
"icon-caret-right"
></i>
<i
class=
"icon-caret-right"
></i>
</span>
</div>
<div
class=
'row-tab bgSuccess dropdown'
ng-show=
"row.editable"
>
...
...
@@ -110,7 +110,7 @@
</div>
<div
ng-show=
'dashboard.editable
&& dashboard.panel_hints
'
class=
"row-fluid add-row-panel-hint"
>
<div
ng-show=
'dashboard.editable'
class=
"row-fluid add-row-panel-hint"
>
<div
class=
"span12"
style=
"text-align:right;"
>
<span
style=
"margin-right: 10px;"
ng-click=
"add_row_default()"
class=
"pointer btn btn-info btn-mini"
>
<span><i
class=
"icon-plus-sign"
></i>
ADD A ROW
</span>
...
...
src/app/partials/dasheditor.html
View file @
4c64bcfa
...
...
@@ -22,10 +22,7 @@
<select
ng-model=
"dashboard.timezone"
class=
'input-small'
ng-options=
"f for f in ['browser','utc']"
></select>
</div>
<div
class=
"editor-option"
>
<label
class=
"small"
>
Hints
<tip>
Show 'Add panel' hints in empty spaces
</tip></label><input
type=
"checkbox"
ng-model=
"dashboard.panel_hints"
ng-checked=
"dashboard.panel_hints"
/>
</div>
<div
class=
"editor-option"
>
<label
class=
"small"
>
Hide controls
</label>
<label
class=
"small"
>
Hide controls (CTRL+H)
</label>
<input
type=
"checkbox"
ng-model=
"dashboard.hideControls"
ng-checked=
"dashboard.hideControls"
>
</div>
</div>
...
...
src/app/services/dashboard/dashboardKeyBindings.js
View file @
4c64bcfa
...
...
@@ -8,50 +8,54 @@ function(angular, $) {
var
module
=
angular
.
module
(
'kibana.services'
);
module
.
service
(
'dashboardKeybindings'
,
function
(
$rootScope
,
keyboardManager
,
dashboard
)
{
module
.
service
(
'dashboardKeybindings'
,
function
(
$rootScope
,
keyboardManager
)
{
this
.
hasRegistered
=
false
;
this
.
shortcuts
=
function
()
{
if
(
this
.
hasRegistered
)
{
return
;
}
this
.
shortcuts
=
function
(
scope
)
{
this
.
hasRegistered
=
true
;
$rootScope
.
$on
(
'panel-fullscreen-enter'
,
function
()
{
scope
.
onAppEvent
(
'panel-fullscreen-enter'
,
function
()
{
$rootScope
.
fullscreen
=
true
;
});
$rootScope
.
$on
(
'panel-fullscreen-exit'
,
function
()
{
scope
.
onAppEvent
(
'panel-fullscreen-exit'
,
function
()
{
$rootScope
.
fullscreen
=
false
;
});
$rootScope
.
$on
(
'dashboard-saved'
,
function
()
{
scope
.
onAppEvent
(
'dashboard-saved'
,
function
()
{
if
(
$rootScope
.
fullscreen
)
{
$rootScope
.
$emi
t
(
'panel-fullscreen-exit'
);
scope
.
emitAppEven
t
(
'panel-fullscreen-exit'
);
}
});
scope
.
$on
(
'$destroy'
,
function
()
{
console
.
log
(
'unbind keyboardManager'
);
keyboardManager
.
unbind
(
'ctrl+f'
);
keyboardManager
.
unbind
(
'ctrl+h'
);
keyboardManager
.
unbind
(
'ctrl+s'
);
keyboardManager
.
unbind
(
'ctrl+r'
);
keyboardManager
.
unbind
(
'ctrl+z'
);
keyboardManager
.
unbind
(
'esc'
);
});
keyboardManager
.
bind
(
'ctrl+f'
,
function
(
evt
)
{
$rootScope
.
$emi
t
(
'open-search'
,
evt
);
scope
.
emitAppEven
t
(
'open-search'
,
evt
);
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'ctrl+h'
,
function
()
{
var
current
=
dashboard
.
current
.
hideControls
;
dashboard
.
current
.
hideControls
=
!
current
;
dashboard
.
current
.
panel_hints
=
current
;
var
current
=
scope
.
dashboard
.
hideControls
;
scope
.
dashboard
.
hideControls
=
!
current
;
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'ctrl+s'
,
function
(
evt
)
{
$rootScope
.
$emi
t
(
'save-dashboard'
,
evt
);
scope
.
emitAppEven
t
(
'save-dashboard'
,
evt
);
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'ctrl+r'
,
function
()
{
dashboard
.
emit_refresh
();
scope
.
dashboard
.
emit_refresh
();
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'ctrl+z'
,
function
(
evt
)
{
$rootScope
.
$emi
t
(
'zoom-out'
,
evt
);
scope
.
emitAppEven
t
(
'zoom-out'
,
evt
);
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'esc'
,
function
()
{
...
...
@@ -59,7 +63,7 @@ function(angular, $) {
if
(
popups
.
length
>
0
)
{
return
;
}
$rootScope
.
$emi
t
(
'panel-fullscreen-exit'
);
scope
.
emitAppEven
t
(
'panel-fullscreen-exit'
);
},
{
inputDisabled
:
true
});
};
});
...
...
src/index.html
View file @
4c64bcfa
...
...
@@ -18,7 +18,7 @@
</head>
<body
ng-cloak
body-class
ng-controller=
"GrafanaCtrl"
>
<body
ng-cloak
ng-controller=
"GrafanaCtrl"
>
<link
rel=
"stylesheet"
href=
"css/bootstrap.light.min.css"
ng-if=
"dashboard.style === 'light'"
>
<link
rel=
"stylesheet"
href=
"css/bootstrap-responsive.min.css"
>
...
...
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