mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
QueryTypes: Add feature toggle to show query types in datasource apiservers (#88213)
* initial attempt * show query types * show query types * with formatting * with formatting * more cleanup * add feature toggle * fix build
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"embed"
|
||||
|
||||
"github.com/grafana/grafana/pkg/expr/classic"
|
||||
"github.com/grafana/grafana/pkg/expr/mathexp"
|
||||
)
|
||||
@@ -100,3 +102,10 @@ const (
|
||||
// Replace non-numbers
|
||||
ReduceModeReplace ReduceMode = "replaceNN"
|
||||
)
|
||||
|
||||
//go:embed query.types.json
|
||||
var f embed.FS
|
||||
|
||||
func QueryTypeDefinitionListJSON() ([]byte, error) {
|
||||
return f.ReadFile("query.types.json")
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package expr
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@@ -178,13 +177,6 @@ func (h *ExpressionQueryReader) ReadQuery(
|
||||
return eq, err
|
||||
}
|
||||
|
||||
//go:embed query.types.json
|
||||
var f embed.FS
|
||||
|
||||
func (h *ExpressionQueryReader) QueryTypeDefinitionListJSON() ([]byte, error) {
|
||||
return f.ReadFile("query.types.json")
|
||||
}
|
||||
|
||||
func getReferenceVar(exp string, refId string) (string, error) {
|
||||
exp = strings.TrimPrefix(exp, "$")
|
||||
if exp == "" {
|
||||
|
||||
Reference in New Issue
Block a user