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
da62a565
Commit
da62a565
authored
Mar 02, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added typeahead / autocomplete to influxdb series name, #103
parent
125ff957
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
4 deletions
+46
-4
src/app/controllers/influxTargetCtrl.js
+27
-1
src/app/partials/influxdb/editor.html
+4
-1
src/app/services/influxdb/influxdbDatasource.js
+12
-0
src/css/bootstrap.dark.min.css
+0
-0
src/css/less/overrides.less
+1
-0
src/css/less/variables.dark.less
+1
-1
src/css/less/variables.light.less
+1
-1
No files found.
src/app/controllers/influxTargetCtrl.js
View file @
da62a565
...
@@ -6,12 +6,38 @@ function (angular) {
...
@@ -6,12 +6,38 @@ function (angular) {
var
module
=
angular
.
module
(
'kibana.controllers'
);
var
module
=
angular
.
module
(
'kibana.controllers'
);
module
.
controller
(
'InfluxTargetCtrl'
,
function
(
$scope
)
{
var
seriesList
=
null
;
module
.
controller
(
'InfluxTargetCtrl'
,
function
(
$scope
,
$timeout
)
{
$scope
.
init
=
function
()
{
$scope
.
init
=
function
()
{
if
(
!
$scope
.
target
.
function
)
{
if
(
!
$scope
.
target
.
function
)
{
$scope
.
target
.
function
=
'mean'
;
$scope
.
target
.
function
=
'mean'
;
}
}
if
(
!
seriesList
)
{
seriesList
=
[];
$scope
.
datasource
.
listSeries
().
then
(
function
(
series
)
{
seriesList
=
series
;
});
}
$scope
.
oldSeris
=
$scope
.
target
.
series
;
$scope
.
$on
(
'typeahead-updated'
,
function
(){
$timeout
(
$scope
.
get_data
);
});
};
// Cannot use typeahead and ng-change on blur at the same time
$scope
.
seriesBlur
=
function
()
{
if
(
$scope
.
oldSeris
!==
$scope
.
target
.
series
)
{
$scope
.
oldSeris
=
$scope
.
target
.
series
;
$scope
.
get_data
();
}
};
$scope
.
listSeries
=
function
()
{
return
seriesList
;
};
};
$scope
.
duplicate
=
function
()
{
$scope
.
duplicate
=
function
()
{
...
...
src/app/partials/influxdb/editor.html
View file @
da62a565
...
@@ -51,8 +51,11 @@
...
@@ -51,8 +51,11 @@
class=
"input-medium grafana-target-segment-input"
class=
"input-medium grafana-target-segment-input"
ng-model=
"target.series"
ng-model=
"target.series"
spellcheck=
'false'
spellcheck=
'false'
bs-typeahead=
"listSeries"
placeholder=
"series name"
placeholder=
"series name"
ng-model-onblur
ng-change=
"get_data()"
>
data-min-length=
0
data-items=
100
ng-blur=
"seriesBlur()"
>
</li>
</li>
<li
class=
"grafana-target-segment"
>
<li
class=
"grafana-target-segment"
>
select
select
...
...
src/app/services/influxdb/influxdbDatasource.js
View file @
da62a565
...
@@ -54,6 +54,18 @@ function (angular, _, kbn) {
...
@@ -54,6 +54,18 @@ function (angular, _, kbn) {
};
};
InfluxDatasource
.
prototype
.
listSeries
=
function
()
{
return
this
.
doInfluxRequest
(
'list series'
).
then
(
function
(
results
)
{
if
(
!
results
.
data
)
{
return
[];
}
return
_
.
map
(
results
.
data
,
function
(
series
)
{
return
series
.
name
;
});
});
};
InfluxDatasource
.
prototype
.
doInfluxRequest
=
function
(
query
)
{
InfluxDatasource
.
prototype
.
doInfluxRequest
=
function
(
query
)
{
var
params
=
{
var
params
=
{
u
:
this
.
username
,
u
:
this
.
username
,
...
...
src/css/bootstrap.dark.min.css
View file @
da62a565
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/css/less/overrides.less
View file @
da62a565
...
@@ -570,3 +570,4 @@ div.flot-text {
...
@@ -570,3 +570,4 @@ div.flot-text {
white-space: nowrap;
white-space: nowrap;
}
}
}
}
src/css/less/variables.dark.less
View file @
da62a565
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
@dropdownLinkColorHover: @white;
@dropdownLinkColorHover: @white;
@dropdownLinkColorActive: @white;
@dropdownLinkColorActive: @white;
@dropdownLinkBackgroundActive: @
linkColor
;
@dropdownLinkBackgroundActive: @
blue
;
@dropdownLinkBackgroundHover: @blue;
@dropdownLinkBackgroundHover: @blue;
...
...
src/css/less/variables.light.less
View file @
da62a565
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
@dropdownLinkColorActive: @white;
@dropdownLinkColorActive: @white;
@dropdownLinkBackgroundActive: @blue;
@dropdownLinkBackgroundActive: @blue;
@dropdownLinkBackgroundHover: @
dropdownLinkBackgroundActiv
e;
@dropdownLinkBackgroundHover: @
blu
e;
...
...
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