From 0080c4e507bcedfdda5ff6534f6b75411cfa0f0b Mon Sep 17 00:00:00 2001 From: TheComice <45947516+TheComice@users.noreply.github.com> Date: Wed, 27 Jan 2021 22:33:13 +0000 Subject: [PATCH] Create custom.libsonnet Add Custom template to Grafonnet 7.0. --- grafonnet-7.0/template/custom.libsonnet | 36 +++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 grafonnet-7.0/template/custom.libsonnet diff --git a/grafonnet-7.0/template/custom.libsonnet b/grafonnet-7.0/template/custom.libsonnet new file mode 100644 index 00000000..3755b621 --- /dev/null +++ b/grafonnet-7.0/template/custom.libsonnet @@ -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 } }, + + }, +}