Skip to content

Commit

Permalink
Update grafonnet-7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
trotttrotttrott committed May 25, 2021
1 parent 55cf4ee commit 556e617
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 21 deletions.
51 changes: 43 additions & 8 deletions grafonnet-7.0/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [target](#target)
* [prometheus.new](#targetPrometheusnew)
* [template](#template)
* [custom.new](#templateCustomnew)
* [datasource.new](#templateDatasourcenew)
* [query.new](#templateQuerynew)

Expand Down Expand Up @@ -56,10 +57,6 @@ Instantiate a dashboard.
* **refreshIntervals**: (type: array, default: `["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"]`)


#### #addTemplate

* **template**: (type: object)

#### #addAnnotation

* **builtIn**: (type: integer, default: `0`)
Expand All @@ -78,6 +75,10 @@ Instantiate a dashboard.

* **showIn**: (type: integer, default: `0`)

#### #addTemplate

* **template**: (type: object)



## panel
Expand Down Expand Up @@ -530,15 +531,15 @@ Instantiate a dashboard.
* **values**: (type: boolean, default: `false`)


#### #addPanelLink
#### #addDataLink

* **targetBlank**: (type: boolean, default: `true`)

* **title**: (type: string, default: `null`)

* **url**: (type: string, default: `null`)

#### #addDataLink
#### #addPanelLink

* **targetBlank**: (type: boolean, default: `true`)

Expand Down Expand Up @@ -756,7 +757,41 @@ Instantiate a dashboard.



### tamplate.datasource.new
### template.custom.new



* **allValue**: (type: string, default: `null`)

* **hide**: (type: integer, default: `0`)

* **includeAll**: (type: boolean, default: `false`)

* **label**: (type: string, default: `null`)

* **multi**: (type: boolean, default: `false`)

* **name**: (type: string, default: `null`)

* **query**: (type: string, default: `null`)

* **queryValue**: (type: string, default: `""`)

* **skipUrlSync**: (type: string, default: `false`)


#### #setCurrent

* **selected**: (type: boolean, default: `false`)

* **text**: (type: string, default: `null`)

* **value**: (type: string, default: `null`)




### template.datasource.new



Expand Down Expand Up @@ -790,7 +825,7 @@ Instantiate a dashboard.



### tamplate.query.new
### template.query.new



Expand Down
14 changes: 7 additions & 7 deletions grafonnet-7.0/dashboard.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
,


addTemplate(
template
):: self {}
+ { templating+: { list+: [
template,
] } },

addAnnotation(
builtIn=0,
datasource='default',
Expand All @@ -64,13 +71,6 @@
},
] } },

addTemplate(
template
):: self {}
+ { templating+: { list+: [
template,
] } },


panels: [],
_nextPanelID:: 2,
Expand Down
1 change: 1 addition & 0 deletions grafonnet-7.0/grafana.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
prometheus:: import 'target/prometheus.libsonnet',
},
template:: {
custom:: import 'template/custom.libsonnet',
datasource:: import 'template/datasource.libsonnet',
query:: import 'template/query.libsonnet',
},
Expand Down
12 changes: 6 additions & 6 deletions grafonnet-7.0/panel/stat.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,31 @@
,


addDataLink(
addPanelLink(
targetBlank=true,
title=null,
url=null,
):: self {}
+ { fieldConfig+: { defaults+: { links+: [
+ { links+: [
{
[if targetBlank != null then 'targetBlank']: targetBlank,
[if title != null then 'title']: title,
[if url != null then 'url']: url,
},
] } } },
] },

addPanelLink(
addDataLink(
targetBlank=true,
title=null,
url=null,
):: self {}
+ { links+: [
+ { fieldConfig+: { defaults+: { links+: [
{
[if targetBlank != null then 'targetBlank']: targetBlank,
[if title != null then 'title']: title,
[if url != null then 'url']: url,
},
] },
] } } },

addMapping(
from=null,
Expand Down
36 changes: 36 additions & 0 deletions grafonnet-7.0/template/custom.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file was generated by https://github.com/grafana/dashboard-spec

{
new(
allValue=null,
hide=0,
includeAll=false,
label=null,
multi=false,
name=null,
query=null,
queryValue='',
skipUrlSync=false,
):: {
[if allValue != null then 'allValue']: allValue,
[if hide != null then 'hide']: hide,
[if includeAll != null then 'includeAll']: includeAll,
[if label != null then 'label']: label,
[if multi != null then 'multi']: multi,
[if name != null then 'name']: name,
[if query != null then 'query']: query,
[if queryValue != null then 'queryValue']: queryValue,
[if skipUrlSync != null then 'skipUrlSync']: skipUrlSync,
type: 'custom',

setCurrent(
selected=false,
text=null,
value=null,
):: self {}
+ { current+: { [if selected != null then 'selected']: selected } }
+ { current+: { [if text != null then 'text']: text } }
+ { current+: { [if value != null then 'value']: value } },

},
}

0 comments on commit 556e617

Please sign in to comment.