forked from grafana/grafonnet-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashlist.libsonnet
41 lines (41 loc) · 1.3 KB
/
dashlist.libsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
/**
* Creates a [dashlist panel](https://grafana.com/docs/grafana/latest/panels/visualizations/dashboard-list-panel/).
* It requires the dashlist panel plugin in grafana, which is built-in.
*
* @name dashlist.new
*
* @param title The title of the dashlist panel.
* @param description (optional) Description of the panel
* @param query (optional) Query to search by
* @param tags (optional) Array of tag(s) to search by
* @param recent (default `true`) Displays recently viewed dashboards
* @param search (default `false`) Description of the panel
* @param starred (default `false`) Displays starred dashboards
* @param headings (default `true`) Chosen list selection(starred, recently Viewed, search) is shown as a heading
* @param limit (default `10`) Set maximum items in a list
* @return A json that represents a dashlist panel
*/
new(
title,
description=null,
query=null,
tags=[],
recent=true,
search=false,
starred=false,
headings=true,
limit=10,
):: {
type: 'dashlist',
title: title,
query: if query != null then query else '',
tags: tags,
recent: recent,
search: search,
starred: starred,
headings: headings,
limit: limit,
[if description != null then 'description']: description,
},
}