This repository was archived by the owner on Jun 26, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 11{
22 /**
3+ * Creates a [text panel](https://grafana.com/docs/grafana/latest/panels/visualizations/text-panel/).
4+ *
35 * @name text.new
6+ *
7+ * @param title (default `''`) Panel title.
8+ * @param description (optional) Panel description.
9+ * @param datasource (optional) Panel datasource.
10+ * @param span (optional)
11+ * @param content (default `''`)
12+ * @param mode (default `'markdown'`)
13+ * @param transparent (optional)
14+ * @param repeat (optional) Name of variable that should be used to repeat this panel.
15+ * @param repeatDirection (default `'h'`) 'h' for horizontal or 'v' for vertical.
16+ * @param repeatMaxPerRow (optional) Maximum panels per row in repeat mode.
417 */
518 new(
619 title='' ,
1023 transparent=null ,
1124 description=null ,
1225 datasource=null ,
26+ repeat=null ,
27+ repeatDirection=null ,
28+ repeatMaxPerRow=null ,
1329 )::
1430 {
1531 [if transparent != null then 'transparent' ]: transparent,
2036 content: content,
2137 [if description != null then 'description' ]: description,
2238 datasource: datasource,
39+ [if repeat != null then 'repeat' ]: repeat,
40+ [if repeat != null then 'repeatDirection' ]: repeatDirection,
41+ [if repeat != null then 'maxPerRow' ]: repeatMaxPerRow,
2342 },
2443}
Original file line number Diff line number Diff line change @@ -11,5 +11,9 @@ local text = grafana.text;
1111 mode='html' ,
1212 content='coocoo' ,
1313 transparent=true ,
14+ repeat='my-variable' ,
15+ repeatDirection='v' ,
16+ repeatMaxPerRow=12 ,
1417 ),
18+ repeat: text.new(span=12 , repeat='my-variable' ),
1519}
Original file line number Diff line number Diff line change 33 "content" : " coocoo" ,
44 "datasource" : " $PROMETHEUS" ,
55 "description" : " description" ,
6+ "maxPerRow" : 12 ,
67 "mode" : " html" ,
8+ "repeat" : " my-variable" ,
9+ "repeatDirection" : " v" ,
710 "span" : 5 ,
811 "title" : " foo" ,
912 "transparent" : true ,
1619 "span" : 12 ,
1720 "title" : " " ,
1821 "type" : " text"
22+ },
23+ "repeat" : {
24+ "content" : " " ,
25+ "datasource" : null ,
26+ "maxPerRow" : null ,
27+ "mode" : " markdown" ,
28+ "repeat" : " my-variable" ,
29+ "repeatDirection" : null ,
30+ "span" : 12 ,
31+ "title" : " " ,
32+ "type" : " text"
1933 }
2034}
You can’t perform that action at this time.
0 commit comments