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
9c7cd280
Commit
9c7cd280
authored
Feb 20, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added detection of empty fields
parent
48ad884e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
67 deletions
+11
-67
common/lib/shared.js
+9
-1
panels/fields/module.js
+1
-4
panels/table/module.js
+1
-3
sharable.json
+0
-59
No files found.
common/lib/shared.js
View file @
9c7cd280
...
...
@@ -134,7 +134,7 @@ function get_field_value(object,field,opt) {
function
get_all_values_for_field
(
docs
,
field
)
{
var
field_array
=
[];
_
.
each
(
docs
,
function
(
doc
,
k
)
{
var
value
=
doc
[
field
]
var
value
=
doc
[
field
]
||
""
if
(
typeof
value
===
'object'
&&
value
!=
null
)
{
field_array
.
push
.
apply
(
field_array
,
value
);
}
else
{
...
...
@@ -149,6 +149,14 @@ function top_field_values(docs,field,count) {
return
_
.
pairs
(
counts
).
sort
(
function
(
a
,
b
)
{
return
a
[
1
]
-
b
[
1
]}).
reverse
().
slice
(
0
,
count
)
}
function
add_to_query
(
original
,
field
,
value
)
{
if
(
value
!==
''
)
var
query
=
field
+
":"
+
"
\"
"
+
addslashes
(
value
.
toString
())
+
"
\"
"
;
else
var
query
=
"_missing_:"
+
field
;
var
glue
=
original
!=
""
?
" AND "
:
""
;
return
original
+
glue
+
query
;
}
/**
* Calculate a graph interval
*
...
...
panels/fields/module.js
View file @
9c7cd280
...
...
@@ -24,7 +24,6 @@ angular.module('kibana.fields', [])
}
$scope
.
toggle_micropanel
=
function
(
field
)
{
//console.log(top_field_values($scope.docs,field,10))
$scope
.
micropanel
=
{
field
:
field
,
values
:
top_field_values
(
$scope
.
docs
,
field
,
10
)
...
...
@@ -45,9 +44,7 @@ angular.module('kibana.fields', [])
}
$scope
.
build_search
=
function
(
field
,
value
)
{
var
query
=
field
+
":"
+
"
\"
"
+
addslashes
(
value
.
toString
())
+
"
\"
"
;
var
glue
=
$scope
.
panel
.
query
!=
""
?
" AND "
:
""
;
$scope
.
panel
.
query
=
$scope
.
panel
.
query
+
glue
+
query
;
$scope
.
panel
.
query
=
add_to_query
(
$scope
.
panel
.
query
,
field
,
value
)
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'query'
,
$scope
.
panel
.
query
);
}
...
...
panels/table/module.js
View file @
9c7cd280
...
...
@@ -68,9 +68,7 @@ angular.module('kibana.table', [])
}
$scope
.
build_search
=
function
(
field
,
value
)
{
var
query
=
field
+
":"
+
"
\"
"
+
addslashes
(
value
.
toString
())
+
"
\"
"
;
var
glue
=
$scope
.
panel
.
query
!=
""
?
" AND "
:
""
;
$scope
.
panel
.
query
=
$scope
.
panel
.
query
+
glue
+
query
;
$scope
.
panel
.
query
=
add_to_query
(
$scope
.
panel
.
query
,
field
,
value
)
$scope
.
panel
.
offset
=
0
;
$scope
.
get_data
();
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'query'
,
$scope
.
panel
.
query
);
...
...
sharable.json
deleted
100644 → 0
View file @
48ad884e
{
"title"
:
"Monkey Showdown"
,
"rows"
:{
"row2"
:{
"height"
:
"270px"
,
"panels"
:{
"Hamlet vs macbeth"
:{
"type"
:
"stackedquery"
,
"span"
:
8
,
"queries"
:[
"play_name:Hamlet"
,
"play_name:macbeth"
],
"show"
:
[
"lines"
,
"fill"
]
},
"Hamlet vs Macbeth"
:{
"type"
:
"piequery"
,
"span"
:
4
,
"donut"
:
true
,
"queries"
:[
"play_name:Hamlet"
,
"play_name:macbeth"
],
"colors"
:[
"#B07737"
,
"#85004B"
,
"#7BA4AF"
],
"field"
:
"@message"
}
}
},
"row3"
:{
"height"
:
"130px"
,
"panels"
:{
"Hamlet's Lines"
:{
"type"
:
"histogram"
,
"span"
:
8
,
"show"
:[
"bars"
],
"label"
:
"lines"
,
"query"
:
"speaker:HAMLET"
,
"color"
:
"#4A8737"
},
"Speakers"
:{
"type"
:
"pieterms"
,
"donut"
:
false
,
"tilt"
:
false
,
"legend"
:
true
,
"field"
:
"speaker"
,
"span"
:
4
,
"size"
:
6
,
"query"
:
"play_name:Hamlet OR play_name:macbeth"
}
}
}
}
}
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