@grafana/plugin-ui 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toOption = exports.QUERY_FORMAT_OPTIONS = exports.EditorMode = exports.QueryFormat = void 0;
|
|
4
4
|
const data_1 = require("@grafana/data");
|
|
5
|
+
// Match the Enums Expected in SqlUtil and SqlDS
|
|
6
|
+
// https://github.com/grafana/grafana-plugin-sdk-go/blob/main/data/sqlutil/query.go#L18-L29
|
|
5
7
|
var QueryFormat;
|
|
6
8
|
(function (QueryFormat) {
|
|
7
|
-
QueryFormat["Timeseries"] = "
|
|
8
|
-
QueryFormat["Table"] = "
|
|
9
|
+
QueryFormat[QueryFormat["Timeseries"] = 0] = "Timeseries";
|
|
10
|
+
QueryFormat[QueryFormat["Table"] = 1] = "Table";
|
|
11
|
+
QueryFormat[QueryFormat["Logs"] = 2] = "Logs";
|
|
12
|
+
QueryFormat[QueryFormat["Trace"] = 3] = "Trace";
|
|
13
|
+
QueryFormat[QueryFormat["OptionMulti"] = 4] = "OptionMulti";
|
|
9
14
|
})(QueryFormat = exports.QueryFormat || (exports.QueryFormat = {}));
|
|
10
15
|
var EditorMode;
|
|
11
16
|
(function (EditorMode) {
|
|
@@ -13,8 +18,8 @@ var EditorMode;
|
|
|
13
18
|
EditorMode["Code"] = "code";
|
|
14
19
|
})(EditorMode = exports.EditorMode || (exports.EditorMode = {}));
|
|
15
20
|
exports.QUERY_FORMAT_OPTIONS = [
|
|
16
|
-
{ label:
|
|
17
|
-
{ label:
|
|
21
|
+
{ label: "Time series", value: QueryFormat.Timeseries },
|
|
22
|
+
{ label: "Table", value: QueryFormat.Table },
|
|
18
23
|
];
|
|
19
24
|
const backWardToOption = (value) => ({ label: value, value });
|
|
20
25
|
exports.toOption = data_1.toOption !== null && data_1.toOption !== void 0 ? data_1.toOption : backWardToOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/QueryEditor/types.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/QueryEditor/types.ts"],"names":[],"mappings":";;;AAEA,wCAOuB;AAyCvB,gDAAgD;AAChD,2FAA2F;AAC3F,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,yDAAU,CAAA;IACV,+CAAK,CAAA;IACL,6CAAI,CAAA;IACJ,+CAAK,CAAA;IACL,2DAAW,CAAA;AACb,CAAC,EANW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAMtB;AAED,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,2BAAa,CAAA;AACf,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAoDY,QAAA,oBAAoB,GAAG;IAClC,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,CAAC,UAAU,EAAE;IACvD,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE;CAC7C,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAEzD,QAAA,QAAQ,GAAG,eAAgB,aAAhB,eAAgB,cAAhB,eAAgB,GAAI,gBAAgB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { JsonTree } from
|
|
2
|
-
import { DataFrame,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { JsonTree } from "react-awesome-query-builder";
|
|
2
|
+
import { DataFrame, DataSourceJsonData, MetricFindValue, SelectableValue, TimeRange } from "@grafana/data";
|
|
3
|
+
import { DataQuery } from "@grafana/schema";
|
|
4
|
+
import { QueryWithDefaults } from "./defaults";
|
|
5
|
+
import { QueryEditorFunctionExpression, QueryEditorGroupByExpression, QueryEditorPropertyExpression } from "./expressions";
|
|
6
|
+
import { CompletionItemKind, LanguageCompletionProvider } from "@grafana/experimental";
|
|
6
7
|
export interface SqlQueryForInterpolation {
|
|
7
8
|
dataset?: string;
|
|
8
9
|
alias?: string;
|
|
@@ -27,8 +28,11 @@ export interface SQLOptions extends SQLConnectionLimits, DataSourceJsonData {
|
|
|
27
28
|
timeInterval: string;
|
|
28
29
|
}
|
|
29
30
|
export declare enum QueryFormat {
|
|
30
|
-
Timeseries =
|
|
31
|
-
Table =
|
|
31
|
+
Timeseries = 0,
|
|
32
|
+
Table = 1,
|
|
33
|
+
Logs = 2,
|
|
34
|
+
Trace = 3,
|
|
35
|
+
OptionMulti = 4
|
|
32
36
|
}
|
|
33
37
|
export declare enum EditorMode {
|
|
34
38
|
Builder = "builder",
|
|
@@ -56,7 +60,7 @@ export interface SQLExpression {
|
|
|
56
60
|
filters?: SQLFilters;
|
|
57
61
|
groupBy?: QueryEditorGroupByExpression[];
|
|
58
62
|
orderBy?: QueryEditorPropertyExpression;
|
|
59
|
-
orderByDirection?:
|
|
63
|
+
orderByDirection?: "ASC" | "DESC";
|
|
60
64
|
limit?: number;
|
|
61
65
|
offset?: number;
|
|
62
66
|
}
|
|
@@ -87,7 +91,7 @@ export interface ResourceSelectorProps {
|
|
|
87
91
|
className?: string;
|
|
88
92
|
applyDefault?: boolean;
|
|
89
93
|
}
|
|
90
|
-
export type RAQBFieldTypes =
|
|
94
|
+
export type RAQBFieldTypes = "text" | "number" | "boolean" | "datetime" | "date" | "time";
|
|
91
95
|
export interface SQLSelectableValue extends SelectableValue {
|
|
92
96
|
type?: string;
|
|
93
97
|
raqbFieldType?: RAQBFieldTypes;
|