mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashboard search
This commit is contained in:
parent
fc1d8416a7
commit
6c5e19c1e0
@ -10,6 +10,9 @@ export class SearchSrv {
|
|||||||
search(options) {
|
search(options) {
|
||||||
if (!options.query) {
|
if (!options.query) {
|
||||||
options.folderIds = [0];
|
options.folderIds = [0];
|
||||||
|
} else {
|
||||||
|
options.folderIds = [];
|
||||||
|
options.type = 'dash-db';
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.backendSrv.search(options).then(results => {
|
return this.backendSrv.search(options).then(results => {
|
||||||
@ -36,14 +39,14 @@ export class SearchSrv {
|
|||||||
// ]
|
// ]
|
||||||
// };
|
// };
|
||||||
|
|
||||||
// create folder index
|
// create folder index
|
||||||
for (let hit of results) {
|
for (let hit of results) {
|
||||||
if (hit.type === 'dash-folder') {
|
if (hit.type === 'dash-folder') {
|
||||||
sections[hit.id] = {
|
sections[hit.id] = {
|
||||||
id: hit.id,
|
id: hit.id,
|
||||||
title: hit.title,
|
title: hit.title,
|
||||||
items: [],
|
items: [],
|
||||||
icon: 'fa fa-folder-open',
|
icon: 'fa fa-folder',
|
||||||
score: _.keys(sections).length,
|
score: _.keys(sections).length,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user