@perses-dev/clickhouse-plugin 0.1.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/README.md +41 -0
- package/__mf/css/async/1580.6b2b0c71.css +1 -0
- package/__mf/css/async/2341.6b2b0c71.css +1 -0
- package/__mf/css/async/6759.6b2b0c71.css +1 -0
- package/__mf/font/lato-all-300-normal.322bdf14.woff +0 -0
- package/__mf/font/lato-all-400-normal.63513b00.woff +0 -0
- package/__mf/font/lato-all-700-normal.bb27db94.woff +0 -0
- package/__mf/font/lato-all-900-normal.a27049a3.woff +0 -0
- package/__mf/font/lato-latin-300-normal.c5195215.woff2 +0 -0
- package/__mf/font/lato-latin-400-normal.b7ffde23.woff2 +0 -0
- package/__mf/font/lato-latin-700-normal.d5eb20bc.woff2 +0 -0
- package/__mf/font/lato-latin-900-normal.d884a71c.woff2 +0 -0
- package/__mf/font/lato-latin-ext-300-normal.abcc64a9.woff2 +0 -0
- package/__mf/font/lato-latin-ext-400-normal.6ebed106.woff2 +0 -0
- package/__mf/font/lato-latin-ext-700-normal.8697d1d5.woff2 +0 -0
- package/__mf/font/lato-latin-ext-900-normal.20a2b415.woff2 +0 -0
- package/__mf/js/ClickHouse.99e35ca2.js +5 -0
- package/__mf/js/async/1580.5bd6ed40.js +2 -0
- package/__mf/js/async/1580.5bd6ed40.js.LICENSE.txt +9 -0
- package/__mf/js/async/1964.dccce52b.js +2 -0
- package/__mf/js/async/1964.dccce52b.js.LICENSE.txt +9 -0
- package/__mf/js/async/2114.27f707a0.js +1 -0
- package/__mf/js/async/2292.248bd1ea.js +2 -0
- package/__mf/js/async/2292.248bd1ea.js.LICENSE.txt +24 -0
- package/__mf/js/async/2417.1f135170.js +2 -0
- package/__mf/js/async/2417.1f135170.js.LICENSE.txt +9 -0
- package/__mf/js/async/2448.e42be954.js +10 -0
- package/__mf/js/async/2448.e42be954.js.LICENSE.txt +17 -0
- package/__mf/js/async/2651.3bdd6b21.js +1 -0
- package/__mf/js/async/3224.5735a223.js +1 -0
- package/__mf/js/async/3431.54fb88df.js +1 -0
- package/__mf/js/async/3632.f88c5ced.js +101 -0
- package/__mf/js/async/3863.70d46fa8.js +2 -0
- package/__mf/js/async/3863.70d46fa8.js.LICENSE.txt +9 -0
- package/__mf/js/async/3960.e0eb27f3.js +2 -0
- package/__mf/js/async/3960.e0eb27f3.js.LICENSE.txt +8 -0
- package/__mf/js/async/3980.2a6bea70.js +2 -0
- package/__mf/js/async/3980.2a6bea70.js.LICENSE.txt +9 -0
- package/__mf/js/async/4075.598f1ee5.js +1 -0
- package/__mf/js/async/4168.af4fa8b3.js +2 -0
- package/__mf/js/async/4238.8c8282dc.js +1 -0
- package/__mf/js/async/4269.a389e8c6.js +2 -0
- package/__mf/js/async/4269.a389e8c6.js.LICENSE.txt +9 -0
- package/__mf/js/async/4368.8468ec0a.js +2 -0
- package/__mf/js/async/4368.8468ec0a.js.LICENSE.txt +15 -0
- package/__mf/js/async/4421.de18bb66.js +1 -0
- package/__mf/js/async/5035.8a983cd3.js +73 -0
- package/__mf/js/async/5035.8a983cd3.js.LICENSE.txt +19 -0
- package/__mf/js/async/5214.d1943ccc.js +1 -0
- package/__mf/js/async/5409.c4876520.js +1 -0
- package/__mf/js/async/56.9997e6f8.js +1 -0
- package/__mf/js/async/5713.92805154.js +1 -0
- package/__mf/js/async/5981.f3abf3c8.js +2 -0
- package/__mf/js/async/5981.f3abf3c8.js.LICENSE.txt +8 -0
- package/__mf/js/async/6292.4311054b.js +1 -0
- package/__mf/js/async/6333.dfeaf029.js +2 -0
- package/__mf/js/async/6333.dfeaf029.js.LICENSE.txt +9 -0
- package/__mf/js/async/6377.6c8c4e15.js +2 -0
- package/__mf/js/async/6377.6c8c4e15.js.LICENSE.txt +32 -0
- package/__mf/js/async/6411.3873365b.js +1 -0
- package/__mf/js/async/6467.f4e5b898.js +1 -0
- package/__mf/js/async/6569.f8ee50db.js +1 -0
- package/__mf/js/async/6714.e4b5281a.js +2 -0
- package/__mf/js/async/6714.e4b5281a.js.LICENSE.txt +21 -0
- package/__mf/js/async/6770.e50c0d08.js +1 -0
- package/__mf/js/async/694.c93f9cdf.js +1 -0
- package/__mf/js/async/7376.c01a7f82.js +1 -0
- package/__mf/js/async/738.0cdf47b4.js +1 -0
- package/__mf/js/async/7740.b3df297f.js +1 -0
- package/__mf/js/async/8216.44c6334e.js +1 -0
- package/__mf/js/async/8465.f4c53fef.js +7 -0
- package/__mf/js/async/8465.f4c53fef.js.LICENSE.txt +21 -0
- package/__mf/js/async/8488.16a69ea5.js +1 -0
- package/__mf/js/async/8709.6d909ac5.js +2 -0
- package/__mf/js/async/8709.6d909ac5.js.LICENSE.txt +9 -0
- package/__mf/js/async/9173.90ba4f20.js +2 -0
- package/__mf/js/async/9173.90ba4f20.js.LICENSE.txt +19 -0
- package/__mf/js/async/9654.ab803765.js +37 -0
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.1ef730b1.js +2 -0
- package/__mf/js/async/__federation_expose_ClickHouseDatasource.1ef730b1.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_ClickHouseLogQuery.3f312752.js +19 -0
- package/__mf/js/async/__federation_expose_ClickHouseTimeSeriesQuery.a3f88e6b.js +19 -0
- package/__mf/js/async/__federation_expose_Logs.88d56eeb.js +2 -0
- package/__mf/js/async/__federation_expose_Logs.88d56eeb.js.LICENSE.txt +9 -0
- package/__mf/js/main.b7c9a660.js +5 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +19 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +26 -0
- package/lib/cjs/components/ClickQLEditor.js +72 -0
- package/lib/cjs/components/constants.js +41 -0
- package/lib/cjs/components/index.js +30 -0
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasource.js +49 -0
- package/lib/cjs/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +51 -0
- package/lib/cjs/datasources/click-house-datasource/click-house-datasource-types.js +16 -0
- package/lib/cjs/datasources/click-house-datasource/index.js +32 -0
- package/lib/cjs/datasources/index.js +30 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +39 -0
- package/lib/cjs/model/click-house-client.js +66 -0
- package/lib/cjs/model/click-house-data-types.js +16 -0
- package/lib/cjs/panels/index.js +30 -0
- package/lib/cjs/panels/logs/Logs.js +37 -0
- package/lib/cjs/panels/logs/LogsComponent.js +47 -0
- package/lib/cjs/panels/logs/LogsSettingsEditor.js +57 -0
- package/lib/cjs/panels/logs/components/EmptyLogsState.js +49 -0
- package/lib/cjs/panels/logs/components/LogRow/LogDetailsTable.js +71 -0
- package/lib/cjs/panels/logs/components/LogRow/LogRow.js +163 -0
- package/lib/cjs/panels/logs/components/LogRow/LogTimestamp.js +45 -0
- package/lib/cjs/panels/logs/components/LogRow/LogsStyles.js +77 -0
- package/lib/cjs/panels/logs/components/LogRow/index.js +37 -0
- package/lib/cjs/panels/logs/components/LogsList.js +44 -0
- package/lib/cjs/panels/logs/components/VirtualizedLogsList.js +60 -0
- package/lib/cjs/panels/logs/components/hooks/useExpandedRows.js +45 -0
- package/lib/cjs/panels/logs/index.js +33 -0
- package/lib/cjs/panels/logs/logs-types.js +16 -0
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQuery.js +43 -0
- package/lib/cjs/queries/click-house-log-query/ClickHouseLogQueryEditor.js +113 -0
- package/lib/cjs/queries/click-house-log-query/click-house-log-query-types.js +16 -0
- package/lib/cjs/queries/click-house-log-query/get-click-house-log-data.js +89 -0
- package/lib/cjs/queries/click-house-log-query/index.js +33 -0
- package/lib/cjs/queries/click-house-log-query/log-query-plugin-interface.js +4 -0
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQuery.js +43 -0
- package/lib/cjs/queries/click-house-time-series-query/ClickHouseQueryEditor.js +113 -0
- package/lib/cjs/queries/click-house-time-series-query/click-house-query-types.js +16 -0
- package/lib/cjs/queries/click-house-time-series-query/get-click-house-data.js +69 -0
- package/lib/cjs/queries/click-house-time-series-query/index.js +33 -0
- package/lib/cjs/queries/constants.js +34 -0
- package/lib/cjs/queries/index.js +31 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/components/ClickQLEditor.d.ts +5 -0
- package/lib/components/ClickQLEditor.d.ts.map +1 -0
- package/lib/components/ClickQLEditor.js +59 -0
- package/lib/components/ClickQLEditor.js.map +1 -0
- package/lib/components/constants.d.ts +2 -0
- package/lib/components/constants.d.ts.map +1 -0
- package/lib/components/constants.js +33 -0
- package/lib/components/constants.js.map +1 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +15 -0
- package/lib/components/index.js.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts +4 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js +41 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasource.js.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts +9 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js +43 -0
- package/lib/datasources/click-house-datasource/ClickHouseDatasourceEditor.js.map +1 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts +26 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js +15 -0
- package/lib/datasources/click-house-datasource/click-house-datasource-types.js.map +1 -0
- package/lib/datasources/click-house-datasource/index.d.ts +4 -0
- package/lib/datasources/click-house-datasource/index.d.ts.map +1 -0
- package/lib/datasources/click-house-datasource/index.js +17 -0
- package/lib/datasources/click-house-datasource/index.js.map +1 -0
- package/lib/datasources/index.d.ts +2 -0
- package/lib/datasources/index.d.ts.map +1 -0
- package/lib/datasources/index.js +15 -0
- package/lib/datasources/index.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +28 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/model/click-house-client.d.ts +22 -0
- package/lib/model/click-house-client.d.ts.map +1 -0
- package/lib/model/click-house-client.js +58 -0
- package/lib/model/click-house-client.js.map +1 -0
- package/lib/model/click-house-data-types.d.ts +22 -0
- package/lib/model/click-house-data-types.d.ts.map +1 -0
- package/lib/model/click-house-data-types.js +15 -0
- package/lib/model/click-house-data-types.js.map +1 -0
- package/lib/panels/index.d.ts +2 -0
- package/lib/panels/index.d.ts.map +1 -0
- package/lib/panels/index.js +15 -0
- package/lib/panels/index.js.map +1 -0
- package/lib/panels/logs/Logs.d.ts +4 -0
- package/lib/panels/logs/Logs.d.ts.map +1 -0
- package/lib/panels/logs/Logs.js +29 -0
- package/lib/panels/logs/Logs.js.map +1 -0
- package/lib/panels/logs/LogsComponent.d.ts +4 -0
- package/lib/panels/logs/LogsComponent.d.ts.map +1 -0
- package/lib/panels/logs/LogsComponent.js +34 -0
- package/lib/panels/logs/LogsComponent.js.map +1 -0
- package/lib/panels/logs/LogsSettingsEditor.d.ts +7 -0
- package/lib/panels/logs/LogsSettingsEditor.d.ts.map +1 -0
- package/lib/panels/logs/LogsSettingsEditor.js +49 -0
- package/lib/panels/logs/LogsSettingsEditor.js.map +1 -0
- package/lib/panels/logs/components/EmptyLogsState.d.ts +7 -0
- package/lib/panels/logs/components/EmptyLogsState.d.ts.map +1 -0
- package/lib/panels/logs/components/EmptyLogsState.js +36 -0
- package/lib/panels/logs/components/EmptyLogsState.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.d.ts +8 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.js +58 -0
- package/lib/panels/logs/components/LogRow/LogDetailsTable.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogRow.d.ts +14 -0
- package/lib/panels/logs/components/LogRow/LogRow.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogRow.js +109 -0
- package/lib/panels/logs/components/LogRow/LogRow.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.d.ts +7 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.js +32 -0
- package/lib/panels/logs/components/LogRow/LogTimestamp.js.map +1 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.d.ts +22 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.js +55 -0
- package/lib/panels/logs/components/LogRow/LogsStyles.js.map +1 -0
- package/lib/panels/logs/components/LogRow/index.d.ts +3 -0
- package/lib/panels/logs/components/LogRow/index.d.ts.map +1 -0
- package/lib/panels/logs/components/LogRow/index.js +16 -0
- package/lib/panels/logs/components/LogRow/index.js.map +1 -0
- package/lib/panels/logs/components/LogsList.d.ts +8 -0
- package/lib/panels/logs/components/LogsList.d.ts.map +1 -0
- package/lib/panels/logs/components/LogsList.js +31 -0
- package/lib/panels/logs/components/LogsList.js.map +1 -0
- package/lib/panels/logs/components/VirtualizedLogsList.d.ts +10 -0
- package/lib/panels/logs/components/VirtualizedLogsList.d.ts.map +1 -0
- package/lib/panels/logs/components/VirtualizedLogsList.js +47 -0
- package/lib/panels/logs/components/VirtualizedLogsList.js.map +1 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.d.ts +6 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.d.ts.map +1 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.js +37 -0
- package/lib/panels/logs/components/hooks/useExpandedRows.js.map +1 -0
- package/lib/panels/logs/index.d.ts +5 -0
- package/lib/panels/logs/index.d.ts.map +1 -0
- package/lib/panels/logs/index.js +18 -0
- package/lib/panels/logs/index.js.map +1 -0
- package/lib/panels/logs/logs-types.d.ts +16 -0
- package/lib/panels/logs/logs-types.d.ts.map +1 -0
- package/lib/panels/logs/logs-types.js +15 -0
- package/lib/panels/logs/logs-types.js.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts +4 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js +35 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQuery.js.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts +7 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js +105 -0
- package/lib/queries/click-house-log-query/ClickHouseLogQueryEditor.js.map +1 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts +6 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.js +15 -0
- package/lib/queries/click-house-log-query/click-house-log-query-types.js.map +1 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts +4 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.js +81 -0
- package/lib/queries/click-house-log-query/get-click-house-log-data.js.map +1 -0
- package/lib/queries/click-house-log-query/index.d.ts +5 -0
- package/lib/queries/click-house-log-query/index.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/index.js +18 -0
- package/lib/queries/click-house-log-query/index.js.map +1 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts +25 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.d.ts.map +1 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.js +3 -0
- package/lib/queries/click-house-log-query/log-query-plugin-interface.js.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts +4 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js +35 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQuery.js.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts +7 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js +105 -0
- package/lib/queries/click-house-time-series-query/ClickHouseQueryEditor.js.map +1 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts +11 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.js +16 -0
- package/lib/queries/click-house-time-series-query/click-house-query-types.js.map +1 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts +4 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.js +61 -0
- package/lib/queries/click-house-time-series-query/get-click-house-data.js.map +1 -0
- package/lib/queries/click-house-time-series-query/index.d.ts +5 -0
- package/lib/queries/click-house-time-series-query/index.d.ts.map +1 -0
- package/lib/queries/click-house-time-series-query/index.js +18 -0
- package/lib/queries/click-house-time-series-query/index.js.map +1 -0
- package/lib/queries/constants.d.ts +5 -0
- package/lib/queries/constants.d.ts.map +1 -0
- package/lib/queries/constants.js +18 -0
- package/lib/queries/constants.js.map +1 -0
- package/lib/queries/index.d.ts +3 -0
- package/lib/queries/index.d.ts.map +1 -0
- package/lib/queries/index.js +16 -0
- package/lib/queries/index.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +505 -0
- package/mf-stats.json +561 -0
- package/package.json +85 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Copyright 2025 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, "ClickHouseLogQueryEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return ClickHouseLogQueryEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
const _react = require("react");
|
|
26
|
+
const _constants = require("../constants");
|
|
27
|
+
const _components = require("../../components");
|
|
28
|
+
const _material = require("@mui/material");
|
|
29
|
+
const _constants1 = require("../../components/constants");
|
|
30
|
+
function ClickHouseLogQueryEditor(props) {
|
|
31
|
+
const { onChange, value } = props;
|
|
32
|
+
const { datasource } = value;
|
|
33
|
+
const selectedDatasource = datasource ?? _constants.DEFAULT_DATASOURCE;
|
|
34
|
+
const [localQuery, setLocalQuery] = (0, _react.useState)(value.query || '');
|
|
35
|
+
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
36
|
+
if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === _constants.DATASOURCE_KIND) {
|
|
37
|
+
onChange({
|
|
38
|
+
...value,
|
|
39
|
+
datasource: newDatasourceSelection
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw new Error('Got unexpected non ClickHouse datasource selection');
|
|
44
|
+
};
|
|
45
|
+
const handleQueryChange = (0, _react.useCallback)((newQuery)=>{
|
|
46
|
+
setLocalQuery(newQuery);
|
|
47
|
+
}, []);
|
|
48
|
+
const handleQueryExecute = (0, _react.useCallback)((query)=>{
|
|
49
|
+
onChange({
|
|
50
|
+
...value,
|
|
51
|
+
query
|
|
52
|
+
});
|
|
53
|
+
}, [
|
|
54
|
+
onChange,
|
|
55
|
+
value
|
|
56
|
+
]);
|
|
57
|
+
(0, _react.useEffect)(()=>{
|
|
58
|
+
setLocalQuery(value.query || '');
|
|
59
|
+
}, [
|
|
60
|
+
value.query
|
|
61
|
+
]);
|
|
62
|
+
const examplesStyle = {
|
|
63
|
+
fontSize: '11px',
|
|
64
|
+
color: '#777',
|
|
65
|
+
backgroundColor: '#f5f5f5',
|
|
66
|
+
padding: '8px',
|
|
67
|
+
borderRadius: '4px',
|
|
68
|
+
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
|
|
69
|
+
whiteSpace: 'pre-wrap',
|
|
70
|
+
lineHeight: '1.3'
|
|
71
|
+
};
|
|
72
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
73
|
+
spacing: 1.5,
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
76
|
+
datasourcePluginKind: _constants.DATASOURCE_KIND,
|
|
77
|
+
value: selectedDatasource,
|
|
78
|
+
onChange: handleDatasourceChange,
|
|
79
|
+
label: "ClickHouse Datasource",
|
|
80
|
+
notched: true
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ClickQLEditor, {
|
|
83
|
+
value: localQuery,
|
|
84
|
+
onChange: handleQueryChange,
|
|
85
|
+
onBlur: ()=>handleQueryExecute(localQuery),
|
|
86
|
+
onKeyDown: (event)=>{
|
|
87
|
+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
handleQueryExecute(localQuery);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
placeholder: "Enter ClickHouse SQL query"
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("details", {
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("summary", {
|
|
97
|
+
style: {
|
|
98
|
+
cursor: 'pointer',
|
|
99
|
+
fontSize: '12px',
|
|
100
|
+
color: '#666',
|
|
101
|
+
marginBottom: '8px'
|
|
102
|
+
},
|
|
103
|
+
children: "Query Examples"
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
106
|
+
style: examplesStyle,
|
|
107
|
+
children: _constants1.queryExample
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Copyright 2025 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, "getClickHouseLogData", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getClickHouseLogData;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _constants = require("../constants");
|
|
25
|
+
function flattenObject(obj, parentKey = '', result = {}) {
|
|
26
|
+
for (const [key, value] of Object.entries(obj)){
|
|
27
|
+
const newKey = parentKey ? `${parentKey}.${key}` : key;
|
|
28
|
+
if (value && typeof value === 'object' && !Array.isArray(value)) {
|
|
29
|
+
flattenObject(value, newKey, result);
|
|
30
|
+
} else {
|
|
31
|
+
result[newKey] = value;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
function convertStreamsToLogs(streams) {
|
|
37
|
+
const entries = streams.map((entry)=>{
|
|
38
|
+
const flattened = flattenObject(entry);
|
|
39
|
+
if (!flattened.Timestamp && flattened.log_time) {
|
|
40
|
+
flattened.Timestamp = flattened.log_time;
|
|
41
|
+
}
|
|
42
|
+
const sortedEntry = {};
|
|
43
|
+
Object.keys(flattened).sort((a, b)=>a.localeCompare(b)).forEach((key)=>{
|
|
44
|
+
sortedEntry[key] = flattened[key];
|
|
45
|
+
});
|
|
46
|
+
const line = Object.entries(sortedEntry).filter(([key])=>key !== 'Timestamp').map(([key, value])=>`<${key}> ${value === '' || value === null || value === undefined ? '--' : value}`).join(' ');
|
|
47
|
+
return {
|
|
48
|
+
timestamp: sortedEntry?.Timestamp,
|
|
49
|
+
labels: sortedEntry,
|
|
50
|
+
line
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
entries,
|
|
55
|
+
totalCount: entries.length
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const getClickHouseLogData = async (spec, context)=>{
|
|
59
|
+
if (spec.query === undefined || spec.query === null || spec.query === '') {
|
|
60
|
+
return {
|
|
61
|
+
logs: {
|
|
62
|
+
entries: [],
|
|
63
|
+
totalCount: 0
|
|
64
|
+
},
|
|
65
|
+
timeRange: {
|
|
66
|
+
start: context.timeRange.start,
|
|
67
|
+
end: context.timeRange.end
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const query = (0, _pluginsystem.replaceVariables)(spec.query, context.variableState);
|
|
72
|
+
const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
73
|
+
const { start, end } = context.timeRange;
|
|
74
|
+
const response = await client.query({
|
|
75
|
+
start: start.getTime().toString(),
|
|
76
|
+
end: end.getTime().toString(),
|
|
77
|
+
query
|
|
78
|
+
});
|
|
79
|
+
return {
|
|
80
|
+
timeRange: {
|
|
81
|
+
start,
|
|
82
|
+
end
|
|
83
|
+
},
|
|
84
|
+
logs: convertStreamsToLogs(response.data),
|
|
85
|
+
metadata: {
|
|
86
|
+
executedQueryString: query
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025 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("./ClickHouseLogQuery"), exports);
|
|
18
|
+
_export_star(require("./ClickHouseLogQueryEditor"), exports);
|
|
19
|
+
_export_star(require("./get-click-house-log-data"), exports);
|
|
20
|
+
_export_star(require("./click-house-log-query-types"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
|
+
Object.keys(from).forEach(function(k) {
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright 2025 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, "ClickHouseTimeSeriesQuery", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return ClickHouseTimeSeriesQuery;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _getclickhousedata = require("./get-click-house-data");
|
|
25
|
+
const _ClickHouseQueryEditor = require("./ClickHouseQueryEditor");
|
|
26
|
+
const ClickHouseTimeSeriesQuery = {
|
|
27
|
+
getTimeSeriesData: _getclickhousedata.getTimeSeriesData,
|
|
28
|
+
OptionsEditorComponent: _ClickHouseQueryEditor.ClickHouseTimeSeriesQueryEditor,
|
|
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
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Copyright 2025 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, "ClickHouseTimeSeriesQueryEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return ClickHouseTimeSeriesQueryEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
const _react = require("react");
|
|
26
|
+
const _constants = require("../constants");
|
|
27
|
+
const _components = require("../../components");
|
|
28
|
+
const _material = require("@mui/material");
|
|
29
|
+
const _constants1 = require("../../components/constants");
|
|
30
|
+
function ClickHouseTimeSeriesQueryEditor(props) {
|
|
31
|
+
const { onChange, value } = props;
|
|
32
|
+
const { datasource } = value;
|
|
33
|
+
const selectedDatasource = datasource ?? _constants.DEFAULT_DATASOURCE;
|
|
34
|
+
const [localQuery, setLocalQuery] = (0, _react.useState)(value.query || '');
|
|
35
|
+
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
36
|
+
if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === _constants.DATASOURCE_KIND) {
|
|
37
|
+
onChange({
|
|
38
|
+
...value,
|
|
39
|
+
datasource: newDatasourceSelection
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw new Error('Got unexpected non ClickHouse datasource selection');
|
|
44
|
+
};
|
|
45
|
+
const handleQueryChange = (0, _react.useCallback)((newQuery)=>{
|
|
46
|
+
setLocalQuery(newQuery);
|
|
47
|
+
}, []);
|
|
48
|
+
const handleQueryExecute = (0, _react.useCallback)((query)=>{
|
|
49
|
+
onChange({
|
|
50
|
+
...value,
|
|
51
|
+
query
|
|
52
|
+
});
|
|
53
|
+
}, [
|
|
54
|
+
onChange,
|
|
55
|
+
value
|
|
56
|
+
]);
|
|
57
|
+
(0, _react.useEffect)(()=>{
|
|
58
|
+
setLocalQuery(value.query || '');
|
|
59
|
+
}, [
|
|
60
|
+
value.query
|
|
61
|
+
]);
|
|
62
|
+
const examplesStyle = {
|
|
63
|
+
fontSize: '11px',
|
|
64
|
+
color: '#777',
|
|
65
|
+
backgroundColor: '#f5f5f5',
|
|
66
|
+
padding: '8px',
|
|
67
|
+
borderRadius: '4px',
|
|
68
|
+
fontFamily: 'Monaco, Menlo, "Ubuntu Mono", monospace',
|
|
69
|
+
whiteSpace: 'pre-wrap',
|
|
70
|
+
lineHeight: '1.3'
|
|
71
|
+
};
|
|
72
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
73
|
+
spacing: 1.5,
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
76
|
+
datasourcePluginKind: _constants.DATASOURCE_KIND,
|
|
77
|
+
value: selectedDatasource,
|
|
78
|
+
onChange: handleDatasourceChange,
|
|
79
|
+
label: "ClickHouse Datasource",
|
|
80
|
+
notched: true
|
|
81
|
+
}),
|
|
82
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_components.ClickQLEditor, {
|
|
83
|
+
value: localQuery,
|
|
84
|
+
onChange: handleQueryChange,
|
|
85
|
+
onBlur: ()=>handleQueryExecute(localQuery),
|
|
86
|
+
onKeyDown: (event)=>{
|
|
87
|
+
if (event.key === 'Enter' && (event.ctrlKey || event.metaKey)) {
|
|
88
|
+
event.preventDefault();
|
|
89
|
+
handleQueryExecute(localQuery);
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
placeholder: "Enter ClickHouse SQL query"
|
|
93
|
+
}),
|
|
94
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("details", {
|
|
95
|
+
children: [
|
|
96
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("summary", {
|
|
97
|
+
style: {
|
|
98
|
+
cursor: 'pointer',
|
|
99
|
+
fontSize: '12px',
|
|
100
|
+
color: '#666',
|
|
101
|
+
marginBottom: '8px'
|
|
102
|
+
},
|
|
103
|
+
children: "Query Examples"
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
|
|
106
|
+
style: examplesStyle,
|
|
107
|
+
children: _constants1.queryExample
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
})
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// Copyright 2025 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, "getTimeSeriesData", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getTimeSeriesData;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _constants = require("../constants");
|
|
25
|
+
function buildTimeSeries(response) {
|
|
26
|
+
if (!response || !response.data || response.data.length === 0) {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
const values = response.data.map((row)=>{
|
|
30
|
+
const timestamp = new Date(row.time).getTime();
|
|
31
|
+
const value = Number(row.log_count);
|
|
32
|
+
return [
|
|
33
|
+
timestamp,
|
|
34
|
+
value
|
|
35
|
+
];
|
|
36
|
+
});
|
|
37
|
+
return [
|
|
38
|
+
{
|
|
39
|
+
name: 'log_count',
|
|
40
|
+
values
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
const getTimeSeriesData = async (spec, context)=>{
|
|
45
|
+
if (spec.query === undefined || spec.query === null || spec.query === '') {
|
|
46
|
+
return {
|
|
47
|
+
series: []
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const query = (0, _pluginsystem.replaceVariables)(spec.query, context.variableState);
|
|
51
|
+
const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
52
|
+
const { start, end } = context.timeRange;
|
|
53
|
+
const response = await client.query({
|
|
54
|
+
start: start.getTime().toString(),
|
|
55
|
+
end: end.getTime().toString(),
|
|
56
|
+
query
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
series: buildTimeSeries(response),
|
|
60
|
+
timeRange: {
|
|
61
|
+
start,
|
|
62
|
+
end
|
|
63
|
+
},
|
|
64
|
+
stepMs: 30 * 1000,
|
|
65
|
+
metadata: {
|
|
66
|
+
executedQueryString: query
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright 2025 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("./get-click-house-data"), exports);
|
|
18
|
+
_export_star(require("./ClickHouseQuery"), exports);
|
|
19
|
+
_export_star(require("./ClickHouseQueryEditor"), exports);
|
|
20
|
+
_export_star(require("./click-house-query-types"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
|
+
Object.keys(from).forEach(function(k) {
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Copyright 2025 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: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
DATASOURCE_KIND: function() {
|
|
25
|
+
return DATASOURCE_KIND;
|
|
26
|
+
},
|
|
27
|
+
DEFAULT_DATASOURCE: function() {
|
|
28
|
+
return DEFAULT_DATASOURCE;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const DATASOURCE_KIND = 'ClickHouseDatasource';
|
|
32
|
+
const DEFAULT_DATASOURCE = {
|
|
33
|
+
kind: DATASOURCE_KIND
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright 2025 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-time-series-query"), exports);
|
|
18
|
+
_export_star(require("./click-house-log-query"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
20
|
+
Object.keys(from).forEach(function(k) {
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return from;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright 2025 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
|
+
require("@testing-library/jest-dom");
|
|
18
|
+
// Always mock e-charts during tests since we don't have a proper canvas in jsdom
|
|
19
|
+
jest.mock('echarts/core');
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ReactCodeMirrorProps } from '@uiw/react-codemirror';
|
|
2
|
+
import { ReactElement } from 'react';
|
|
3
|
+
export type ClickQLEditorProps = Omit<ReactCodeMirrorProps, 'theme' | 'extensions'>;
|
|
4
|
+
export declare function ClickQLEditor(props: ClickQLEditorProps): ReactElement;
|
|
5
|
+
//# sourceMappingURL=ClickQLEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClickQLEditor.d.ts","sourceRoot":"","sources":["../../../src/components/ClickQLEditor.tsx"],"names":[],"mappings":"AAaA,OAAmB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAGzE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,YAAY,CAAC,CAAC;AAEpF,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAuCrE"}
|