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
e7dd50ed
Commit
e7dd50ed
authored
Dec 29, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added more keyboard shortcuts to open search, save and toggle controls
parent
2be31e57
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
28 deletions
+51
-28
src/app/controllers/dash.js
+25
-2
src/app/controllers/dashLoader.js
+5
-1
src/app/controllers/search.js
+10
-10
src/app/directives/kibanaPanel.js
+1
-1
src/app/panels/graphite/module.js
+8
-13
src/app/partials/search.html
+1
-1
src/vendor/angular/angular-strap.js
+1
-0
No files found.
src/app/controllers/dash.js
View file @
e7dd50ed
...
...
@@ -19,11 +19,12 @@
define
([
'angular'
,
'jquery'
,
'config'
,
'underscore'
,
'services/all'
],
function
(
angular
,
config
,
_
)
{
function
(
angular
,
$
,
config
,
_
)
{
"use strict"
;
var
module
=
angular
.
module
(
'kibana.controllers'
);
...
...
@@ -60,6 +61,10 @@ function (angular, config, _) {
$scope
.
ejs
=
ejsResource
(
config
.
elasticsearch
);
$scope
.
bindKeyboardShortcuts
();
};
$scope
.
bindKeyboardShortcuts
=
function
()
{
$rootScope
.
$on
(
'panel-fullscreen-enter'
,
function
()
{
$scope
.
fullscreenPanelExists
=
true
;
});
...
...
@@ -68,9 +73,27 @@ function (angular, config, _) {
$scope
.
fullscreenPanelExists
=
false
;
});
keyboardManager
.
bind
(
'ctrl+f'
,
function
(
evt
)
{
$rootScope
.
$emit
(
'open-search'
,
evt
);
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'ctrl+h'
,
function
(
evt
)
{
var
current
=
dashboard
.
current
.
hideControls
;
dashboard
.
current
.
hideControls
=
!
current
;
dashboard
.
current
.
panel_hints
=
!
current
;
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'ctrl+s'
,
function
(
evt
)
{
$rootScope
.
$emit
(
'save-dashboard'
,
evt
);
},
{
inputDisabled
:
true
});
keyboardManager
.
bind
(
'esc'
,
function
()
{
var
popups
=
$
(
'.popover.in'
);
if
(
popups
.
length
>
0
)
{
return
;
}
$rootScope
.
$emit
(
'panel-fullscreen-exit'
);
});
}
,
{
inputDisabled
:
true
}
);
};
$scope
.
countWatchers
=
function
(
scopeStart
)
{
...
...
src/app/controllers/dashLoader.js
View file @
e7dd50ed
...
...
@@ -7,13 +7,17 @@ function (angular, _) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'dashLoader'
,
function
(
$scope
,
$http
,
timer
,
dashboard
,
alertSrv
,
$location
)
{
module
.
controller
(
'dashLoader'
,
function
(
$scope
,
$
rootScope
,
$
http
,
timer
,
dashboard
,
alertSrv
,
$location
)
{
$scope
.
loader
=
dashboard
.
current
.
loader
;
$scope
.
init
=
function
()
{
$scope
.
gist_pattern
=
/
(
^
\d{5,}
$
)
|
(
^
[
a-z0-9
]{10,}
$
)
|
(
gist.github.com
(\/
*.*
)\/[
a-z0-9
]{5,}\/
*$
)
/
;
$scope
.
gist
=
$scope
.
gist
||
{};
$scope
.
elasticsearch
=
$scope
.
elasticsearch
||
{};
$rootScope
.
$on
(
'save-dashboard'
,
function
()
{
$scope
.
elasticsearch_save
(
'dashboard'
,
false
);
});
};
$scope
.
showDropdown
=
function
(
type
)
{
...
...
src/app/controllers/search.js
View file @
e7dd50ed
...
...
@@ -9,24 +9,20 @@ function (angular, _, config, $) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'SearchCtrl'
,
function
(
$scope
,
dashboard
,
keyboardManager
,
$element
,
$location
)
{
module
.
controller
(
'SearchCtrl'
,
function
(
$scope
,
$rootScope
,
dashboard
,
$element
,
$location
)
{
$scope
.
init
=
function
()
{
$scope
.
elasticsearch
=
$scope
.
elasticsearch
||
{};
$scope
.
giveSearchFocus
=
0
;
$scope
.
selectedIndex
=
-
1
;
/*keyboardManager.bind('shift+s', function() {
$element.find('.dropdown').addClass('open');
$scope.giveSearchFocus += 1;
});*/
keyboardManager
.
bind
(
'esc'
,
function
()
{
$element
.
find
(
'.dropdown'
).
removeClass
(
'open'
);
});
$rootScope
.
$on
(
'open-search'
,
$scope
.
openSearch
);
};
$scope
.
keyDown
=
function
(
evt
)
{
if
(
evt
.
keyCode
===
27
)
{
$element
.
find
(
'.dropdown-toggle'
).
dropdown
(
'toggle'
);
}
if
(
evt
.
keyCode
===
40
)
{
$scope
.
selectedIndex
++
;
}
...
...
@@ -99,7 +95,11 @@ function (angular, _, config, $) {
});
};
$scope
.
openSearch
=
function
()
{
$scope
.
openSearch
=
function
(
evt
)
{
if
(
evt
)
{
$element
.
find
(
'.dropdown-toggle'
).
dropdown
(
'toggle'
);
}
$scope
.
giveSearchFocus
=
$scope
.
giveSearchFocus
+
1
;
$scope
.
elasticsearch_dblist
(
""
);
};
...
...
src/app/directives/kibanaPanel.js
View file @
e7dd50ed
...
...
@@ -50,7 +50,7 @@ function (angular) {
'</span>'
+
'</span>'
+
'<span ng-if="panelMenuItems" class="dropdown" ng-show="panel.title">'
+
'<span ng-if="panelMe
ta.me
nuItems" class="dropdown" ng-show="panel.title">'
+
'<span class="pointer dropdown-toggle row-text row-button panel-title pointer" data-toggle="dropdown" tabindex="1">'
+
'{{panel.title}}'
+
'</span>'
+
...
...
src/app/panels/graphite/module.js
View file @
e7dd50ed
...
...
@@ -37,14 +37,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
module
.
controller
(
'graphite'
,
function
(
$scope
,
$rootScope
,
filterSrv
,
graphiteSrv
,
$timeout
)
{
$scope
.
panelMeta
=
{
modals
:
[
{
description
:
"Inspect"
,
icon
:
"icon-info-sign"
,
partial
:
"app/partials/inspector.html"
,
show
:
$scope
.
panel
.
spyable
}
],
modals
:
[],
editorTabs
:
[],
fullEditorTabs
:
[
...
...
@@ -61,6 +54,13 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
src
:
'app/panels/graphite/styleEditor.html'
}
],
menuItems
:
[
{
text
:
'View fullscreen'
,
action
:
$scope
.
toggleFullscreen
},
{
text
:
'Edit'
,
action
:
$scope
.
openConfigureModal
},
{
text
:
'Duplicate'
,
action
:
$scope
.
duplicate
}
],
status
:
"Unstable"
,
description
:
"Graphite graphing panel <br /><br />"
};
...
...
@@ -419,11 +419,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
enterFullscreenMode
({
edit
:
true
});
};
// I really don't like this function, too much dom manip. Break out into directive?
$scope
.
populate_modal
=
function
(
request
)
{
$scope
.
inspector
=
angular
.
toJson
(
request
,
true
);
};
$scope
.
set_refresh
=
function
(
state
)
{
$scope
.
refresh
=
state
;
};
...
...
src/app/partials/search.html
View file @
e7dd50ed
...
...
@@ -46,7 +46,7 @@
ng-class=
"{'selected': $index === selectedIndex }"
>
<td><a
ng-click=
"elasticsearch_delete(row._id)"
><i
class=
"icon-remove"
></i></a></td>
<td
style=
"width:100%"
><a
href=
"#/dashboard/elasticsearch/{{row._id}}"
bo-text=
"row._id"
></a></td>
<td><a><i
class=
"icon-share"
ng-click=
"share = dashboard.share_link(row._id,'elasticsearch',row._id)"
bs-modal=
"'app/pa
nels/dashcontrol/s
hare.html'"
></i></a></td>
<td><a><i
class=
"icon-share"
ng-click=
"share = dashboard.share_link(row._id,'elasticsearch',row._id)"
bs-modal=
"'app/pa
rtials/dashLoaderS
hare.html'"
></i></a></td>
</tr>
</table>
</div>
...
...
src/vendor/angular/angular-strap.js
View file @
e7dd50ed
...
...
@@ -546,6 +546,7 @@ angular.module('$strap.directives').directive('bsPopover', [
$
(
'body'
).
on
(
'keyup'
,
function
(
ev
)
{
if
(
ev
.
keyCode
===
27
)
{
$
(
'.popover.in'
).
each
(
function
()
{
debugger
;
$
(
this
).
popover
(
'hide'
);
});
}
...
...
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