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
ba511f3e
Commit
ba511f3e
authored
Nov 21, 2017
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashlist: adds tag filter select (GitHub style)
parent
121d48ec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
12 deletions
+24
-12
public/app/features/dashboard/dashboard_list_ctrl.ts
+16
-9
public/app/features/dashboard/partials/dashboardList.html
+8
-3
No files found.
public/app/features/dashboard/dashboard_list_ctrl.ts
View file @
ba511f3e
...
...
@@ -5,6 +5,7 @@ import { SearchSrv } from 'app/core/services/search_srv';
export
class
DashboardListCtrl
{
public
sections
:
any
[];
tags
:
any
[];
selectedTagFilter
:
any
;
query
:
any
;
navModel
:
any
;
canDelete
=
false
;
...
...
@@ -15,10 +16,9 @@ export class DashboardListCtrl {
this
.
navModel
=
navModelSrv
.
getNav
(
'dashboards'
,
'dashboards'
);
this
.
query
=
{
query
:
''
,
mode
:
'tree'
,
tag
:
[]};
this
.
getDashboards
();
// this.getDashboards().then(() => {
// this.getTags();
// });
this
.
getDashboards
().
then
(()
=>
{
this
.
getTags
();
});
}
getDashboards
()
{
...
...
@@ -137,11 +137,12 @@ export class DashboardListCtrl {
return
this
.
searchSrv
.
toggleFolder
(
section
);
}
// getTags() {
// return this.backendSrv.get('/api/dashboards/tags').then((results) => {
// this.tags = results;
// });
// }
getTags
()
{
return
this
.
searchSrv
.
getDashboardTags
().
then
((
results
)
=>
{
this
.
tags
=
[{
term
:
'Filter By Tag'
,
disabled
:
true
}].
concat
(
results
);
this
.
selectedTagFilter
=
this
.
tags
[
0
];
});
}
filterByTag
(
tag
,
evt
)
{
this
.
query
.
tag
.
push
(
tag
);
...
...
@@ -152,6 +153,12 @@ export class DashboardListCtrl {
}
}
filterChange
()
{
this
.
query
.
tag
.
push
(
this
.
selectedTagFilter
.
term
);
this
.
selectedTagFilter
=
this
.
tags
[
0
];
this
.
getDashboards
();
}
removeTag
(
tag
,
evt
)
{
this
.
query
.
tag
=
_
.
without
(
this
.
query
.
tag
,
tag
);
this
.
getDashboards
();
...
...
public/app/features/dashboard/partials/dashboardList.html
View file @
ba511f3e
...
...
@@ -54,9 +54,14 @@
<div
class=
"admin-list-table"
style=
"height: 80%"
>
<div
gemini-scrollbar
>
<div
ng-show=
"ctrl.sections.length > 0"
>
<!-- <div>
<select class="gf-form-input" ng-model="ctrl.query.tags" ng-options="t.term for t in ctrl.tags" />
</div> -->
<div>
<select
class=
"gf-form-input"
ng-model=
"ctrl.selectedTagFilter"
ng-options=
"t.term disable when t.disabled for t in ctrl.tags"
ng-change=
"ctrl.filterChange(tag, $index)"
/>
</div>
<div
ng-repeat=
"section in ctrl.sections"
class=
"search-section"
>
<div
class=
"search-section__header pointer"
ng-show=
"::section.title"
>
...
...
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