Variables: Add new format id (#66793)

This commit is contained in:
juanicabanas
2023-04-18 22:24:56 -03:00
committed by GitHub
parent 987eff82a3
commit 97a0527b44
2 changed files with 20 additions and 17 deletions

View File

@@ -771,6 +771,7 @@ export enum VariableFormatID {
SQLString = 'sqlstring', SQLString = 'sqlstring',
SingleQuote = 'singlequote', SingleQuote = 'singlequote',
Text = 'text', Text = 'text',
UriEncode = 'uriencode',
} }
export interface DataSourceRef { export interface DataSourceRef {

View File

@@ -2,36 +2,38 @@ package common
// Optional formats for the template variable replace functions // Optional formats for the template variable replace functions
// See also https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#advanced-variable-format-options // See also https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#advanced-variable-format-options
VariableFormatID: VariableFormatID:
// Values are lucene escaped and multi-valued variables generate an OR expression // Values are lucene escaped and multi-valued variables generate an OR expression
"lucene" | "lucene" |
// Raw values // Raw values
"raw" | "raw" |
// Values are regex escaped and multi-valued variables generate a (<value>|<value>) expression // Values are regex escaped and multi-valued variables generate a (<value>|<value>) expression
"regex" | "regex" |
// Values are separated by | character // Values are separated by | character
"pipe" | "pipe" |
// Multiple values are formatted like variable=value // Multiple values are formatted like variable=value
"distributed" | "distributed" |
// Comma seperated values // Comma seperated values
"csv" | "csv" |
// HTML escaped // HTML escaped
"html" | "html" |
// JSON values // JSON values
"json" | "json" |
// Percent encode // Percent encode
"percentencode" | "percentencode" |
// Uri encode
"uriencode" |
// Single quote // Single quote
"singlequote" | "singlequote" |
// Double quote // Double quote
"doublequote" | "doublequote" |
// SQL string quoting and commas for use in IN statements and other scenarios // SQL string quoting and commas for use in IN statements and other scenarios
"sqlstring" | "sqlstring" |
// Date // Date
"date" | "date" |
// Format multi-valued variables using glob syntax, example {value1,value2} // Format multi-valued variables using glob syntax, example {value1,value2}
"glob" | "glob" |
// Format variables in their text representation. Example in multi-variable scenario A + B + C. // Format variables in their text representation. Example in multi-variable scenario A + B + C.
"text" | "text" |
// Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C. // Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C.
"queryparam" @cuetsy(kind="enum",memberNames="Lucene|Raw|Regex|Pipe|Distributed|CSV|HTML|JSON|PercentEncode|SingleQuote|DoubleQuote|SQLString|Date|Glob|Text|QueryParam") "queryparam" @cuetsy(kind="enum",memberNames="Lucene|Raw|Regex|Pipe|Distributed|CSV|HTML|JSON|PercentEncode|UriEncode|SingleQuote|DoubleQuote|SQLString|Date|Glob|Text|QueryParam")