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
2be31e57
Commit
2be31e57
authored
Dec 28, 2013
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
worked on dashboard search and keyboard nav, improved duplicate panel
parent
5472e5f9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
14 deletions
+67
-14
src/app/controllers/dash.js
+17
-0
src/app/controllers/dashLoader.js
+4
-0
src/app/controllers/search.js
+16
-3
src/app/panels/graphite/module.js
+15
-9
src/app/partials/search.html
+6
-2
src/css/bootstrap.dark.min.css
+0
-0
src/vendor/bootstrap/less/grafana.less
+9
-0
No files found.
src/app/controllers/dash.js
View file @
2be31e57
...
...
@@ -73,6 +73,23 @@ function (angular, config, _) {
});
};
$scope
.
countWatchers
=
function
(
scopeStart
)
{
var
q
=
[
scopeStart
||
$rootScope
],
watchers
=
0
,
scope
;
while
(
q
.
length
>
0
)
{
scope
=
q
.
pop
();
if
(
scope
.
$$watchers
)
{
watchers
+=
scope
.
$$watchers
.
length
;
}
if
(
scope
.
$$childHead
)
{
q
.
push
(
scope
.
$$childHead
);
}
if
(
scope
.
$$nextSibling
)
{
q
.
push
(
scope
.
$$nextSibling
);
}
}
window
.
console
.
log
(
watchers
);
};
$scope
.
isPanel
=
function
(
obj
)
{
if
(
!
_
.
isNull
(
obj
)
&&
!
_
.
isUndefined
(
obj
)
&&
!
_
.
isUndefined
(
obj
.
type
))
{
return
true
;
...
...
src/app/controllers/dashLoader.js
View file @
2be31e57
...
...
@@ -71,6 +71,10 @@ function (angular, _) {
};
$scope
.
elasticsearch_delete
=
function
(
id
)
{
if
(
!
confirm
(
'Are you sure you want to delete dashboard?'
))
{
return
;
}
dashboard
.
elasticsearch_delete
(
id
).
then
(
function
(
result
)
{
if
(
!
_
.
isUndefined
(
result
))
{
...
...
src/app/controllers/search.js
View file @
2be31e57
...
...
@@ -9,12 +9,12 @@ function (angular, _, config, $) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'SearchCtrl'
,
function
(
$scope
,
dashboard
,
keyboardManager
,
$element
)
{
module
.
controller
(
'SearchCtrl'
,
function
(
$scope
,
dashboard
,
keyboardManager
,
$element
,
$location
)
{
$scope
.
init
=
function
()
{
$scope
.
elasticsearch
=
$scope
.
elasticsearch
||
{};
$scope
.
giveSearchFocus
=
0
;
$scope
.
selectedIndex
=
null
;
$scope
.
selectedIndex
=
-
1
;
/*keyboardManager.bind('shift+s', function() {
$element.find('.dropdown').addClass('open');
...
...
@@ -28,7 +28,19 @@ function (angular, _, config, $) {
$scope
.
keyDown
=
function
(
evt
)
{
if
(
evt
.
keyCode
===
40
)
{
$scope
.
selectedIndex
=
(
$scope
.
selectedIndex
||
0
)
+
1
;
$scope
.
selectedIndex
++
;
}
if
(
evt
.
keyCode
===
38
)
{
$scope
.
selectedIndex
--
;
}
if
(
evt
.
keyCode
===
13
)
{
var
selectedDash
=
$scope
.
search_results
.
dashboards
[
$scope
.
selectedIndex
];
if
(
selectedDash
)
{
$location
.
path
(
"/dashboard/elasticsearch/"
+
encodeURIComponent
(
selectedDash
.
_id
));
setTimeout
(
function
(){
$
(
'body'
).
click
();
// hack to force dropdown to close;
});
}
}
};
...
...
@@ -51,6 +63,7 @@ function (angular, _, config, $) {
$scope
.
elasticsearch_dblist
=
function
(
queryStr
)
{
$scope
.
showImport
=
false
;
$scope
.
selectedIndex
=
-
1
;
queryStr
=
queryStr
.
toLowerCase
();
...
...
src/app/panels/graphite/module.js
View file @
2be31e57
...
...
@@ -211,7 +211,7 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
init
=
function
()
{
//$scope.openConfigureModal();
$scope
.
panelMenuItems
=
[
{
text
:
'View fullscreen'
,
action
:
$scope
.
toggleFullscreen
},
{
text
:
'Edit'
,
action
:
$scope
.
openConfigureModal
},
...
...
@@ -446,17 +446,23 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope
.
render
();
};
$scope
.
duplicate
=
function
()
{
var
panelCopy
=
angular
.
copy
(
$scope
.
panel
);
var
currentRowSpan
=
$scope
.
rowSpan
(
$scope
.
row
);
$scope
.
duplicate
=
function
(
addToRow
)
{
addToRow
=
addToRow
||
$scope
.
row
;
var
currentRowSpan
=
$scope
.
rowSpan
(
addToRow
);
if
(
currentRowSpan
<=
8
)
{
$scope
.
row
.
panels
.
push
(
panelCopy
);
addToRow
.
panels
.
push
(
angular
.
copy
(
$scope
.
panel
)
);
}
else
{
var
rowCopy
=
angular
.
copy
(
$scope
.
row
);
rowCopy
.
panels
=
[
panelCopy
];
$scope
.
dashboard
.
current
.
rows
.
push
(
rowCopy
);
var
rowsList
=
$scope
.
dashboard
.
current
.
rows
;
var
rowIndex
=
_
.
indexOf
(
rowsList
,
addToRow
);
if
(
rowIndex
===
rowsList
.
length
-
1
)
{
var
newRow
=
angular
.
copy
(
$scope
.
row
);
newRow
.
panels
=
[];
$scope
.
duplicate
(
newRow
);
}
else
{
$scope
.
duplicate
(
rowsList
[
rowIndex
+
1
]);
}
}
};
...
...
src/app/partials/search.html
View file @
2be31e57
...
...
@@ -27,7 +27,9 @@
ng-change=
"elasticsearch_dblist(elasticsearch.query)"
/>
<h6
ng-hide=
"search_results.dashboards.length || search_results.metrics.length"
>
No dashboards or metrics matching your query found
</h6>
<table
class=
"table table-condensed table-striped"
>
<tr
bindonce
ng-repeat=
"row in search_results.metrics"
class=
"grafana-search-metric-result"
>
<tr
bindonce
ng-repeat=
"row in search_results.metrics"
class=
"grafana-search-metric-result"
ng-class=
"{'selected': $index === selectedIndex }"
>
<td><span
class=
"label label-info"
>
metric
</span></td>
<td
class=
"grafana-search-metric-name"
>
{{row._id}}
...
...
@@ -39,7 +41,9 @@
</td>
</tr>
<tr
bindonce
ng-repeat=
"row in search_results.dashboards | orderBy:['_id']"
>
<tr
bindonce
ng-repeat=
"row in search_results.dashboards"
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/panels/dashcontrol/share.html'"
></i></a></td>
...
...
src/css/bootstrap.dark.min.css
View file @
2be31e57
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/vendor/bootstrap/less/grafana.less
View file @
2be31e57
...
...
@@ -12,6 +12,15 @@
.box-sizing(border-box);
padding: 15px;
}
.selected td, tr.selected:nth-child(odd)>td {
background: darken(@blue, 20%);
color: white;
text-shadow: -1px -1px 1px rgba(0,0,0,0.3);
a {
color: white;
}
}
}
.panelCont {
...
...
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