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
3f6cf9bb
Commit
3f6cf9bb
authored
Jun 21, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added type ahead history to stringquery and derivequeries. Fix wrapping in timepicker editor
parent
41ea74f8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
10 deletions
+36
-10
panels/derivequeries/module.html
+1
-1
panels/derivequeries/module.js
+14
-2
panels/stringquery/module.html
+3
-3
panels/stringquery/module.js
+17
-3
panels/timepicker/editor.html
+1
-1
No files found.
panels/derivequeries/module.html
View file @
3f6cf9bb
...
...
@@ -11,7 +11,7 @@
</tr>
<tr>
<td
width=
"97%"
style=
"padding-right:20px"
>
<input
type=
"text"
style=
"width:100%"
ng-model=
"panel.query"
>
<input
bs-typeahead=
"panel.history"
data-min-length=
0
data-items=
100
type=
"text"
style=
"width:100%"
ng-model=
"panel.query"
>
</td>
<td
ng-show=
"panel.fields.length > 0"
>
<select
class=
"input-small"
ng-model=
"panel.field"
ng-options=
"f for f in panel.fields"
></select>
...
...
panels/derivequeries/module.js
View file @
3f6cf9bb
...
...
@@ -36,7 +36,9 @@ angular.module('kibana.derivequeries', [])
spyable
:
true
,
size
:
5
,
mode
:
'terms only'
,
exclude
:
[]
exclude
:
[],
history
:
[],
remember
:
10
// max: 100, angular strap can't take a variable for items param
}
_
.
defaults
(
$scope
.
panel
,
_d
);
...
...
@@ -54,6 +56,7 @@ angular.module('kibana.derivequeries', [])
}
$scope
.
get_data
=
function
()
{
update_history
(
$scope
.
panel
.
query
);
// Make sure we have everything for the request to complete
if
(
_
.
isUndefined
(
$scope
.
index
)
||
_
.
isUndefined
(
$scope
.
time
))
return
...
...
@@ -128,6 +131,15 @@ angular.module('kibana.derivequeries', [])
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'query'
,
_query
)
}
var
update_history
=
function
(
query
)
{
query
=
_
.
isArray
(
query
)
?
query
:
[
query
];
if
(
$scope
.
panel
.
remember
>
0
)
{
$scope
.
panel
.
history
=
_
.
union
(
query
.
reverse
(),
$scope
.
panel
.
history
)
var
_length
=
$scope
.
panel
.
history
.
length
if
(
_length
>
$scope
.
panel
.
remember
)
{
$scope
.
panel
.
history
=
$scope
.
panel
.
history
.
slice
(
0
,
$scope
.
panel
.
remember
)
}
}
}
});
panels/stringquery/module.html
View file @
3f6cf9bb
...
...
@@ -7,7 +7,7 @@
<td
width=
"97%"
style=
"padding-right:20px"
>
<span
style=
"position:relative"
>
<i
class=
"icon-remove-sign pointer"
style=
"position:absolute;left:10px;top:3px"
ng-show=
"panel.query.length > 0"
ng-click=
"panel.query='';send_query(panel.query)"
></i>
<input
type=
"text"
style=
"text-indent:20px;width:100%"
ng-model=
"panel.query"
>
<input
bs-typeahead=
"panel.history"
data-min-length=
0
data-items=
100
type=
"text"
style=
"text-indent:20px;width:100%"
ng-model=
"panel.query"
>
</span>
</td>
<td
style=
"margin-left:20px"
width=
"1%"
>
...
...
@@ -21,7 +21,7 @@
<span
ng-repeat=
"q in panel.query"
>
<span
style=
"margin-bottom:0px;margin-right:5px;display:inline-block;position:relative"
>
<i
class=
"icon-remove-sign pointer"
style=
"position:absolute;left:10px;top:8px"
ng-show=
"panel.query.length > 1"
ng-click=
"remove_query($index);send_query(panel.query)"
></i>
<input
style=
"margin-bottom:5px; text-indent: 20px;"
type=
"text"
ng-model=
"panel.query[$index]"
ng-model-onblur
style=
"width:90%"
>
<input
bs-typeahead=
"panel.history"
data-min-length=
0
data-items=
100
style=
"margin-bottom:5px; text-indent: 20px;"
type=
"text"
ng-model=
"panel.query[$index]"
ng-model-onblur
style=
"width:90%"
>
<br>
</span>
</span>
...
...
@@ -37,7 +37,7 @@
<td
width=
"99%"
>
<span
style=
"position:relative"
>
<i
class=
"icon-remove-sign pointer"
style=
"position:absolute;left:10px;top:3px"
ng-show=
"panel.query.length > 1"
ng-click=
"remove_query($index);send_query(panel.query)"
></i>
<input
type=
"text"
ng-model=
"panel.query[$index]"
ng-model-onblur
style=
"text-indent: 20px;width:100%"
>
<input
bs-typeahead=
"panel.history"
data-min-length=
0
data-items=
100
type=
"text"
ng-model=
"panel.query[$index]"
ng-model-onblur
style=
"text-indent: 20px;width:100%"
>
</span>
</td>
<td
width=
"1%"
style=
"visibility:hidden"
><button
class=
"btn btn-info"
type=
"submit"
></button></td>
...
...
panels/stringquery/module.js
View file @
3f6cf9bb
...
...
@@ -30,21 +30,24 @@ angular.module('kibana.stringquery', [])
group
:
"default"
,
multi
:
false
,
multi_arrange
:
'horizontal'
,
history
:
[],
remember
:
10
// max: 100, angular strap can't take a variable for items param
}
_
.
defaults
(
$scope
.
panel
,
_d
);
$scope
.
init
=
function
()
{
// If we're in multi query mode, they all get wiped out if we receive a
// query. Query events must be exchanged as arrays.
eventBus
.
register
(
$scope
,
'query'
,
function
(
event
,
query
)
{
$scope
.
panel
.
query
=
query
;
update_history
(
query
);
});
}
$scope
.
send_query
=
function
(
query
)
{
var
_query
=
_
.
isArray
(
query
)
?
query
:
[
query
]
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'query'
,
_query
)
var
_query
=
_
.
isArray
(
query
)
?
query
:
[
query
];
update_history
(
_query
);
eventBus
.
broadcast
(
$scope
.
$id
,
$scope
.
panel
.
group
,
'query'
,
_query
);
}
$scope
.
add_query
=
function
()
{
...
...
@@ -65,4 +68,14 @@ angular.module('kibana.stringquery', [])
$scope
.
panel
.
query
.
splice
(
index
,
1
);
}
var
update_history
=
function
(
query
)
{
if
(
$scope
.
panel
.
remember
>
0
)
{
$scope
.
panel
.
history
=
_
.
union
(
query
.
reverse
(),
$scope
.
panel
.
history
)
var
_length
=
$scope
.
panel
.
history
.
length
if
(
_length
>
$scope
.
panel
.
remember
)
{
$scope
.
panel
.
history
=
$scope
.
panel
.
history
.
slice
(
0
,
$scope
.
panel
.
remember
)
}
}
}
});
\ No newline at end of file
panels/timepicker/editor.html
View file @
3f6cf9bb
...
...
@@ -44,7 +44,7 @@
</div>
<div
class=
"row-fluid"
>
<h5>
Relative mode
<small>
settings
</small></h5>
<div
class=
"span
8
"
>
<div
class=
"span
6
"
>
<h6>
Relative time options
<small>
comma seperated
</small></h6>
<input
type=
"text"
array-join
class=
"input-large"
ng-model=
"panel.time_options"
>
</div>
...
...
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