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
c1539b90
Commit
c1539b90
authored
Nov 20, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor update to dashboard search
parent
9ace21b6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
10 deletions
+32
-10
public/app/core/components/search/search.html
+4
-4
public/app/core/components/search/search.ts
+3
-3
public/app/core/services/search_srv.ts
+25
-3
No files found.
public/app/core/components/search/search.html
View file @
c1539b90
...
...
@@ -56,14 +56,14 @@
<h6
ng-hide=
"ctrl.results.length"
>
No dashboards matching your query were found.
</h6>
<div
ng-repeat=
"section in ctrl.results"
class=
"search-section"
>
<a
class=
"search-section__header pointer"
ng-
show=
"::section.title
"
ng-click=
"ctrl.toggleFolder(section)"
>
<a
class=
"search-section__header pointer"
ng-
hide=
"section.hideHeader
"
ng-click=
"ctrl.toggleFolder(section)"
>
<i
class=
"search-section__header__icon"
ng-class=
"section.icon"
></i>
<span
class=
"search-section__header__text"
>
{{::section.title}}
</span>
<i
class=
"fa fa-minus search-section__header__toggle"
ng-
hide=
"section.collaps
ed"
></i>
<i
class=
"fa fa-plus search-section__header__toggle"
ng-
show=
"section.collaps
ed"
></i>
<i
class=
"fa fa-minus search-section__header__toggle"
ng-
show=
"section.expand
ed"
></i>
<i
class=
"fa fa-plus search-section__header__toggle"
ng-
hide=
"section.expand
ed"
></i>
</a>
<div
ng-if=
"
!section.collaps
ed"
>
<div
ng-if=
"
section.expand
ed"
>
<a
ng-repeat=
"item in section.items"
class=
"search-item"
ng-class=
"{'selected': item.selected}"
ng-href=
"{{::item.url}}"
>
<span
class=
"search-item__icon"
>
<i
class=
"fa fa-th-large"
></i>
...
...
public/app/core/components/search/search.ts
View file @
c1539b90
...
...
@@ -151,9 +151,9 @@ export class SearchCtrl {
this
.
searchDashboards
();
}
//
toggleFolder(section) {
//
this.searchSrv.toggleFolder(section);
//
}
toggleFolder
(
section
)
{
this
.
searchSrv
.
toggleFolder
(
section
);
}
}
export
function
searchDirective
()
{
...
...
public/app/core/services/search_srv.ts
View file @
c1539b90
...
...
@@ -34,6 +34,7 @@ export class SearchSrv {
items
:
[],
icon
:
'fa fa-folder-open'
,
score
:
_
.
keys
(
sections
).
length
,
expanded
:
true
,
};
for
(
let
hit
of
results
)
{
...
...
@@ -54,14 +55,16 @@ export class SearchSrv {
return
this
.
browse
();
}
options
.
folderIds
=
[];
options
.
type
=
'dash-db'
;
let
query
=
_
.
clone
(
options
);
query
.
folderIds
=
[];
query
.
type
=
'dash-db'
;
return
this
.
backendSrv
.
search
(
options
).
then
(
results
=>
{
return
this
.
backendSrv
.
search
(
query
).
then
(
results
=>
{
let
section
=
{
hideHeader
:
true
,
items
:
[],
expanded
:
true
,
};
for
(
let
hit
of
results
)
{
...
...
@@ -76,6 +79,25 @@ export class SearchSrv {
});
}
toggleFolder
(
section
)
{
section
.
expanded
=
!
section
.
expanded
;
if
(
section
.
items
.
length
)
{
return
;
}
let
query
=
{
folderIds
:
[
section
.
id
]
};
return
this
.
backendSrv
.
search
(
query
).
then
(
results
=>
{
for
(
let
hit
of
results
)
{
hit
.
url
=
'dashboard/'
+
hit
.
uri
;
section
.
items
.
push
(
hit
);
}
});
}
getDashboardTags
()
{
return
this
.
backendSrv
.
get
(
'/api/dashboards/tags'
);
}
...
...
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