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
20c1284a
Commit
20c1284a
authored
May 13, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #78 from rashidkpc/master
Statistical mode for histogram and some prepping for adhoc dashboards
parents
08d3997b
906f3a3c
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
18 deletions
+49
-18
js/controllers.js
+3
-1
panels/dashcontrol/module.js
+4
-3
panels/fields/module.js
+1
-0
panels/histogram/editor.html
+17
-2
panels/histogram/module.html
+1
-1
panels/histogram/module.js
+17
-9
panels/stringquery/editor.html
+1
-1
panels/table/module.js
+5
-1
No files found.
js/controllers.js
View file @
20c1284a
...
...
@@ -9,6 +9,7 @@ angular.module('kibana.controllers', [])
title
:
""
,
editable
:
true
,
rows
:
[],
last
:
null
}
$scope
.
init
=
function
()
{
...
...
@@ -24,7 +25,8 @@ angular.module('kibana.controllers', [])
// Load dashboard by event
eventBus
.
register
(
$scope
,
'dashboard'
,
function
(
event
,
dashboard
){
$scope
.
dashboards
=
dashboard
;
$scope
.
dashboards
=
dashboard
.
dashboard
;
$scope
.
dashboards
.
last
=
dashboard
.
last
;
_
.
defaults
(
$scope
.
dashboards
,
_d
)
})
...
...
panels/dashcontrol/module.js
View file @
20c1284a
...
...
@@ -271,8 +271,10 @@ angular.module('kibana.dashcontrol', [])
$scope
.
dash_load
=
function
(
dashboard
)
{
if
(
!
_
.
isObject
(
dashboard
))
dashboard
=
JSON
.
parse
(
dashboard
)
eventBus
.
broadcast
(
$scope
.
$id
,
'ALL'
,
'dashboard'
,
dashboard
)
eventBus
.
broadcast
(
$scope
.
$id
,
'ALL'
,
'dashboard'
,{
dashboard
:
dashboard
,
last
:
$scope
.
dashboards
})
timer
.
cancel_all
();
}
...
...
@@ -287,7 +289,6 @@ angular.module('kibana.dashcontrol', [])
else
return
false
}
})
.
directive
(
'dashUpload'
,
function
(
timer
,
eventBus
){
return
{
...
...
panels/fields/module.js
View file @
20c1284a
...
...
@@ -40,6 +40,7 @@ angular.module('kibana.fields', [])
eventBus
.
register
(
$scope
,
'table_documents'
,
function
(
event
,
docs
)
{
$scope
.
panel
.
query
=
docs
.
query
;
$scope
.
docs
=
docs
.
docs
;
$scope
.
index
=
docs
.
index
;
});
eventBus
.
register
(
$scope
,
"get_fields"
,
function
(
event
,
id
)
{
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
"selected_fields"
,
$scope
.
active
);
...
...
panels/histogram/editor.html
View file @
20c1284a
<div>
<div
class=
"row-fluid"
>
<div
class=
"span3"
>
<label
class=
"small"
>
Mode
</label>
<select
ng-change=
"set_refresh(true)"
class=
"input-small"
ng-model=
"panel.mode"
ng-options=
"f for f in ['count','min','mean','max','total']"
></select>
</div>
<div
class=
"span3"
>
<label
class=
"small"
>
Field
</label>
<form>
<input
ng-change=
"set_refresh(true)"
placeholder=
"Start typing"
bs-typeahead=
"fields.list"
type=
"text"
class=
"input-small"
ng-model=
"panel.value_field"
>
</form>
</div>
<div
class=
"span5"
ng-show=
"panel.mode != 'count'"
>
<label
class=
"small"
>
Note
</label><small>
In
<strong>
{{panel.mode}}
</strong>
mode the configured field
<strong>
must
</strong>
be a numeric type
</small>
</div>
</div>
<div
class=
"row-fluid"
>
<div
class=
"span3"
>
<form
style=
"margin-bottom: 0px"
>
<
h6>
Label
</h6
>
<
label
class=
"small"
>
Label
</label
>
<input
type=
"text"
placeholder=
"New Label"
style=
"width:70%"
ng-model=
"newlabel"
>
</form>
</div>
<div
class=
"span8"
>
<label
class=
"small"
>
Query
</label>
<form
class=
"input-append"
style=
"margin-bottom: 0px"
>
<h6>
Query
</h6>
<input
type=
"text"
placeholder=
"New Query"
style=
"width:80%"
ng-model=
"newquery"
>
<button
class=
"btn"
ng-click=
"add_query(newlabel,newquery);newlabel='';newquery=''"
><i
class=
"icon-plus"
></i></button>
</form>
...
...
panels/histogram/module.html
View file @
20c1284a
...
...
@@ -11,7 +11,7 @@
<div
style=
"display:inline-block;background:{{series.color}};height:10px;width:10px;border-radius:5px;"
></div>
<div
class=
'small'
style=
'display:inline-block'
>
{{series.label}} ({{series.hits}})
</div>
</span>
<span
ng-show=
"panel.legend"
class=
"small"
>
per
<strong>
{{panel.interval}}
</strong>
| (
<strong>
{{hits}}
</strong>
total
)
</span>
<span
ng-show=
"panel.legend"
class=
"small"
>
<span
ng-show=
"panel.value_field && panel.mode != 'count'"
>
{{panel.value_field}}
</span>
{{panel.mode}} per
<strong>
{{panel.interval}}
</strong>
| (
<strong>
{{hits}}
</strong>
hits
)
</span>
</div>
<center><img
ng-show=
'panel.loading && _.isUndefined(data)'
src=
"common/img/load_big.gif"
></center>
<div
histogram-chart
params=
"{{panel}}"
style=
"height:{{panel.height || row.height}};position:relative"
></div>
...
...
panels/histogram/module.js
View file @
20c1284a
...
...
@@ -45,6 +45,8 @@ angular.module('kibana.histogram', [])
var
_d
=
{
group
:
"default"
,
query
:
[
{
query
:
"*"
,
label
:
"Query"
}
],
mode
:
'count'
,
value_field
:
null
,
auto_int
:
true
,
interval
:
'5m'
,
fill
:
3
,
...
...
@@ -124,12 +126,20 @@ angular.module('kibana.histogram', [])
// Build the facet part, injecting the query in as a facet filter
_
.
each
(
queries
,
function
(
v
)
{
request
=
request
.
facet
(
$scope
.
ejs
.
DateHistogramFacet
(
"chart"
+
_
.
indexOf
(
queries
,
v
))
.
field
(
$scope
.
time
.
field
)
.
interval
(
$scope
.
panel
.
interval
)
.
facetFilter
(
$scope
.
ejs
.
QueryFilter
(
v
))
).
size
(
0
)
var
facet
=
$scope
.
ejs
.
DateHistogramFacet
(
"chart"
+
_
.
indexOf
(
queries
,
v
))
if
(
$scope
.
panel
.
mode
===
'count'
)
{
facet
=
facet
.
field
(
$scope
.
time
.
field
)
}
else
{
if
(
_
.
isNull
(
$scope
.
panel
.
value_field
))
{
$scope
.
panel
.
error
=
"In "
+
$scope
.
panel
.
mode
+
" mode a field must be specified"
;
return
}
facet
=
facet
.
keyField
(
$scope
.
time
.
field
).
valueField
(
$scope
.
panel
.
value_field
)
}
facet
=
facet
.
interval
(
$scope
.
panel
.
interval
).
facetFilter
(
$scope
.
ejs
.
QueryFilter
(
v
))
request
=
request
.
facet
(
facet
).
size
(
0
)
})
// Populate the inspector panel
...
...
@@ -171,14 +181,12 @@ angular.module('kibana.histogram', [])
// Assemble segments
var
segment_data
=
[];
_
.
each
(
v
.
entries
,
function
(
v
,
k
)
{
segment_data
.
push
([
v
[
'time'
],
v
[
'count'
]])
segment_data
.
push
([
v
[
'time'
],
v
[
$scope
.
panel
.
mode
]])
hits
+=
v
[
'count'
];
// The series level hits counter
$scope
.
hits
+=
v
[
'count'
];
// Entire dataset level hits counter
});
data
.
splice
.
apply
(
data
,[
1
,
0
].
concat
(
segment_data
))
// Join histogram data
// Create the flot series object
var
series
=
{
data
:
{
...
...
panels/stringquery/editor.html
View file @
20c1284a
<div>
<div
class=
"row-fluid"
>
<div
class=
"span2"
>
<label
class=
"small"
>
Mul
it
-query
</label><input
type=
"checkbox"
ng-change=
"set_multi(panel.multi) "
ng-model=
"panel.multi"
ng-checked=
"panel.multi"
>
<label
class=
"small"
>
Mul
ti
-query
</label><input
type=
"checkbox"
ng-change=
"set_multi(panel.multi) "
ng-model=
"panel.multi"
ng-checked=
"panel.multi"
>
</div>
<div
class=
"span3"
ng-show=
"panel.multi"
>
<label
class=
"small"
>
Arrangement
</label>
...
...
panels/table/module.js
View file @
20c1284a
...
...
@@ -220,7 +220,11 @@ angular.module('kibana.table', [])
active
:
$scope
.
panel
.
fields
});
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
"table_documents"
,
{
query
:
$scope
.
panel
.
query
,
docs
:
$scope
.
data
});
{
query
:
$scope
.
panel
.
query
,
docs
:
$scope
.
data
,
index
:
$scope
.
index
});
}
function
set_time
(
time
)
{
...
...
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