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
ebb38b5e
Commit
ebb38b5e
authored
Oct 16, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added elasticsearch _ fields to table, eg _id, _index, _type
parent
a6d1bdaa
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
10 deletions
+26
-10
src/app/filters/all.js
+1
-1
src/app/panels/table/module.html
+6
-1
src/app/panels/table/module.js
+19
-8
src/img/small.png
+0
-0
No files found.
src/app/filters/all.js
View file @
ebb38b5e
...
...
@@ -49,7 +49,7 @@ define(['angular', 'jquery', 'underscore', 'moment'], function (angular, $, _, m
if
(
_
.
isObject
(
arr
)
&&
!
_
.
isArray
(
arr
))
{
return
angular
.
toJson
(
arr
);
}
else
{
return
arr
.
toString
();
return
_
.
isNull
(
arr
)
?
null
:
arr
.
toString
();
}
};
});
...
...
src/app/panels/table/module.html
View file @
ebb38b5e
...
...
@@ -18,6 +18,11 @@
<ul
class=
"unstyled"
style=
"{{panel.overflow}}:{{panel.height || row.height}};overflow-y:auto;overflow-x:hidden;"
>
<li
ng-style=
"panel.style"
ng-repeat=
"field in metaFields|filter:fieldFilter|orderBy:identity"
>
<i
class=
"pointer"
ng-class=
"{'icon-check': _.contains(panel.fields,field),'icon-check-empty': !_.contains(panel.fields,field)}"
ng-click=
"toggle_field(field)"
></i>
<a
class=
"pointer"
data-unique=
"1"
bs-popover=
"'app/panels/table/micropanel.html'"
data-placement=
"rightTop"
ng-click=
"toggle_micropanel(field,true)"
ng-class=
"{label: _.contains(panel.fields,field)}"
>
{{field}}
</a>
</li>
<li
ng-style=
"panel.style"
ng-repeat=
"field in fields.list|filter:fieldFilter|orderBy:identity"
ng-show=
"panel.all_fields"
>
<i
class=
"pointer"
ng-class=
"{'icon-check': _.contains(panel.fields,field),'icon-check-empty': !_.contains(panel.fields,field)}"
ng-click=
"toggle_field(field)"
></i>
<a
class=
"pointer"
data-unique=
"1"
bs-popover=
"'app/panels/table/micropanel.html'"
data-placement=
"rightTop"
ng-click=
"toggle_micropanel(field,true)"
ng-class=
"{label: _.contains(panel.fields,field)}"
>
{{field}}
</a>
...
...
@@ -62,7 +67,7 @@
</thead>
<tbody
ng-repeat=
"event in data| slice:panel.offset:panel.offset+panel.size"
ng-class-odd=
"'odd'"
>
<tr
ng-click=
"toggle_details(event)"
class=
"pointer"
>
<td
ng-show=
"panel.fields.length<1"
>
{{event._source|stringify|tableTruncate:panel.trimFactor:1}}
</td>
<td
ng-show=
"panel.fields.length<1"
>
{{event.
kibana.
_source|stringify|tableTruncate:panel.trimFactor:1}}
</td>
<td
ng-show=
"panel.fields.length>0"
ng-repeat=
"field in panel.fields"
ng-bind-html-unsafe=
"(event.kibana.highlight[field]||event.kibana._source[field]) |tableHighlight | tableTruncate:panel.trimFactor:panel.fields.length"
></td>
</tr>
<tr
ng-show=
"event.kibana.details"
>
...
...
src/app/panels/table/module.js
View file @
ebb38b5e
...
...
@@ -87,6 +87,7 @@ function (angular, app, _, kbn, moment) {
$scope
.
init
=
function
()
{
$scope
.
Math
=
Math
;
$scope
.
metaFields
=
[];
$scope
.
identity
=
angular
.
identity
;
$scope
.
$on
(
'refresh'
,
function
(){
$scope
.
get_data
();});
...
...
@@ -205,6 +206,12 @@ function (angular, app, _, kbn, moment) {
};
$scope
.
get_data
=
function
(
segment
,
query_id
)
{
var
_segment
,
request
,
boolQuery
,
results
;
$scope
.
panel
.
error
=
false
;
// Make sure we have everything for the request to complete
...
...
@@ -216,12 +223,12 @@ function (angular, app, _, kbn, moment) {
$scope
.
panel
.
queries
.
ids
=
querySrv
.
idsByMode
(
$scope
.
panel
.
queries
);
var
_segment
=
_
.
isUndefined
(
segment
)
?
0
:
segment
;
_segment
=
_
.
isUndefined
(
segment
)
?
0
:
segment
;
$scope
.
segment
=
_segment
;
var
request
=
$scope
.
ejs
.
Request
().
indices
(
dashboard
.
indices
[
_segment
]);
request
=
$scope
.
ejs
.
Request
().
indices
(
dashboard
.
indices
[
_segment
]);
var
boolQuery
=
$scope
.
ejs
.
BoolQuery
();
boolQuery
=
$scope
.
ejs
.
BoolQuery
();
_
.
each
(
$scope
.
panel
.
queries
.
ids
,
function
(
id
)
{
boolQuery
=
boolQuery
.
should
(
querySrv
.
getEjsObj
(
id
));
});
...
...
@@ -242,7 +249,7 @@ function (angular, app, _, kbn, moment) {
$scope
.
populate_modal
(
request
);
var
results
=
request
.
doSearch
();
results
=
request
.
doSearch
();
// Populate scope when we have results
results
.
then
(
function
(
results
)
{
...
...
@@ -263,11 +270,15 @@ function (angular, app, _, kbn, moment) {
// Check that we're still on the same query, if not stop
if
(
$scope
.
query_id
===
query_id
)
{
$scope
.
data
=
$scope
.
data
.
concat
(
_
.
map
(
results
.
hits
.
hits
,
function
(
hit
)
{
var
_h
=
_
.
clone
(
hit
);
//_h._source = kbn.flatten_json(hit._source);
//_h.highlight = kbn.flatten_json(hit.highlight||{});
var
_h
=
_
.
clone
(
hit
),
_p
=
_
.
omit
(
hit
,
'_source'
,
'sort'
,
'_score'
);
$scope
.
metaFields
=
_
.
union
(
_
.
keys
(
_p
),
$scope
.
metaFields
);
// _source is kind of a lie here, never display it, only select values from it
_h
.
kibana
=
{
_source
:
kbn
.
flatten_json
(
hit
.
_source
),
_source
:
_
.
extend
(
kbn
.
flatten_json
(
hit
.
_source
),
_p
),
highlight
:
kbn
.
flatten_json
(
hit
.
highlight
||
{})
};
return
_h
;
...
...
src/img/small.png
View file @
ebb38b5e
409 Bytes
|
W:
|
H:
480 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
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