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
7be7b07c
Commit
7be7b07c
authored
Jul 31, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed search result model to be more datasource agnostic
parent
88c46f46
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
+17
-6
src/app/controllers/search.js
+1
-1
src/app/services/elasticsearch/es-datasource.js
+11
-1
src/app/services/influxdb/influxdbDatasource.js
+5
-4
No files found.
src/app/controllers/search.js
View file @
7be7b07c
...
...
@@ -61,7 +61,7 @@ function (angular, _, config, $) {
$scope
.
searchDashboards
=
function
(
queryString
)
{
return
$scope
.
db
.
searchDashboards
(
queryString
)
.
then
(
function
(
results
)
{
$scope
.
tagsOnly
=
results
.
dashboards
.
length
===
0
&&
results
.
tags
.
length
>
0
;
$scope
.
tagsOnly
=
results
.
tagsOnly
;
$scope
.
results
.
dashboards
=
results
.
dashboards
;
$scope
.
results
.
tags
=
results
.
tags
;
});
...
...
src/app/services/elasticsearch/es-datasource.js
View file @
7be7b07c
...
...
@@ -211,7 +211,17 @@ function (angular, _, $, config, kbn, moment) {
return
{
dashboards
:
[],
tags
:
[]
};
}
return
{
dashboards
:
results
.
hits
.
hits
,
tags
:
results
.
facets
.
terms
||
[]
};
var
hits
=
{
dashboards
:
[],
tags
:
results
.
facets
.
tags
.
terms
||
[]
};
for
(
var
i
=
0
;
i
<
results
.
hits
.
hits
.
length
;
i
++
)
{
hits
.
dashboards
.
push
({
id
:
results
.
hits
.
hits
[
i
].
_id
,
tags
:
results
.
hits
.
hits
[
i
].
_source
.
tags
});
}
hits
.
tagsOnly
=
tagsOnly
;
return
hits
;
});
};
...
...
src/app/services/influxdb/influxdbDatasource.js
View file @
7be7b07c
...
...
@@ -282,11 +282,12 @@ function (angular, _, kbn, InfluxSeries) {
}
return
this
.
_seriesQuery
(
influxQuery
).
then
(
function
(
results
)
{
var
hits
=
{
dashboards
:
[],
tags
:
[],
tagsOnly
:
false
};
if
(
!
results
||
!
results
.
length
)
{
return
{
dashboards
:
[],
tags
:
[]
}
;
return
hits
;
}
var
dashList
=
[];
var
dashCol
=
_
.
indexOf
(
results
[
0
].
columns
,
'title'
);
var
tagsCol
=
_
.
indexOf
(
results
[
0
].
columns
,
'tags'
);
...
...
@@ -296,9 +297,9 @@ function (angular, _, kbn, InfluxSeries) {
tags
:
results
[
i
].
points
[
0
][
tagsCol
].
split
(
","
)
};
hit
.
tags
=
hit
.
tags
[
0
]
?
hit
.
tags
:
[];
dashList
.
push
(
hit
);
hits
.
dashboards
.
push
(
hit
);
}
return
{
dashboards
:
dashList
,
tags
:
[]
}
;
return
hits
;
});
};
...
...
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