@perses-dev/clickhouse-plugin 0.6.0 → 0.7.0-beta.2
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/__mf/js/{ClickHouse.4e6199f7.js → ClickHouse.d554fc35.js} +4 -4
- package/__mf/js/async/1522.d8e80570.js +22 -0
- package/__mf/js/async/1616.8ee37fc2.js +1 -0
- package/__mf/js/async/2043.33c976ff.js +2 -0
- package/__mf/js/async/2650.27d5a53e.js +3 -0
- package/__mf/js/async/2901.98424a07.js +1 -0
- package/__mf/js/async/3181.7b46b8e9.js +2 -0
- package/__mf/js/async/392.54a0693e.js +2 -0
- package/__mf/js/async/3944.f70c2037.js +10 -0
- package/__mf/js/async/4077.5b0edb67.js +1 -0
- package/__mf/js/async/4121.0b653ee5.js +2 -0
- package/__mf/js/async/4496.23de7e47.js +1 -0
- package/__mf/js/async/4569.ffd2c654.js +7 -0
- package/__mf/js/async/{6155.1398a410.js.LICENSE.txt → 4569.ffd2c654.js.LICENSE.txt} +41 -1
- package/__mf/js/async/5002.2cee2f35.js +1 -0
- package/__mf/js/async/5071.fe3eb282.js +1 -0
- package/__mf/js/async/5440.6cfd6f26.js +2 -0
- package/__mf/js/async/5562.c5ce26e1.js +2 -0
- package/__mf/js/async/5587.9797bc5a.js +1 -0
- package/__mf/js/async/560.acc0c2d1.js +37 -0
- package/__mf/js/async/6045.93765a0a.js +1 -0
- package/__mf/js/async/6274.35dc924b.js +2 -0
- package/__mf/js/async/7192.f4e0055e.js +1 -0
- package/__mf/js/async/7862.306edb3f.js +2 -0
- package/__mf/js/async/7943.a43cb4a7.js +2 -0
- package/__mf/js/async/7968.a73d7acd.js +1 -0
- package/__mf/js/async/7978.e22f59c6.js +1 -0
- package/__mf/js/async/8356.d102e817.js +1 -0
- package/__mf/js/async/8470.4652ca18.js +2 -0
- package/__mf/js/async/873.cae3f07a.js +1 -0
- package/__mf/js/async/9001.0b1d67e2.js +102 -0
- package/__mf/js/async/9207.b184be58.js +1 -0
- package/__mf/js/async/9235.0aff6249.js +1 -0
- package/__mf/js/async/941.26e4a6ef.js +2 -0
- package/__mf/js/async/9588.a36eacf5.js +1 -0
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.1eba91f6.js +2 -0
- package/__mf/js/async/__federation_expose_ClickHouseLogQuery.27676311.js +20 -0
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.3d225a5d.js +20 -0
- package/__mf/js/{main.39993ad6.js → main.5353a8fc.js} +2 -2
- package/lib/bootstrap.js +2 -2
- package/lib/components/ClickQLEditor.d.ts +2 -2
- package/lib/components/ClickQLEditor.d.ts.map +1 -1
- package/lib/components/ClickQLEditor.js +3 -3
- package/lib/components/ClickQLEditor.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/index.js.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts +2 -2
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js +2 -2
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts +2 -2
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts.map +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +1 -1
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js.map +1 -1
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts +3 -3
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts.map +1 -1
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js.map +1 -1
- package/lib/datasources/click-house-datasource/index.js +3 -3
- package/lib/datasources/click-house-datasource/index.js.map +1 -1
- package/lib/datasources/index.js +1 -1
- package/lib/datasources/index.js.map +1 -1
- package/lib/getPluginModule.d.ts +1 -1
- package/lib/getPluginModule.d.ts.map +1 -1
- package/lib/getPluginModule.js +3 -1
- package/lib/getPluginModule.js.map +1 -1
- package/lib/index-federation.js +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/model/click-house-client.d.ts +1 -1
- package/lib/model/click-house-client.d.ts.map +1 -1
- package/lib/model/click-house-client.js +3 -1
- package/lib/model/click-house-client.js.map +1 -1
- package/lib/model/click-house-data-types.d.ts +1 -1
- package/lib/model/click-house-data-types.d.ts.map +1 -1
- package/lib/model/click-house-data-types.js.map +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts +2 -2
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts.map +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js +4 -6
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js.map +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts +3 -3
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts.map +1 -1
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js +9 -9
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js.map +1 -1
- package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts +1 -1
- package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts.map +1 -1
- package/lib/queries/click-house-log-query/click-house-log-query-types.js.map +1 -1
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts +2 -2
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts.map +1 -1
- package/lib/queries/click-house-log-query/get-click-house-log-data.js +4 -4
- package/lib/queries/click-house-log-query/get-click-house-log-data.js.map +1 -1
- package/lib/queries/click-house-log-query/index.js +4 -4
- package/lib/queries/click-house-log-query/index.js.map +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts +2 -2
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts.map +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js +4 -6
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js.map +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts +3 -3
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts.map +1 -1
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js +9 -9
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js.map +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts.map +1 -1
- package/lib/queries/click-house-time-series-query/click-house-query-types.js.map +1 -1
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts +2 -2
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts.map +1 -1
- package/lib/queries/click-house-time-series-query/get-click-house-data.js +5 -5
- package/lib/queries/click-house-time-series-query/get-click-house-data.js.map +1 -1
- package/lib/queries/click-house-time-series-query/index.js +4 -4
- package/lib/queries/click-house-time-series-query/index.js.map +1 -1
- package/lib/queries/index.js +2 -2
- package/lib/queries/index.js.map +1 -1
- package/lib/queries/query-editor-model.d.ts +1 -1
- package/lib/queries/query-editor-model.d.ts.map +1 -1
- package/lib/queries/query-editor-model.js +2 -2
- package/lib/queries/query-editor-model.js.map +1 -1
- package/lib/setup-tests.d.ts +1 -1
- package/lib/setup-tests.d.ts.map +1 -1
- package/lib/setup-tests.js +2 -2
- package/lib/setup-tests.js.map +1 -1
- package/mf-manifest.json +69 -98
- package/mf-stats.json +69 -102
- package/package.json +21 -13
- package/__mf/js/async/1616.c86fdd40.js +0 -1
- package/__mf/js/async/1728.a4ac7d54.js +0 -1
- package/__mf/js/async/1811.29b51780.js +0 -101
- package/__mf/js/async/1825.299edaf9.js +0 -1
- package/__mf/js/async/1969.ea0bd5b9.js +0 -1
- package/__mf/js/async/2043.13379b9d.js +0 -2
- package/__mf/js/async/2386.56de292b.js +0 -2
- package/__mf/js/async/3059.3d9dad23.js +0 -1
- package/__mf/js/async/3181.f3124eab.js +0 -2
- package/__mf/js/async/392.c8af2244.js +0 -2
- package/__mf/js/async/3981.9bd5679b.js +0 -3
- package/__mf/js/async/4121.b6afa425.js +0 -2
- package/__mf/js/async/4233.abbba3f6.js +0 -7
- package/__mf/js/async/4233.abbba3f6.js.LICENSE.txt +0 -39
- package/__mf/js/async/5002.9167d87e.js +0 -1
- package/__mf/js/async/5071.a039a221.js +0 -1
- package/__mf/js/async/5440.898ddc2f.js +0 -2
- package/__mf/js/async/5481.223427f5.js +0 -2
- package/__mf/js/async/5562.d4359565.js +0 -2
- package/__mf/js/async/5587.72383e00.js +0 -1
- package/__mf/js/async/599.e213c21c.js +0 -1
- package/__mf/js/async/6045.9b807b97.js +0 -1
- package/__mf/js/async/6155.1398a410.js +0 -2
- package/__mf/js/async/6274.22bd6f34.js +0 -2
- package/__mf/js/async/6688.abdc25f6.js +0 -2
- package/__mf/js/async/7177.96ff5c4d.js +0 -1
- package/__mf/js/async/7192.c1f998d2.js +0 -1
- package/__mf/js/async/7968.ae66f60b.js +0 -1
- package/__mf/js/async/7978.a58ed5ff.js +0 -1
- package/__mf/js/async/7984.549ad1a9.js +0 -22
- package/__mf/js/async/8356.eda63865.js +0 -1
- package/__mf/js/async/8470.3ae4fba1.js +0 -2
- package/__mf/js/async/873.e4ddcabf.js +0 -1
- package/__mf/js/async/9235.aeb9d818.js +0 -1
- package/__mf/js/async/941.11ea3ddf.js +0 -2
- package/__mf/js/async/9588.d09a1141.js +0 -1
- package/__mf/js/async/9754.9ea7778b.js +0 -10
- package/__mf/js/async/9836.75f99110.js +0 -1
- package/__mf/js/async/9877.8f08e12a.js +0 -38
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.0e124aef.js +0 -2
- package/__mf/js/async/__federation_expose_ClickHouseLogQuery.605ad0d2.js +0 -20
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.a7927056.js +0 -20
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.a7927056.js.LICENSE.txt +0 -9
- package/lib/cjs/bootstrap.js +0 -26
- package/lib/cjs/components/ClickQLEditor.js +0 -72
- package/lib/cjs/components/constants.js +0 -41
- package/lib/cjs/components/index.js +0 -30
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasource.js +0 -49
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +0 -51
- package/lib/cjs/datasources/click-house-datasource/click-house-datasource-types.js +0 -16
- package/lib/cjs/datasources/click-house-datasource/index.js +0 -32
- package/lib/cjs/datasources/index.js +0 -30
- package/lib/cjs/env.d.js +0 -14
- package/lib/cjs/getPluginModule.js +0 -39
- package/lib/cjs/index-federation.js +0 -55
- package/lib/cjs/index.js +0 -38
- package/lib/cjs/model/click-house-client.js +0 -83
- package/lib/cjs/model/click-house-data-types.js +0 -16
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQuery.js +0 -45
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQueryEditor.js +0 -104
- package/lib/cjs/queries/click-house-log-query/click-house-log-query-types.js +0 -16
- package/lib/cjs/queries/click-house-log-query/get-click-house-log-data.js +0 -93
- package/lib/cjs/queries/click-house-log-query/index.js +0 -33
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQuery.js +0 -43
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQueryEditor.js +0 -104
- package/lib/cjs/queries/click-house-time-series-query/click-house-query-types.js +0 -16
- package/lib/cjs/queries/click-house-time-series-query/get-click-house-data.js +0 -116
- package/lib/cjs/queries/click-house-time-series-query/index.js +0 -33
- package/lib/cjs/queries/constants.js +0 -34
- package/lib/cjs/queries/index.js +0 -31
- package/lib/cjs/queries/query-editor-model.js +0 -53
- package/lib/cjs/setup-tests.js +0 -19
- /package/__mf/css/async/{4233.85c2cbf6.css → 4569.85c2cbf6.css} +0 -0
- /package/__mf/js/async/{7984.549ad1a9.js.LICENSE.txt → 1522.d8e80570.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2043.13379b9d.js.LICENSE.txt → 2043.33c976ff.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{2386.56de292b.js.LICENSE.txt → 3181.7b46b8e9.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{392.c8af2244.js.LICENSE.txt → 392.54a0693e.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{9754.9ea7778b.js.LICENSE.txt → 3944.f70c2037.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{4121.b6afa425.js.LICENSE.txt → 4121.0b653ee5.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5440.898ddc2f.js.LICENSE.txt → 5440.6cfd6f26.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{3181.f3124eab.js.LICENSE.txt → 5562.c5ce26e1.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6274.22bd6f34.js.LICENSE.txt → 6274.35dc924b.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5481.223427f5.js.LICENSE.txt → 7862.306edb3f.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{5562.d4359565.js.LICENSE.txt → 7943.a43cb4a7.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{8470.3ae4fba1.js.LICENSE.txt → 8470.4652ca18.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{6688.abdc25f6.js.LICENSE.txt → 941.26e4a6ef.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{941.11ea3ddf.js.LICENSE.txt → __federation_expose_ClickHouseDatasource.1eba91f6.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_ClickHouseDatasource.0e124aef.js.LICENSE.txt → __federation_expose_ClickHouseLogQuery.27676311.js.LICENSE.txt} +0 -0
- /package/__mf/js/async/{__federation_expose_ClickHouseLogQuery.605ad0d2.js.LICENSE.txt → __federation_expose_ClickHouseTimeSeriesQuery.3d225a5d.js.LICENSE.txt} +0 -0
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "ClickQLEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ClickQLEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _reactcodemirror = /*#__PURE__*/ _interop_require_default(require("@uiw/react-codemirror"));
|
|
25
|
-
const _view = require("@codemirror/view");
|
|
26
|
-
const _material = require("@mui/material");
|
|
27
|
-
function _interop_require_default(obj) {
|
|
28
|
-
return obj && obj.__esModule ? obj : {
|
|
29
|
-
default: obj
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
function ClickQLEditor(props) {
|
|
33
|
-
const theme = (0, _material.useTheme)();
|
|
34
|
-
const isDarkMode = theme.palette.mode === 'dark';
|
|
35
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
36
|
-
position: "relative",
|
|
37
|
-
children: [
|
|
38
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
39
|
-
sx: {
|
|
40
|
-
fontWeight: 500,
|
|
41
|
-
marginBottom: '4px',
|
|
42
|
-
color: theme.palette.text.primary
|
|
43
|
-
},
|
|
44
|
-
children: "ClickHouse Query"
|
|
45
|
-
}),
|
|
46
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcodemirror.default, {
|
|
47
|
-
...props,
|
|
48
|
-
style: {
|
|
49
|
-
border: `1px solid ${theme.palette.divider}`
|
|
50
|
-
},
|
|
51
|
-
theme: isDarkMode ? 'dark' : 'light',
|
|
52
|
-
basicSetup: {
|
|
53
|
-
highlightActiveLine: false,
|
|
54
|
-
highlightActiveLineGutter: false,
|
|
55
|
-
foldGutter: false,
|
|
56
|
-
syntaxHighlighting: true
|
|
57
|
-
},
|
|
58
|
-
extensions: [
|
|
59
|
-
_view.EditorView.lineWrapping,
|
|
60
|
-
_view.EditorView.theme({
|
|
61
|
-
'.cm-content': {
|
|
62
|
-
paddingTop: '8px',
|
|
63
|
-
paddingBottom: '8px',
|
|
64
|
-
paddingRight: '40px'
|
|
65
|
-
}
|
|
66
|
-
})
|
|
67
|
-
],
|
|
68
|
-
placeholder: "Write ClickHouse Query Here..."
|
|
69
|
-
})
|
|
70
|
-
]
|
|
71
|
-
});
|
|
72
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "queryExample", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return queryExample;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const queryExample = `-- Time Series Query
|
|
24
|
-
SELECT
|
|
25
|
-
toStartOfMinute(timestamp) as time,
|
|
26
|
-
avg(cpu_usage) as avg_cpu,
|
|
27
|
-
max(memory_usage) as max_memory
|
|
28
|
-
FROM system_metrics
|
|
29
|
-
WHERE timestamp BETWEEN '{start}' AND '{end}'
|
|
30
|
-
GROUP BY time ORDER BY time
|
|
31
|
-
-- Logs Query
|
|
32
|
-
SELECT
|
|
33
|
-
Timestamp as log_time,
|
|
34
|
-
Body,
|
|
35
|
-
ServiceName,
|
|
36
|
-
ResourceAttributes,
|
|
37
|
-
SeverityNumber,
|
|
38
|
-
SeverityText
|
|
39
|
-
FROM application_logs
|
|
40
|
-
WHERE timestamp >= '{start}'
|
|
41
|
-
ORDER BY time DESC LIMIT 1000`;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
_export_star(require("./ClickQLEditor"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "ClickHouseDatasource", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ClickHouseDatasource;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _clickhouseclient = require("../../model/click-house-client");
|
|
24
|
-
const _ClickHouseDatasourceEditor = require("./ClickHouseDatasourceEditor");
|
|
25
|
-
const createClient = (spec, options)=>{
|
|
26
|
-
const { directUrl, proxy } = spec;
|
|
27
|
-
const { proxyUrl } = options;
|
|
28
|
-
const datasourceUrl = directUrl ?? proxyUrl;
|
|
29
|
-
if (datasourceUrl === undefined) {
|
|
30
|
-
throw new Error('No URL specified for ClickHouseDatasource client. You can use directUrl in the spec to configure it.');
|
|
31
|
-
}
|
|
32
|
-
const specHeaders = proxy?.spec.headers || {};
|
|
33
|
-
return {
|
|
34
|
-
options: {
|
|
35
|
-
datasourceUrl
|
|
36
|
-
},
|
|
37
|
-
query: (params, headers)=>(0, _clickhouseclient.query)(params, {
|
|
38
|
-
datasourceUrl,
|
|
39
|
-
headers: headers ?? specHeaders
|
|
40
|
-
})
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
const ClickHouseDatasource = {
|
|
44
|
-
createClient,
|
|
45
|
-
OptionsEditorComponent: _ClickHouseDatasourceEditor.ClickHouseDatasourceEditor,
|
|
46
|
-
createInitialOptions: ()=>({
|
|
47
|
-
directUrl: ''
|
|
48
|
-
})
|
|
49
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "ClickHouseDatasourceEditor", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ClickHouseDatasourceEditor;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
-
function ClickHouseDatasourceEditor(props) {
|
|
26
|
-
const { value, onChange, isReadonly } = props;
|
|
27
|
-
const initialSpecDirect = {
|
|
28
|
-
directUrl: ''
|
|
29
|
-
};
|
|
30
|
-
const initialSpecProxy = {
|
|
31
|
-
proxy: {
|
|
32
|
-
kind: 'HTTPProxy',
|
|
33
|
-
spec: {
|
|
34
|
-
allowedEndpoints: [
|
|
35
|
-
{
|
|
36
|
-
endpointPattern: '/',
|
|
37
|
-
method: 'GET'
|
|
38
|
-
}
|
|
39
|
-
],
|
|
40
|
-
url: ''
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.HTTPSettingsEditor, {
|
|
45
|
-
value: value,
|
|
46
|
-
onChange: onChange,
|
|
47
|
-
isReadonly: isReadonly,
|
|
48
|
-
initialSpecDirect: initialSpecDirect,
|
|
49
|
-
initialSpecProxy: initialSpecProxy
|
|
50
|
-
});
|
|
51
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
_export_star(require("./ClickHouseDatasource"), exports);
|
|
18
|
-
_export_star(require("./ClickHouseDatasourceEditor"), exports);
|
|
19
|
-
_export_star(require("./click-house-datasource-types"), exports);
|
|
20
|
-
function _export_star(from, to) {
|
|
21
|
-
Object.keys(from).forEach(function(k) {
|
|
22
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
23
|
-
Object.defineProperty(to, k, {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function() {
|
|
26
|
-
return from[k];
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
return from;
|
|
32
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
_export_star(require("./click-house-datasource"), exports);
|
|
18
|
-
function _export_star(from, to) {
|
|
19
|
-
Object.keys(from).forEach(function(k) {
|
|
20
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
21
|
-
Object.defineProperty(to, k, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function() {
|
|
24
|
-
return from[k];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
return from;
|
|
30
|
-
}
|
package/lib/cjs/env.d.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
/// <reference types="@rsbuild/core/types" />
|
|
14
|
-
"use strict";
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "getPluginModule", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return getPluginModule;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _packagejson = /*#__PURE__*/ _interop_require_default(require("../package.json"));
|
|
24
|
-
function _interop_require_default(obj) {
|
|
25
|
-
return obj && obj.__esModule ? obj : {
|
|
26
|
-
default: obj
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function getPluginModule() {
|
|
30
|
-
const { name, version, perses } = _packagejson.default;
|
|
31
|
-
return {
|
|
32
|
-
kind: 'PluginModule',
|
|
33
|
-
metadata: {
|
|
34
|
-
name,
|
|
35
|
-
version
|
|
36
|
-
},
|
|
37
|
-
spec: perses
|
|
38
|
-
};
|
|
39
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
3
|
-
if (typeof WeakMap !== "function") return null;
|
|
4
|
-
var cacheBabelInterop = new WeakMap();
|
|
5
|
-
var cacheNodeInterop = new WeakMap();
|
|
6
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
7
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
8
|
-
})(nodeInterop);
|
|
9
|
-
}
|
|
10
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
11
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
12
|
-
return obj;
|
|
13
|
-
}
|
|
14
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
15
|
-
return {
|
|
16
|
-
default: obj
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
20
|
-
if (cache && cache.has(obj)) {
|
|
21
|
-
return cache.get(obj);
|
|
22
|
-
}
|
|
23
|
-
var newObj = {
|
|
24
|
-
__proto__: null
|
|
25
|
-
};
|
|
26
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
27
|
-
for(var key in obj){
|
|
28
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
29
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
30
|
-
if (desc && (desc.get || desc.set)) {
|
|
31
|
-
Object.defineProperty(newObj, key, desc);
|
|
32
|
-
} else {
|
|
33
|
-
newObj[key] = obj[key];
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
newObj.default = obj;
|
|
38
|
-
if (cache) {
|
|
39
|
-
cache.set(obj, newObj);
|
|
40
|
-
}
|
|
41
|
-
return newObj;
|
|
42
|
-
}
|
|
43
|
-
// Copyright The Perses Authors
|
|
44
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
-
// you may not use this file except in compliance with the License.
|
|
46
|
-
// You may obtain a copy of the License at
|
|
47
|
-
//
|
|
48
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
-
//
|
|
50
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
51
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
-
// See the License for the specific language governing permissions and
|
|
54
|
-
// limitations under the License.
|
|
55
|
-
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/index.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "getPluginModule", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return _getPluginModule.getPluginModule;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _getPluginModule = require("./getPluginModule");
|
|
24
|
-
_export_star(require("./queries"), exports);
|
|
25
|
-
_export_star(require("./datasources"), exports);
|
|
26
|
-
function _export_star(from, to) {
|
|
27
|
-
Object.keys(from).forEach(function(k) {
|
|
28
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
29
|
-
Object.defineProperty(to, k, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function() {
|
|
32
|
-
return from[k];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
return from;
|
|
38
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
function _export(target, all) {
|
|
18
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
_export(exports, {
|
|
24
|
-
get formatClickHouseDateTime () {
|
|
25
|
-
return formatClickHouseDateTime;
|
|
26
|
-
},
|
|
27
|
-
get query () {
|
|
28
|
-
return query;
|
|
29
|
-
},
|
|
30
|
-
get replaceTimeRangePlaceholders () {
|
|
31
|
-
return replaceTimeRangePlaceholders;
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
function replaceTimeRangePlaceholders(query, start, end) {
|
|
35
|
-
return query.replaceAll('{start}', start ?? '{start}').replaceAll('{end}', end ?? '{end}');
|
|
36
|
-
}
|
|
37
|
-
function formatClickHouseDateTime(date) {
|
|
38
|
-
return date.toISOString().replace('T', ' ').replace(/\.\d{3}Z$/, '');
|
|
39
|
-
}
|
|
40
|
-
async function query(params, queryOptions) {
|
|
41
|
-
const { datasourceUrl, headers } = queryOptions;
|
|
42
|
-
const url = urlBuilder(datasourceUrl);
|
|
43
|
-
if (!params.query) {
|
|
44
|
-
throw new Error('No query provided in params');
|
|
45
|
-
}
|
|
46
|
-
let finalQuery = replaceTimeRangePlaceholders(params.query.trim(), params.start, params.end);
|
|
47
|
-
if (!finalQuery.toUpperCase().includes('FORMAT')) {
|
|
48
|
-
finalQuery += ' FORMAT JSON';
|
|
49
|
-
}
|
|
50
|
-
url.searchParams.set('query', finalQuery);
|
|
51
|
-
url.searchParams.set('database', params.database || 'default');
|
|
52
|
-
const init = {
|
|
53
|
-
method: 'GET',
|
|
54
|
-
headers: {
|
|
55
|
-
...headers
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
try {
|
|
59
|
-
const response = await fetch(url.toString(), init);
|
|
60
|
-
if (!response.ok) {
|
|
61
|
-
const errorText = await response.text();
|
|
62
|
-
console.error('ClickHouse error response:', errorText);
|
|
63
|
-
return {
|
|
64
|
-
status: 'error',
|
|
65
|
-
data: []
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
const body = await response.json();
|
|
69
|
-
return {
|
|
70
|
-
status: 'success',
|
|
71
|
-
data: body.data || body
|
|
72
|
-
};
|
|
73
|
-
} catch (e) {
|
|
74
|
-
throw new Error(`ClickHouse query failed: ${e}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function urlBuilder(datasourceUrl) {
|
|
78
|
-
if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {
|
|
79
|
-
return new URL(datasourceUrl);
|
|
80
|
-
}
|
|
81
|
-
// if relative path (e.g. proxy url), resolve against window.location.origin
|
|
82
|
-
return new URL(datasourceUrl, window.location.origin);
|
|
83
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// Copyright The Perses Authors
|
|
2
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
-
// you may not use this file except in compliance with the License.
|
|
4
|
-
// You may obtain a copy of the License at
|
|
5
|
-
//
|
|
6
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
//
|
|
8
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
-
// See the License for the specific language governing permissions and
|
|
12
|
-
// limitations under the License.
|
|
13
|
-
"use strict";
|
|
14
|
-
Object.defineProperty(exports, "__esModule", {
|
|
15
|
-
value: true
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(exports, "ClickHouseLogQuery", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function() {
|
|
20
|
-
return ClickHouseLogQuery;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
-
const _getclickhouselogdata = require("./get-click-house-log-data");
|
|
25
|
-
const _ClickHouseLogQueryEditor = require("./ClickHouseLogQueryEditor");
|
|
26
|
-
const ClickHouseLogQuery = {
|
|
27
|
-
getLogData: _getclickhouselogdata.getClickHouseLogData,
|
|
28
|
-
OptionsEditorComponent: _ClickHouseLogQueryEditor.ClickHouseLogQueryEditor,
|
|
29
|
-
createInitialOptions: ()=>({
|
|
30
|
-
query: ''
|
|
31
|
-
}),
|
|
32
|
-
dependsOn: (spec)=>{
|
|
33
|
-
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
34
|
-
const allVariables = [
|
|
35
|
-
...new Set([
|
|
36
|
-
...queryVariables
|
|
37
|
-
])
|
|
38
|
-
];
|
|
39
|
-
return {
|
|
40
|
-
variables: allVariables
|
|
41
|
-
};
|
|
42
|
-
},
|
|
43
|
-
// TODO: Implement proper SQL parsing for volume queries
|
|
44
|
-
createVolumeQuery: ()=>null
|
|
45
|
-
};
|