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
e54982d4
Commit
e54982d4
authored
Jan 31, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added query input binding
parent
bf75a42b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
17 deletions
+80
-17
config.js
+1
-1
dashboards.js
+20
-13
panels/histogram/module.js
+7
-0
panels/map/module.js
+8
-0
panels/pie/module.js
+7
-0
panels/stringquery/module.html
+8
-0
panels/stringquery/module.js
+21
-0
panels/table/module.js
+8
-3
No files found.
config.js
View file @
e54982d4
...
...
@@ -30,7 +30,7 @@ var config = new Settings(
timefield
:
'@timestamp'
,
//indexpattern: '"logstash-"yyyy.mm.dd',
indexpattern
:
'"shakespeare"'
,
modules
:
[
'histogram'
,
'map'
,
'pie'
,
'table'
],
modules
:
[
'histogram'
,
'map'
,
'pie'
,
'table'
,
'stringquery'
],
defaultfields
:
[
'line_text'
],
perpage
:
50
,
...
...
dashboards.js
View file @
e54982d4
...
...
@@ -3,6 +3,16 @@ var dashboards =
title
:
"Infinite Monkey Dashboard"
,
rows
:
[
{
height
:
"30px"
,
panels
:
[
{
type
:
"stringquery"
,
span
:
12
,
group
:
"mainsearch"
}
]
},
{
height
:
"300px"
,
panels
:
[
{
...
...
@@ -11,12 +21,8 @@ var dashboards =
span
:
6
,
show
:
[
'lines'
,
'stack'
],
fill
:
1
,
query
:
[
{
label
:
"US"
,
query
:
"country:US"
,
color
:
'#86B32D'
},
{
label
:
"CN"
,
query
:
"country:CN"
,
color
:
'#BF3030'
},
{
label
:
"IN"
,
query
:
"country:IN"
,
color
:
'#1D7373'
}
],
color
:
"#7BA4AF"
query
:
[{
label
:
"lines"
,
query
:
"*"
,
color
:
'#86B32D'
}
],
group
:
"mainsearch"
},
{
title
:
"World Monkeys"
,
...
...
@@ -25,7 +31,9 @@ var dashboards =
field
:
"country"
,
span
:
6
,
size
:
500
,
query
:
"*"
query
:
"*"
,
group
:
"mainsearch"
}
]
},
...
...
@@ -33,7 +41,7 @@ var dashboards =
height
:
"300px"
,
panels
:
[
{
title
:
"
Hamlet vs Macbeth
"
,
title
:
"
Plays
"
,
type
:
"pie"
,
span
:
4
,
size
:
8
,
...
...
@@ -41,17 +49,16 @@ var dashboards =
colors
:
[
'#BF3030'
,
'#1D7373'
,
'#86B32D'
,
'#A60000'
,
'#006363'
,
'#679B00'
],
field
:
'country'
,
//query : { query: "*", field: "country"}
query
:
[
{
label
:
"Hamlet"
,
query
:
"play_name:Hamlet"
,
color
:
'#86B32D'
},
{
label
:
"Macbeth"
,
query
:
"play_name:macbeth"
,
color
:
'#BF3030'
},
]
query
:
{
field
:
"play_name"
,
query
:
"*"
},
group
:
"mainsearch"
},
{
title
:
"Newest Lines"
,
type
:
"table"
,
span
:
8
,
query
:
"*"
,
fields
:
[
'@timestamp'
,
'speaker'
,
'text_entry'
]
fields
:
[
'@timestamp'
,
'speaker'
,
'text_entry'
],
group
:
"mainsearch"
}
]
}
...
...
panels/histogram/module.js
View file @
e54982d4
...
...
@@ -14,6 +14,13 @@ angular.module('kibana.histogram', [])
?
_d
[
k
]
:
$scope
.
panel
[
k
];
});
if
(
!
(
_
.
isUndefined
(
$scope
.
panel
.
group
)))
{
$scope
.
$on
(
$scope
.
panel
.
group
+
"-query"
,
function
(
event
,
query
)
{
$scope
.
panel
.
query
[
0
].
query
=
query
;
$scope
.
get_data
();
});
}
$scope
.
get_data
=
function
()
{
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
index
);
...
...
panels/map/module.js
View file @
e54982d4
...
...
@@ -14,6 +14,14 @@ angular.module('kibana.map', [])
?
_d
[
k
]
:
$scope
.
panel
[
k
];
});
if
(
!
(
_
.
isUndefined
(
$scope
.
panel
.
group
)))
{
$scope
.
$on
(
$scope
.
panel
.
group
+
"-query"
,
function
(
event
,
query
)
{
$scope
.
panel
.
query
=
query
;
$scope
.
get_data
();
});
}
$scope
.
get_data
=
function
()
{
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
index
);
...
...
panels/pie/module.js
View file @
e54982d4
...
...
@@ -18,6 +18,13 @@ angular.module('kibana.pie', [])
?
_d
[
k
]
:
$scope
.
panel
[
k
];
});
if
(
!
(
_
.
isUndefined
(
$scope
.
panel
.
group
))
&&
!
(
_
.
isArray
(
$scope
.
panel
.
query
)))
{
$scope
.
$on
(
$scope
.
panel
.
group
+
"-query"
,
function
(
event
,
query
)
{
$scope
.
panel
.
query
.
query
=
query
;
$scope
.
get_data
();
});
}
$scope
.
get_data
=
function
()
{
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
index
);
...
...
panels/stringquery/module.html
0 → 100644
View file @
e54982d4
<div
ng-controller=
'stringquery'
>
<h4
ng-hide=
"_.isUndefined(panel.title)"
>
{{panel.title}}
</h4>
<form
class=
"form-search"
>
<input
type=
"text"
class=
"input-medium search-query"
ng-model=
"query"
style=
"width:90%"
>
<button
type=
"submit"
class=
"btn"
ng-click=
"send_query(query)"
>
Search
</button>
</form>
</div>
\ No newline at end of file
panels/stringquery/module.js
0 → 100644
View file @
e54982d4
angular
.
module
(
'kibana.stringquery'
,
[])
.
controller
(
'stringquery'
,
function
(
$scope
,
$rootScope
)
{
// Set and populate defaults
var
_d
=
{
query
:
"*"
,
size
:
100
,
sort
:
[
config
.
timefield
,
'desc'
],
}
_
.
each
(
_d
,
function
(
v
,
k
)
{
$scope
.
panel
[
k
]
=
_
.
isUndefined
(
$scope
.
panel
[
k
])
?
_d
[
k
]
:
$scope
.
panel
[
k
];
});
if
(
!
(
_
.
isUndefined
(
$scope
.
panel
.
group
)))
{
$scope
.
send_query
=
function
(
query
)
{
$rootScope
.
$broadcast
(
$scope
.
panel
.
group
+
"-query"
,
query
)
}
}
})
\ No newline at end of file
panels/table/module.js
View file @
e54982d4
...
...
@@ -12,6 +12,13 @@ angular.module('kibana.table', [])
?
_d
[
k
]
:
$scope
.
panel
[
k
];
});
if
(
!
(
_
.
isUndefined
(
$scope
.
panel
.
group
)))
{
$scope
.
$on
(
$scope
.
panel
.
group
+
"-query"
,
function
(
event
,
query
)
{
$scope
.
panel
.
query
=
query
;
$scope
.
get_data
();
});
}
$scope
.
get_data
=
function
()
{
var
request
=
$scope
.
ejs
.
Request
().
indices
(
$scope
.
index
);
...
...
@@ -30,7 +37,6 @@ angular.module('kibana.table', [])
// Populate scope when we have results
results
.
then
(
function
(
results
)
{
console
.
log
(
results
)
$scope
.
hits
=
results
.
hits
.
total
;
$scope
.
data
=
results
.
hits
.
hits
;
/*
...
...
@@ -55,4 +61,4 @@ angular.module('kibana.table', [])
$scope
.
get_data
();
});
})
\ No newline at end of file
})
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